From:             redlizard at redlizard dot nl
Operating system: Irrelevant
PHP version:      5.2.0
PHP Bug Type:     Feature/Change Request
Bug description:  Gettext needs a do_not_use_fallback parameter

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 bug report at http://bugs.php.net/?id=40298&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40298&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40298&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40298&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40298&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40298&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40298&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40298&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40298&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40298&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40298&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40298&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40298&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40298&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40298&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40298&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40298&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40298&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40298&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40298&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40298&r=mysqlcfg

Reply via email to