Reputation: 5069
Our custom modules in PyroCMS need to support multiple languages. How is this done? Particularly:
/addons/<module name>/language/
. Is this right?"greeting" = "Gibberish Hello"
. Must we also define "greeting"
in english, etc.?"cp_title" = "Control Panel"
must be translated into "cp_title" = "Gibberish Control Panel"
, etc.?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
Upvotes: 4
Views: 2410
Reputation: 30766
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
Upvotes: 0
Reputation: 8035
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.
Upvotes: 1