note 56314 added to function.gettext

From: Date: Tue, 30 Aug 2005 14:05:56 +0000
Subject: note 56314 added to function.gettext
Groups: php.notes 
Request: Send a blank email to php-notes+get-94428@lists.php.net to get a copy of this message
Take care when extracting the strings from the source files : if your source files are not encoded in ascii, then xgettext must be used with the --from-code option, and the generated .po file is *always* UTF-8 (even if you used a different --from-code charset). The usage of gettext will not work later on strings which include non ascii caracters. For make it working, you have to translate the .po file to your proper charset with msgconv. Example : my source files are encoded in iso-8859-1 $ xgettext --from-code=iso-8859-1 -n *.php -o myapp.po ==> myapp.po is in UTF-8 (and generated .mo files will not work with gettext). I have to convert it to iso-8859-1 before translating : $ msgconv --to-code=iso-8859-1 myapp.po -o myapp.po ...and now translate the file. ---- Manual Page -- http://www.php.net/manual/en/function.gettext.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+56314 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes&reason=non-english Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56314&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+56314&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#94428) next »