Anyone with a good knowledge of multilanguage setup for cake 1.3?

Today, I am using a; /locale/nor/LC_MESSAGES/default.po

header:

msgid ""
msgstr ""
"Project-Id-Version: 2\n"
"POT-Creation-Date: 2012-04-17 20:37+0200\n"
"PO-Revision-Date: 2012-04-17 20:39+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"

and regular language strings inside it.

in bootstrap.php => Configure::write('Config.language', 'nor');

simple strings like this;

msgid "Norwegian"
msgstr "Norsk"

is translated ok, but, if I use plural (for time helper)

msgid "second"
msgid_plural "seconds"
msgstr[0] "sekund"
msgstr[1] "sekunder"

None of those are translated!?!

I am not sure what else to do, as I have manually created the .po file in an editor (no extraction using console or whatever)

Something else I need to include to have it translated correctly? Planning to use 2 languages for the site in the future, setting correct locale depending on what domain is visited. example: domain.com => eng & domain.no => no

Thanks for any insight to this.

-Tom

有帮助吗?

解决方案

Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n

This line is the culprit. Change INTEGER to 1 and EXPRESSION to 0. Then msgstr[0] will contain your singular form and msgstr[1] will contain the plural form.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top