• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating Multi-lingual Application

#1
[eluser]bigdaddysheikh[/eluser]
Hey Guys,

I am working on this project that requires multiple languages such as chinese, arabic, farsi, polish etc... How is this handled by the database and how do I display the output? Since these languages are not system fonts, is there anything I can do programming wise to instill that the language stays the one selected rather than english.

Any light on this topic would be greatly appreciated.

Thanks in advance.

#2
[eluser]imn.codeartist[/eluser]
Of course you can do it.

Because mysql and php supports multiple languages.

#3
[eluser]JanDoToDo[/eluser]
Hey there. Essentially, you dont want to use static text in any of your views. Store all the information you want in the database with an associated 'language_id'. Then, when a view is loaded, select all the data you want but add another condition where the current language = language_id and it will select only the text you want in that language. Onthe site you just need a way of choosing/changing the language and bobs your uncle - you have different languages!

#4
[eluser]Johan André[/eluser]
...in combination with language-files for the "static"-content.

#5
[eluser]JanDoToDo[/eluser]
...indeed Smile

#6
[eluser]Loquela[/eluser]
Of course all your international "content" will be stored in your database. Content items will have a language id and you would ideally have a separate table to manage your languages.

Use of cookies or sessions will allow you to set and maintain the language for individual users.

For your website interface text it would probably be best to use language files as Johan suggest and the Codeigniter language class

#7
[eluser]viisik[/eluser]
[quote author="Johan André" date="1262887434"]...in combination with language-files for the "static"-content.[/quote]

Can anyone explain it a little further how exactly is it done - the language_id thing

and how all the texts are stored in the database,
how the language files should look like
and what folder should include the language files under dtdocs

#8
[eluser]Loquela[/eluser]
[quote author="viisik" date="1263051904"][quote author="Johan André" date="1262887434"]...in combination with language-files for the "static"-content.[/quote]

Can anyone explain it a little further how exactly is it done - the language_id thing

and how all the texts are stored in the database,
how the language files should look like
and what folder should include the language files under dtdocs[/quote]

You would have a table "languages" that contain two fields 'lang_id' and 'language'

Your content table would contain columns for each translation, these columns would be linked to the language table so your app can serve the correct content for the language set by the user.

Check the user guide for info on the Language class


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.