#40298 [Opn->Bgs]: Gettext needs a do_not_use_fallback parameter
| From: | tony2001@php.net | Date: | Wed, 31 Jan 2007 19:46:58 +0000 |
| Subject: | #40298 [Opn->Bgs]: Gettext needs a do_not_use_fallback parameter | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108281@lists.php.net to get a copy of this message | ||
ID: 40298
Updated by: tony2001@php.net
Reported By: redlizard at redlizard dot nl
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
Operating System: Irrelevant
PHP Version: 5.2.0
New Comment:
gettext() uses gettext() function (see
man 3 gettext).
Previous Comments:
------------------------------------------------------------------------
[2007-01-31 19:39:08] redlizard at redlizard dot nl
Description:
------------
When using gettext($somestring), if $somestring could not be
translated, it is returned without further translation. There should be
a possibility to return a specific value if the string could not be
translated instead. This impossibility is rather annoying when writing
a sophisticated i18n system.
Reproduce code:
---------------
// suggested solution:
$translated_text = gettext("some_string", true /* this optional
parameter stands for "return false if text could not be translated"
*/);
if($translated_text === false) {
echo "some_string could not be translated!\n";
} else {
echo "some_string is $some_string in your favorite language\n";
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40298&edit=1