OOP Posted August 28, 2010 Share Posted August 28, 2010 Hi there, I am working on a project and one of my client's requirements is to have his web site viewed in multiple languages. I know how to do that but I am just wondering which going to be better...One file for each language Vs multiple files Option #1: One file that include everything Language folder: Languages => English.php French.php Options # 2: Multiple files for each part of the site Language folder: Languages => English => Admin.php => Main.php => Register.php => French => Admin.php => Main.php => Register.php I need to know which option is better and why? which is better in term of performance, memory consumption, maintenance, readability and so on appreciate your advice and help regards Quote Link to comment https://forums.phpfreaks.com/topic/211967-one-language-file-vs-multiple-language-files-which-is-better/ Share on other sites More sharing options...
huh Posted August 29, 2010 Share Posted August 29, 2010 I think it really depends on how large the site is and how it's organized. If the site isn't that big then a single file probably makes sense. If the site is large and can be broken down into logical sections, or the site is expected to grow quite large, then multiple files or language sets for each sections probably makes sense. I'm working on a project now where the site is broken into multiple logical modules, and each module has its own language set associated with it. But I still have a main language set that is included on each page for common stuff that I expect to be on each page. This makes it much easier to find what I need to change for wording on the site, so maintaining/readability was easier than a monolithic file. Can't speak much on the performance and memory consumption though. Quote Link to comment https://forums.phpfreaks.com/topic/211967-one-language-file-vs-multiple-language-files-which-is-better/#findComment-1104878 Share on other sites More sharing options...
xeronix Posted August 30, 2010 Share Posted August 30, 2010 I would go with multiple language files. One language file would (I imagine) get HUGE over time, if you were to improve or modify the site. If you were to try and split that file, it would be very tedious, so to start structured at the start works great. Quote Link to comment https://forums.phpfreaks.com/topic/211967-one-language-file-vs-multiple-language-files-which-is-better/#findComment-1105096 Share on other sites More sharing options...
plznty Posted September 15, 2010 Share Posted September 15, 2010 Multiple, since it could be stored in the language directory and also is easier for you to organised without calling for the whole script. Quote Link to comment https://forums.phpfreaks.com/topic/211967-one-language-file-vs-multiple-language-files-which-is-better/#findComment-1111232 Share on other sites More sharing options...
OOP Posted September 23, 2010 Author Share Posted September 23, 2010 thanks guys for your help and feedback regards Quote Link to comment https://forums.phpfreaks.com/topic/211967-one-language-file-vs-multiple-language-files-which-is-better/#findComment-1114455 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.