Page 1 of 1

Language Support - GetText

Posted: Wed May 09, 2007 5:44 am
by AlexC
Hey,

I'm building (nearly finished) my own MVC framework that is being used to power a content management system I am creating, however I would like to add language-support to my framework. I could easily create a new php file and put an array in it, with the different langauge phrases and translations, however I have also heard about GetText to provide translations.

Is it a bad idea to use GetText, or will my project benefit from it? I have found a script called php-gettext which you can use instead of the default php gettext functions, which I would use if I do go the GetText route as not all PHP installs have gettext enabled or installed on the system.

How do you do you're language support/translations, should I use Gettext?

Posted: Wed May 09, 2007 6:06 am
by CoderGoblin
This is a matter of personal taste (personally I don't like gettext). Look at the Zend Framework Documentation for a couple of additional options. You may also want to check out search on these forums. One topic that spring to mind...
Multilanguage support

Posted: Wed May 09, 2007 9:29 am
by Maugrim_The_Reaper
I'm fairly sure an XML format tends to be popular outside smaller applications. Once you run into a PHP Array you'll end up with dozens of translators not fully familiar with the syntax. Gettext is not as bad, but the final format is only machine readable. XML, often overlooked because it's "slow" is both easily handled in PHP, and is human readable. The Zend Docs have support for the two dominant XML formats.

Edit: The database is another option though it depends on implementation. If you have access to SQLite might be worth looking into.