|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-09-07 05:51 UTC] bostjan dot zoks at uni-mb dot si
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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Dec 14 21:00:01 2025 UTC |
just a typical hack question... does $string = _("my string goes here %s"); printf("$string", 2); or something simliar to that work?