|
Increasing the priority from minor to major.
The first important question is: where should the translation of 3rd party modules go?
Let us have some cool mod/coolmodule installed with its own mod/coolmodule/lang/en_utf8/coolmodule.php I want to create Czech translation of this module. Where should cs_utf8/coolmodule.php be created? 1) into standard - dataroot/lang/cs_utf8/coolmodule.php 2) into mod/coolmodule/lang/cs_utf8/coolmodule.php The second issue discovered deals with more complicated locations of language files. Take e.g. lang/en_utf8/enrol_ldap.php. So far it used to be the only place where LDAP plugin strings have been stored. Nowadays, the get_string() also looks into enrol/ldap/lang/. So where are the English string supposed to be stored? And where should they be translated? OK, let us have for example
mod/data/preset/imagegallery/lang/en_utf8/data.php As far as I understand, the correct location of its translation should be 1) what about _local? Some thoughts...
It is clear that increasing the ease of installation of thirth party modules makes a clear view on translation locations impossible. There are core language files and thirth party module language files What never should happen, is that locally created language files are overwritten by an upgrade. Therefore I suggest to search for langstrings in I suggest to write all translations by default in Translators who maintain a language pack can switch to the moodledata/lang/XX_utf8 folder I don't like the idea of saving localised lang files together with the thirth party module files: I don't like to make it necessary to give apache write access to a /public_html folder, especially since it is not necessary (we have the moodledata/lang folder). It also makes upgrades more difficult, since you cannot replace the whole Mooldescript (you have to search your modifications on language files first in a bunch of different /mod folders) The capabilities seem to be right way how to prevent the overwriting of distributed language packs by non-maintainers. I have added the link to
Koen,
thank you for your thoughts! I agree with the approach proposed.Several last things are not clear too much for me: Haver the example from my previous post: Now imagine there is another database preset devoleped and distributed as a part of the core installation, e.g. "bookmarks". As I understand, its strings should then be saved into There is already one master moodle/lang/en_utf8/data.php, these two other data.php files just add more strings. Where should the translation of these files be saved? In case of moodledata/xx_utf8_local/data.php, the translated data.php contains more strings than the original master does. I am sure that core guys who said ''OK let us the `lang` directory be there, there, there and there" knew how to deal with translations. I just do not know, whom to ask. Many thanks to Tim Hunt for clarifying the previous issue at <http://moodle.org/mod/forum/discuss.php?d=75088
As you can see, mod/data/preset/imagegallery/lang/en_utf8/data.php should be renamed to datapreset_imagegallery.php. At the moment, I am working on patch using these extra locations as well. See
Core string files should never be in the module space, any that are should be fixed. I am almost done with the patch. I have got the last issue: let us have a 3rd party module, e.g. stampcoll. It is distributed with module space lang pack for English and Czech. The lang.php should provide Czech administrators to customize their _local translations according to the distributed one.
IMHO there is only one reasonable solution is: for non-core (3rd party) plugins, the translation can go only into _local.
Just commited in CVS. Please test.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
by Tim Hunt - Tuesday, 1 May 2007, 05:19 PM
That is clearly a bug, and it needs to be fixed. The language editor needs to use the places_to_search_for_lang_strings() function from about line 4200 of lib/moodlelib, so it can look for language files in exactly the same place that get_string() and help.php look for them.