CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

huangapple go评论55阅读模式
英文:

CakePhp 4: I configured I18n internationalization but the site is still in english

问题

I'm here to help with the translation. Here's the translated content:

晚上好的社区,

我试图使用cakephp 4的本地化工具,但没有成功。

首先,我将我的pot和mo文件放在cake_root/resources/locales/es_AR目录下。
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

在我的app.php文件中,我有:
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

最后,在我的AppController中,我有...
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

一切看起来都没问题,但网站仍然是英文的。你能帮我找到错误吗?

谢谢,

编辑
我不知道发生了什么。我检查了我的default.po文件(位于我的locale/es_AR文件夹下),看起来没问题。
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

但我的应用程序显示的是英文消息。
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

有人有线索可以跟进吗?

编辑 2
我正在像你说的那样从__()中获取字符串,@Greg Schmidt。
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

英文:

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.
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

In my app.php file I have:
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

Finally, in my AppController I have...
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

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.
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

But mi app is showing messages in english.
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

Does anyone have a lead to follow?

EDIT 2
I'm grapping string in __() as you say @Greg Schmidt.
CakePhp 4:我配置了I18n国际化,但网站仍然是英文。

答案1

得分: 0

在最后,它起作用了。这是一个缓存问题。手动删除 <cakeroot>/tmp/cache 文件夹解决了问题。

英文:

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

huangapple
  • 本文由 发表于 2023年5月21日 15:14:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76298717.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定