Internationalization in PHP

atpolessrop

New Member
I am currently researching the best methods to integrate \[code\]i18n\[/code\] into projects.There's several methods I have thought of doing this, first being a database scheme to store the strings and relevant locale, but the problem with this is that it would not be that easy to select the strings, because i would not like to perform quesries like so:\[code\]SELECT text FROM locales WHERE locale = 'en_GB' AND text_id = 245543\[/code\]Or\[code\]SELECT text FROM locales WHERE locale = 'en_GB' AND text_primary = 'hello'\[/code\]The next method would be to store them within files such as \[code\]locales/en_gb/login/strings.php\[/code\] and then try and access them via an class specifically developed like so:\[code\]$Language = Registry::Construct('Language',array('en_GB'));echo $Language->login->strings->hello;\[/code\]The issue with this is I would have to build a system that would update these files via an administration panel witch is very time consuming, not just building the system to manage the strings but actually managing the strings as the site grows
  • What other methods are there that will be beneficial for a large system
  • Is there any automated way to do 'Translation' as such
  • Should I stick with a database method and build a system for users to translate strings with rating / suggest better version ?
  • What systems have you tried in the past and should I look into them or totally avoid them.
Look forward to some answers :)
 
Back
Top