1
votes

I would like to see a Dutch translation of the CakePHP 2.3.7 formhelper months. See this link: http://dev4.west-dyke.com/verhuur/reserveren.

However I can't seem to get it working. I also saw another post about this problem, but it still didn't solve the problem.

I created a folder named app/Locale/nl_NL/LC_MESSAGES/cake.po. The PO file was generated with poedit from cake.pot in the app/Locale directory.

I added these lines to cake.po:

msgid "January"
msgstr "Januari"

msgid "February"
msgstr "Februari"

msgid "March"
msgstr "Maart"

msgid "April"
msgstr "April"

msgid "May"
msgstr "Mei"

msgid "June"
msgstr "Juni"

msgid "July"
msgstr "Juli"

msgid "August"
msgstr "Augustus"

msgid "September"
msgstr "September"

msgid "October"
msgstr "Oktober"

msgid "November"
msgstr "November"

msgid "December"
msgstr "December"

I added the following line to the bottom of my bootstrap.php file:

Configure::write('Config.language','nl_NL');

Does anybody have an idea of what's going wrong?

2
Maybe it's caused by caching? You can test that by changing the values in the default config file and see whether they show up in your select. - Pieter
@Pieter I am working in development mode, so caching is disabled. - Hans
OK, if you change the default.po-file, are the changes showing up (in English)? - Pieter
Yes, when I call echo __('August'); it echoes my Dutch translation from default.po. However the months in the form haven't changed. - Hans
Mind your casing: "app/locale/" should be "app/Locale/". Even though on windows both will work you should always respect the casing to avoid issues in the future or other OS. - mark

2 Answers

2
votes

Allright I fixed it, I did the following to get multi language and a Dutch translation of the CakePHP formhelper months working:

1 - I created a folder named app/Locale/nl_NL/LC_MESSAGES

2 - I ran ./Console/cake i18n extract through the console

3 - I added the following lines to cake.pot:

msgid "January"
msgstr "Januari"

msgid "February"
msgstr "Februari"

msgid "March"
msgstr "Maart"

msgid "April"
msgstr "April"

msgid "May"
msgstr "Mei"

msgid "June"
msgstr "Juni"

msgid "July"
msgstr "Juli"

msgid "August"
msgstr "Augustus"

msgid "September"
msgstr "September"

msgid "October"
msgstr "Oktober"

msgid "November"
msgstr "November"

msgid "December"
msgstr "December"

4 - I used poEdit to create .po (and .mo) files from default.pot and cake.pot. I placed the .po (and .mo) files inside the earlier created folder.

5 - I placed the following line inside bootstrap.php:

Configure::write('Config.language','nl_NL');
1
votes

They use a different translation domain (e.g. cake, cake_dev). You'll have to translate these files. See __d function.