Acs Posted April 28, 2008 Share Posted April 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/103235-language-system/ Share on other sites More sharing options...
dptr1988 Posted April 28, 2008 Share Posted April 28, 2008 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. Quote Link to comment https://forums.phpfreaks.com/topic/103235-language-system/#findComment-528859 Share on other sites More sharing options...
Acs Posted April 28, 2008 Author Share Posted April 28, 2008 Yeah! Zen Cart uses that. But what do you think of the other solutions? Quote Link to comment https://forums.phpfreaks.com/topic/103235-language-system/#findComment-528961 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.