|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Multi-language design
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
language.mysite.com Or to just make it a dir www.mysite.com/lang/ What do you suggest? Any advantages of one over the other? |
|
#2
|
||||
|
||||
|
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.
|
|
#3
|
||||
|
||||
|
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? |
|
#4
|
|||
|
|||
|
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.
|
|
#5
|
||||
|
||||
|
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.
|
|
#6
|
||||
|
||||
|
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. ^^
|
|
#7
|
|||
|
|||
|
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.
|
|
#8
|
||||
|
||||
|
that was a good idea bricker42. i can see what you mean about your post.
|
|
#9
|
||||
|
||||
|
Hi,
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.... regards Jamie
__________________
Cheers, Jamie # skiFFie | Home of the 'accessibility module' for Drupal # Jamie Burns [me] Accessibility Module [drupal] # guidelines | search | wap resources | not getting help | fold to cure # Any form of employment is strictly prohibited ...... __________________ 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. __________________ |
|
#10
|
|||
|
|||
|
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. |
![]() |
| Viewing: Dev Shed Forums > Web Design > Web Design Help > Multi-language design |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|