1

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

0

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.