0

Good night's community,

I trying to use localization tools of cakephp 4 without success.

First, I have my pot and mo files in cake_root/resources/locales/es_AR. enter image description here

In my app.php file I have: enter image description here

Finally, in my AppController I have... enter image description here

Everything looks OK but site is still in english. Can you help me to find my error?

Thanks,

EDIT I have no idea what's going on. I checked my default.po file (under my locale/es_AR folder) and it looks OK. enter image description here

But mi app is showing messages in english. enter image description here

Does anyone have a lead to follow?

EDIT 2 I'm grapping string in __() as you say @Greg Schmidt. enter image description here

Gonzalo
  • 43
  • 6
  • Why is your `default.mo` file only 3KB? That seems wrong, unless the `.pot` file only contains 30KB of comments. – ndm May 21 '23 at 14:01
  • As usual you're right @ndm . I compiled the original .mo file with a lot of unconfirmed entries. I corrected the .mo file and cleaned cache but I still have the app en en_US. – Gonzalo May 22 '23 at 03:27
  • You haven't shown the code where you're performing the translation in the template. Safe to assume you're using `__('Periods')`, etc.? – Greg Schmidt May 23 '23 at 04:27

1 Answers1

0

Well, in the end it worked. It was a cache problem. Manually deleting the /tmp/cache folder fixed the problem.

Gonzalo
  • 43
  • 6
  • 1
    you shouldn't delete your tmp folder. instead use `bin/cake cache clear _cake_core_` to force cakephp to reload your translations – Steve Kirsch Jul 22 '23 at 13:54