note 99816 deleted from book.gettext by danbrown

From: Date: Thu, 09 Sep 2010 14:10:39 +0000
Subject: note 99816 deleted from book.gettext by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-172408@lists.php.net to get a copy of this message
Note Submitter: c9s ---- My workable code: <?php # $language = 'en_US.utf8'; $language = 'zh_TW'; putenv("LANG=$language"); setlocale(LC_MESSAGES, $language ); $textdomain = 'project1'; bindtextdomain( $textdomain, dirname(__FILE__).'/locale'); bind_textdomain_codeset( $textdomain, 'UTF-8'); textdomain( $textdomain ); echo _('Author'); echo _("Upload Image"); ?> And for simplify gettext usage , I wrote App::Po for managing locale/*/LC_MESSAGES and message parsing http://github.com/c9s/App-Po

« previous php.notes (#172408) next »