PyroCMS 语言支持

发布于 2024-11-27 04:36:30 字数 679 浏览 2 评论 0原文

PyroCMS 中的自定义模块需要支持多种语言。这是怎么做到的?特别是:

  1. 我们将语言文件夹和文件放在哪里?我们假设在 /addons//language/ 中。这是对的吗?
  2. 我们是否必须提供 PyroCMS 支持的所有语言的内容翻译(特定于我们模块的内容)?例如,我们要添加“Gibberish”语言,并希望定义 "greeting" = "Gibberish Hello"。我们还必须用英语等定义“greeting”吗?
  3. 相反,我们是否也必须将 PyroCMS 支持的术语翻译成“乱码”语言?例如,“英文”翻译“cp_title”=“Control Panel”必须翻译成“cp_title”=“Gibberish Control Panel”等?
  4. 设置“?lang=zz”(其中“zz”是我们尝试添加的语言)给我们带来了以下错误:

    <块引用>

    遇到 PHP 错误

    严重性:通知

    消息:未定义索引:en

    文件名:core/MY_Controller.php

    行号:83

Our custom modules in PyroCMS need to support multiple languages. How is this done? Particularly:

  1. Where do we put the language folders and files? We assume in /addons/<module name>/language/. Is this right?
  2. Must we provide a translation of our content (content that is specific to our modules) in all of the PyroCMS supported languages? For example, we are adding the "Gibberish" language and want to define "greeting" = "Gibberish Hello". Must we also define "greeting" in english, etc.?
  3. Conversely, must we also translate into "Gibberish" language the terms that PyroCMS supports? For example, the "English" translation "cp_title" = "Control Panel" must be translated into "cp_title" = "Gibberish Control Panel", etc.?
  4. Setting "?lang=zz" (where "zz" is the language we tried to add) gave us the following error:

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined index: en

    Filename: core/MY_Controller.php

    Line Number: 83

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

慈悲佛祖 2024-12-04 04:36:30

我在阅读pyro 论坛中的帖子后遇到了这个答案。让我也在这里贡献一下:

我认为看一下由开发团队创建的与 Pyro 捆绑在一起的 Galleries 模块,会让您清楚地了解如何处理其中的大部分问题。

在画廊中,语言文件遵循以下结构:modules/galleries/language/language-name/galleries_lang.php

关于3,我认为这些应该放在system/cms/language/lang-name/中(并且,如果可以的话,你应该向 Pyro 社区贡献“乱码”语言:))

我对 4 不是 100% 确定,但我确信我在文档中看到了一些东西。

I ran into this answer after reading the post in pyro's forums. Let me contribute it here too:

I think taking a look at the Galleries module -bundled with Pyro, created by the dev team- will give you a clear idea on how to take care of most of this.

In galleries, language files follow this structure: modules/galleries/language/language-name/galleries_lang.php

About 3, I think those should be placed in system/cms/language/lang-name/ (and, if you can, you should contribute "Gibberish" language to the Pyro community :) )

I'm not 100% sure about 4, but I'm sure I saw something in the docs.

久随 2024-12-04 04:36:30

我在 或 论坛上回答了这个问题,但再一次:这里是文档:

http://docs.pyrocms.com/2.2/manual/developers/contributing/translated-language-files

I answered this on or forums, but once again: here is the documentation:

http://docs.pyrocms.com/2.2/manual/developers/contributing/translating-language-files

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文