Re: Re: python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)

From: Date: Mon, 03 Sep 2001 13:12:37 +0000
Subject: Re: Re: python dictionary-like % (percent) substitution in php (was: Good idea in % (percent) substitutions in string)
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-64953@lists.php.net to get a copy of this message
On 03/09/01, "Marcus" <marcus.boerger@post.rwth-aachen.de> wrote: > first: when handling multilanguage support you will of cause have > an array of supported languages like $languages=array("en_GB","de_DE"...) [...] Why not use gettext()? something like this: setlocale(LC_ALL, "en_GB"); bindtextdomain("mytranslations", "/path/to/gmofiles"); textdomain("mytranslations"); $translations = array( "animal" => _("Cobra"), ... ); $translated_text = saprintf($text, $translations); Then you don't need lots of different language arrays to parse. I'm not sure that PHP should implement multi-language functions itself, perhaps something like that could go in PEAR? --Wez. PS: Anyone out there got gettext working with PHP under win32? It's on my TODO, albeit near the bottom (and it's a big list!).

« previous php.dev (#64953) next »