Linux Today: Linux News On Internet Time.

zez.org: Internationalization using PHP and GetText

Dec 16, 2000, 15:10 (0 Talkback[s])
(Other stories by Luis Argerich)

[ Thanks to Paul K Egell-Johnsen for this link. ]

"If you are a web developer using PHP from small web applications to large corporate portals with millions of page views, you may suddenly find that you need your site or application translated to another language. When your company opens www.company.com.br you need your application in Portuguese, then you'll need it in Japanese and so on. You don't have a "translation" problem, you have an internationalization problem."

"Translating only implies simple string translation of code, you may do it in a clever way or a painful (very) way scanning all the code and translating strings. This method tends to produce errors (Have you ever seen a site in Spanglish?) and it is not reusable, just a patch. Internationalization defines a strategy to build sites and applications that you can easily translate into other languages. This is the goal of this article."

"GNU has a very good set of tools to produce internationalizable applications called gettext, it was developed with "C" and "C++" applications in mind but is also very easy to use in other languages such as PHP. Gettext is probably installed on your Unix station, try a gettext command like 'gettext' from the command line to see if you have it. If not (rare) download the package from ftp.gnu.org and install it. If you have gettext the next stage is to use it from PHP."

Complete Story

Related Stories: