AW: [SMARTY] Using smarty with languages other than English

From: Date: Wed, 02 Oct 2002 08:04:06 +0000
Subject: AW: [SMARTY] Using smarty with languages other than English
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6070@lists.php.net to get a copy of this message
hi there! i wouldn't place strings of different languages in one config file. would it do the way of properties-files (java / resourcebundles). one file per language. e.g. textstrings_en.conf (-> english) textstrings_ja.conf (-> japanese) textstrings_de.conf etc. it's easier to add new translations in the future and the different config files wouldn't become too large. set the name of your config-file in your php-script: [...] $tpl->assign('lang_file', 'textstrings_'.$lang.'.conf'); [...] my 2 cents... mario > -----Ursprungliche Nachricht----- > Von: Brodie Thiesfield [mailto:bt@jellycan.com] > Gesendet: Mittwoch, 2. Oktober 2002 03:28 > An: smarty-general@lists.php.net > Betreff: [SMARTY] Using smarty with languages other than English > > > Hi, > > I'm hoping to use Smarty for templating languages. 1 > template, all text > stored in a config file and the section is the language I want used. > Questions relating to this are... > > (1) > > Smarty seems to support multi-byte languages like Japanese. > Can someone > confirm this for me please? > > (2) > > In order to do this I am trying to use a PHP variable storing the > section name, eg: > > $lang = 'en'; > > .. and then use this variable when loading the config file for the > template .. > > {* Smarty Template *} > {config_load file="index.cfg" section=$lang} > > But this doesn't seem to be working for me (it only works if > I hard-code > the section name in the template). > > (3) > > Although I have a encoding specified in a meta tag in the file, the > browser doesn't seem to recognize that the encoding is what I tell it > (eg Shift_JIS for the Japanese version). Is there something > special that > I need to do to ensure that the page encoding is set to what > I want it > to be? > > Regards, > Brodie. > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

« previous php.smarty.general (#6070) next »