views:

171

answers:

1

I Checked MSDN and the locale string is zh_Hant but I also tried with zh_TW (Chinese, Taiwan). The Traditional Chinese Characters look OK in the poEditor, but when I open the file in the browser the characters are just weird symbols («¢Åo¥@¬É!). I think the translation is working but there' something wrong with the encoding (I used UTF-8 for both Charset and Source Code Charset).

The files generated with poEditor:

messages.po:

msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-02-15 16:26+0800\n"
"PO-Revision-Date: 2010-02-15 16:26+0800\n"
"Last-Translator: Jano Chen <[email protected]>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-Basepath: C:\\wamp\\www\\php-test\n"
"X-Poedit-Language: Chinese\n"
"X-Poedit-Country: TAIWAN\n"
"X-Poedit-SourceCharset: utf-8\n"
"X-Poedit-SearchPath-0: .\n"

#: test.php:3
msgid "Hello World!"
msgstr "哈囉世界!"

PS: When I change the encoding display in Firefox to Big5 the Characters are shown properly but if I change them to Utf-8 it shows: ���o�@��!.

+1  A: 

I finally solved it. I had to had the following to localization.php

bind_textdomain_codeset("messages", 'UTF-8');
janoChen
Nice one - thanks
Mark White