|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-31 19:46 UTC] tony2001@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 29 21:00:01 2025 UTC |
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"; }