#19274 [NEW]: gettext doesn't translate if using printf formatted strings
| From: | bostjan dot zoks at uni-mb dot si | Date: | Sat, 07 Sep 2002 10:51:13 +0000 |
| Subject: | #19274 [NEW]: gettext doesn't translate if using printf formatted strings | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-18607@lists.php.net to get a copy of this message | ||
From: bostjan.zoks@uni-mb.si
Operating system: Windows XP
PHP version: 4.2.3
PHP Bug Type: Gettext related
Bug description: gettext doesn't translate if using printf formatted strings
If using standard strings, gettext correctly uses translated string.
If using formatted strings (those that can be used for printf, like "my
name is %s and I'm %d years old"), it leaves string in original language.
Short example:
--- from test.php ---
print (_("how are you?"));
print "<br>";
printf (_("and now, when asking %d nd time?"), 2);
--- from i18n.po ---
#: test.php:6
msgid "how are you?"
msgstr "kak si kaj?"
#: test.php:8
#, c-format
msgid "and now, when asking %d nd time?"
msgstr "in sedaj, ko sprasujem %d .?"
--- output from this script ---
kak si kaj?
and now, when asking 2 nd time?
-------
I'm using PHP4.2.3 as apache1.3.26 module on WinXP.
Regards,
Bostjan
--
Edit bug report at http://bugs.php.net/?id=19274&edit=1
--
Try a CVS snapshot: http://bugs.php.net/fix.php?id=19274&r=trysnapshot
Fixed in CVS: http://bugs.php.net/fix.php?id=19274&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=19274&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=19274&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=19274&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=19274&r=support
Expected behavior: http://bugs.php.net/fix.php?id=19274&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=19274&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=19274&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=19274&r=globals