CodeIgniter Forums
General principle of making a multi-language website - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: General principle of making a multi-language website (/showthread.php?tid=27446)



General principle of making a multi-language website - El Forum - 02-11-2010

[eluser]viisik[/eluser]
What is the right general principle/architecture of making multilanguage website with CI. The two main options would probably be:


1. Use templates.
Basically what this means is that to create two identical templates, with different texts used depending on the language the user is currently looking at. When we load our pages, we will have to check the current language and load the templates accordingly.
This is similar to what apache's manual has.

2. Use variables.
Similar to option 1, we would define a list of variables which contain the texts we want to use. The variable will then be placed in a single template file. When we load the page, we would read the contents of the variable and then it will be replacing the variables in our template.
This is similar to what phpmyadmin has.


General principle of making a multi-language website - El Forum - 02-11-2010

[eluser]hccoder[/eluser]
Hello,

I'm using GetText to handle multilanguage sites,it works good, and very fast.

CodeIgniter-GetText


General principle of making a multi-language website - El Forum - 02-11-2010

[eluser]viisik[/eluser]
[quote author="hccoder" date="1265904995"]Hello,

I'm using GetText to handle multilanguage sites,it works good, and very fast.

CodeIgniter-GetText[/quote]

so this is like an extention of the default CI language library, which means that you are also using the original library when using GetText

and the method that it uses is that it overwrites the words as variables, each variable according to the selected language package ?


General principle of making a multi-language website - El Forum - 02-11-2010

[eluser]hccoder[/eluser]
I'm using a library what is extends 'CI_Language', and in the views I call the gt_replace($word,$plural=false,$gtvar=false) function, and this is repleacing the words from the .po files.


General principle of making a multi-language website - El Forum - 12-20-2010

[eluser]landitus[/eluser]
Hello!
I'm looking into the Gettext library and was wondering if it's possible to have clean URLS like the i18n Library http://maestric.com/doc/php/codeigniter_i18n I'm thinking like http://your_base_url/en/about and http://your_base_url/fr/about. Is it possible to have this using the gettext Lib? Is there more configuration needed?