gettext and variable parsing

From: Date: Mon, 11 Aug 2003 08:53:13 +0000
Subject: gettext and variable parsing
Groups: php.i18n 
Request: Send a blank email to php-i18n+get-603@lists.php.net to get a copy of this message
i've successfully setup internationalization, however, i have problems with variable parsing : how do you make this work? $from = 10; $to = 15; $total = 25; echo _("Displaying records from $from to $to of $total"); I know that the expression "Displaying records from $from to $to of $total" gets parsed first into "Displaying records from 10 to 15 of 25" before being passed to gettext. So when gettext looks it up in the .mo files, it doesn't see the appropriate string. However, if I do echo _('Displaying records from $from to $to of $total'); it gets translated alright, but the values of $from, $to and $total don't get parsed. Is there any way other than doing a replace (say, replace $from with '5'..etc) thanks! ramil

« previous php.i18n (#603) next »