Re: internationalisation?
| From: | Curt Zirzow | Date: | Wed, 28 Apr 2004 01:55:05 +0000 |
| Subject: | Re: internationalisation? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-184821@lists.php.net to get a copy of this message | ||
* Thus wrote Justin French (justin@indent.com.au):
> Hi,
>
> Anyone know some tutorials on internationalisation of a web
> application? I'm pretty sure it's just a case of:
>
> - setting the language in a config file
> - including a file/array of strings in the set language
> - calling each string as needed, and defaulting back to the primary
> language (english) if a translated string is not available.
You're looking for gettext
http://php.net/gettext
You can do things like
echo _('Translated text');
And if you've set up a translation file that matches the
'Translated text' string then the other language will get
displayed, otherwise just the english version gets printed.
Curt
--
"I used to think I was indecisive, but now I'm not so sure."