In my CakePHP application, By using cake.bat i created POT files and by using PoEdit I created PO files. So by writing __('myword') i can see localized word in my application successfully.
But now I need to localize "timeAgoInWords". When i run cake i18n extract, script didn't get the _dn() words in CakeTime http://api20.cakephp.org/view_source/cake-time#line-522
So i created a dummy.ctp file and copy-pasted contents from cake-time file to dummy file. I run cake script and POEdit again. And it created instances like below, into the file app/Locale/tur/LC_MESSAGES/default.po
#: View\App\dummy.ctp:30;33
msgid "%d minute"
msgid_plural "%d minutes"
msgstr[0] "%d dakika"
msgstr[1] "%d dakika"
In core.php i already set default language to Turkish:
Configure::write('Config.language', 'tur');
But when i check my application, results of timeAgoInWords came in English.
How can i fix this
Cake's messages are extracted into a different domain, in this case, the
cake
domain. This means that cake messages will not be extracted into yourdefault.pot
file, but will go intocake.pot
file.Curiously, cake.pot doesn't seem to be included in the download, nor does the i18n shell allow you to pass a param to include the cake core during extraction. However, it is still easily done (my comments start with a
#
):Now wait for the extraction to finish and enjoy the pain of translating ;)