开发者

PyroCMS language support

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 Hel开发者_运维知识库lo". 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


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜