drau89457 2015-10-29 21:10
浏览 28

Cake PHP - 新的本地化不作为选项出现

We have a Cake app developed by contractors. It is set up for multiple languages (apparently). I can see the language subdirectories under /locale - however, if we add new translated .po files into, for example, the /LC_MESSAGE subdirectory for French (including default.po for that lang) the French language does not display in the language change dropdown.

I've checked the Cake docs, and while Cake seems to suggest the locale subdirectories are all two character names (eg. "fr" for French as per example above), the developers have set it up using "fra" instead. I am not sure if this is a problem, or just a sign of Cake's flexibility.

Another thing is that the working translation we do have (Spanish) shows in its folder duplicate .mo files as well as our original .po files. I have converted the default.po file to default.mo for the fra locale and uploaded that, cleared browser cache, and reloaded and still no French language becomes available in the language selector.

Ideally we want to be able to add and update new languages as they become available without turning to the developers every time (they allow spammers onto the host, unfortunately). Does the Cake app have to be rebaked each time we add a locale language? Do I need to delete cache files in the Cake app on the host to enable new languages? Any guidance would be greatly appreciated.

  • 写回答

1条回答 默认 最新

  • dongzen7263 2015-10-30 03:25
    关注

    the /LC_MESSAGE subdirectory for French

    The folder should LC_MESSAGES, plural.

    the developers have set it up using "fra" instead. I am not sure if this is a problem, or just a sign of Cake's flexibility.

    3 letter language codes work too. Though I don't remember if it should be fra or fre.

    I have converted the default.po file to default.mo for the fra locale and uploaded that

    Having .mo files is not strictly necessary. Cake can read .po files too.

    Does the Cake app have to be rebaked each time we add a locale language?

    Unless the developer has done something really weird, no.

    Do I need to delete cache files in the Cake app on the host to enable new languages?

    Yes. After adding a new language you need to clear application cache. For your case clear all files in /app/tmp/persistent folder.

    评论

报告相同问题?

悬赏问题

  • ¥15 使用EMD去噪处理RML2016数据集时候的原理
  • ¥15 神经网络预测均方误差很小 但是图像上看着差别太大
  • ¥15 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端