September 18th, 2003, 10:21 PM
I have a huge website I want to translate into other languages. I use PHP for the entire site. Is it better to have all the other languages as a subdomain
Or to just make it a dir
What do you suggest? Any advantages of one over the other?
September 19th, 2003, 09:13 AM
depends on the way the site is written. A sub domain means that if you have used site root relative links ( ie /page.php ) you don't need to change them. A sub folder is easier to maintain and doesn't cost any more to setup.
September 19th, 2003, 11:07 PM
There are many ways to set up your site into different languages.
You can use a single file that contains different variables and values for the language that you want to translate.
But I think your previous suggestion will work together with the reply of icy_polecat.
but I have a question, are you going to use a database that will hold the information for your multi-language or are you going to put them in a separate php files or folders?
September 20th, 2003, 07:34 PM
Apache has the ability to deliver different files to the browser based on the browser's locale. So index.html.en would go to english users, and index.html.fr would go to french users. Not sure if this would work with php, but it might be work looking into.
September 21st, 2003, 06:59 AM
Thanks for all the replys. At the moment the different text for languages wouldn't be stored in a database but called from different files or folders.
September 21st, 2003, 12:44 PM
will it be ok guys if enzo's going to do that kind of strategy? i think it would be very stressful for him. ^_^ just asking coz im planning to do the same thing too. but now for now. ^^
September 21st, 2003, 03:16 PM
Well, my recommendation would be to keep your translated text together in one form (db or files), your layouts together in one form (db or files), and your other, dynamic data in the database. You can then either combine the translations and layouts when you publish them, or let php combine them dynamically for each request.
September 22nd, 2003, 02:46 AM
that was a good idea bricker42. i can see what you mean about your post.
September 26th, 2003, 04:47 PM
I go this suggestion from one of the guys on the forums. I had never thopught of it before, but check out this thread for more.
It essentially expands on what bricker42 said. I am currently implementing and it seems faily straight forward enough.
I am using files (ini) for translatable files and then extracting the variables dependant on where the user is on the site.
Please excuse the typos / Friday -> 12:25 -> Beer -> Gabriel Crowe (check this out if you like trance -> I don't but I have been listening to this for hours and hours....
>_ My Music Blog | Losing weight @notsoheavyblog | My Tweets
Let the might of your compassion arise to bring a quick end
to the flowing stream of the blood and tears .....
Please hear my anguished words of truth.
September 27th, 2003, 12:48 AM
jabba, that's a really cool idea.
As a side note, if you're working in Java, use ResourceBundles for this. That's what they're designed for. The functionality is very similar the .ini idea.