Jump to content


Photo

Multiple Language Websites


  • Please log in to reply
5 replies to this topic

#1 sumityadav

sumityadav
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 08 May 2006 - 06:11 AM

Can anyone help me in Creating Multiple Language Websites or any ideas to do this with PHP. [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]I dont want to create multiple copies of files for different languages, unnecessarily coping files. This should be dynamically managed.[/quote]

Please help...
can contact me at
[a href=\"mailto:sumit.kumar@redalkemi.com\"]sumit.kumar@redalkemi.com[/a]

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 08 May 2006 - 08:48 AM

I think it might be difficult to do this without having a file for each page in each language, because as far as the computer knows, they're all different files regardless if it is the same content be in different languages. You can either store all of your content in their own files, or in a database and pull the correct language out.

An alternate solution may be to have one copy of each bit of content in a database and dynamicaly submit it to an online translation service and pull the result back and display it. But as we all know, they don't do the best jobs on translation.

#3 sumityadav

sumityadav
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 08 May 2006 - 08:55 AM

What if the content on the page is dynamic. Such as displaying the form results in the chosen language etc. I need a solution to get the translations done on the fly. The way you suggested like fetching the records from the database can be done if the page content remain static but wat approach need to be followed for the Dynamic content.

[!--quoteo(post=372230:date=May 8 2006, 02:18 PM:name=SemiApocalyptic)--][div class=\'quotetop\']QUOTE(SemiApocalyptic @ May 8 2006, 02:18 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
I think it might be difficult to do this without having a file for each page in each language, because as far as the computer knows, they're all different files regardless if it is the same content be in different languages. You can either store all of your content in their own files, or in a database and pull the correct language out.

An alternate solution may be to have one copy of each bit of content in a database and dynamicaly submit it to an online translation service and pull the result back and display it. But as we all know, they don't do the best jobs on translation.
[/quote]


#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 08 May 2006 - 02:37 PM

For dynamic content, the only good way is to have a catalog of translatable words. There isn't going to be an easy fix for this one.

Info: PHP Manual


#5 sumityadav

sumityadav
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 11 May 2006 - 06:26 AM

You mean to say that i should build a huge dictionary/ directory of words or assign each character with the equivalent character code..??? Then what about the names etc fields
[!--quoteo(post=372275:date=May 8 2006, 08:07 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ May 8 2006, 08:07 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
For dynamic content, the only good way is to have a catalog of translatable words. There isn't going to be an easy fix for this one.
[/quote]


#6 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 11 May 2006 - 06:47 AM

[!--quoteo(post=373187:date=May 11 2006, 04:26 PM:name=Sumit Kumar)--][div class=\'quotetop\']QUOTE(Sumit Kumar @ May 11 2006, 04:26 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
You mean to say that i should build a huge dictionary/ directory of words or assign each character with the equivalent character code..??? Then what about the names etc fields
[/quote]

yes, unfortunately.

pages in different language can be handle and create dynamicly. Unfortunately, there is no universial rule of translating between languages. So, this will be done by human.
for example: you wanted to put "Welcome to my site".

first, create a variable called: $bundle['en'], this will hold all language term in English
then assign: $bundle['en']['welcome_site'] = "Welcome to my site."
in another language: $bundle['de']['welcome_site'] = "Hei├čen Sie Willkommen zu meiner Stelle."

When you have all terms set up in $bundle, you can manage a multi-lingual page using something like this:

$lang='de'; // specify the german language

<?php echo $bundle[$lang]['welcome_site']; ?>

you might want to check out one of my internationalization site at: www.hungrycat.org

regards,




Life's too short for arguing.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users