I set the locale zh_TWthrough
sudo locale-gen --purge en_US.UTF-8 zh_TW
And this set of BIG5 codes
locale: zh_TW directory: /usr/lib/locale/zh_TW
-------------------------------------------------------------------------------
title | Chinese locale for Taiwan R.O.C.
email | bug-glibc-locales@gnu.org
language | Chinese
territory | Taiwan R.O.C.
revision | 0.2
date | 2000-08-02
codeset | BIG5
And I have a simple PHP script
<?php
putenv('LC_ALL=zh_TW');
setlocale(LC_ALL, 'zh_TW');
bindtextdomain("myPHPApp", "./locale");
textdomain("myPHPApp");
echo gettext("hello");
I prepared the mo file (which is in UTF8 ) and placed under
./locale/zh_TW/LC_MESSAGES/myPHPApp.mo
And it echoreally worked, so what's the point of setting a locale like zh_TW.UTF-8
source
share