Jump to content

Language system


Acs

Recommended Posts

Hey! I got in a discussion with a few people about how best to do a language system.

 

My way:

I use defines to create the various languages, and when I want to change language I just include the define with the language I want.

This is a good way because with defines I don't have to worry about scope, and they are fast (at least it seems to be fast)

They said this was a bad way because it would take up too much memory

 

Other ways:

One suggested the use of an array. I don't like this way just because of the scope problem. I would always have to use the global $array to access the languages.

One other suggestion was to use gettext. I never used this and just read something about this in the manual. Doesn't seem bad, just a bit complicated to implement.

 

Hope to hear some suggestions from you guys, thanks.

Link to comment
Share on other sites

What I've seen done with most large programs is to use defines for the languages but rather then having one large file per langage, break it up into multiple files based on which page you will be working with. That way you only need to include the defines for your page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.