Time localization in CakePHP

It turns out localization is not such an obvious task. I am currently trying to localize my Nouchi.Mobi app built with CakePHP and although CakePHP i18n console shell is helpful in created POT files, there still remains the question of translating time strings in French when using for example the CakePHP timeAgoInWords() or the PHP strftime() functions . I found a good tutorial on getting it set up in your environment here. Luckily I develop on Linux so i was able to find the LC_TIME files and import them in my application. Another tip i found out was also running the i18n shell task on your CAKE_CORE folder. It will create a POT file for your views, and your helpers as well which will give you access to some of the hard coded strings like month and day of the week values.

 

Advertisement

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: