I would file this as new bug.

I would file this as new bug.

by Daniele Cordella -
Number of replies: 8
Picture of Core developers Picture of Plugin developers
I would file this as new bug. But I am not sure.
Please share with me your opinion.

I am working to a new module. Let me call it newmod.
I do use lang files coming from
newmod/lang/en_utf8/newmod.php
and
newmod/lang/it_utf8/newmod.php
I also have a very old copy of the lang file in moodledata/lang/it_utf8/newmod.php

Yesterday I went to Site Administration block->Language->Language editing
in the unique TAB="Local string customization"
with the drop down menu pointing to: "Italiano (it)"

I selected the link "Edit words or phrases" and I got a new drop down menu with the list of all lang files from moodledata/lang/it_utf8/.

By the end of the list, the drop down menu presents the item "----------" followed by the list of lang files I still have in the lang folder of my modules.

Just to be sure you understand me:
by the end of the list of items of the drop down menu I have

...
workshop.php
xmldb.php
----------
newmod.php (mod/newmod)
feedback.php (mod/feedback)
questionnaire.php (mod/questionnaire)

Well... in the first part of the list (the one finishing with .../workshop.php/xmldb.php) it is not present my newmod.php even if it is the source of stings I see into my newmod. The only lang file I am allowed to modify is the one in (mod/newmod/lang/it_utf8)... but its editing is useless because the lang file used by Moodle is the one in moodledata/lang/it_utf8/

It seems as if the presence of the file mod/newmod/lang/it_utf8 forces the deletetion of the corresponding lang file (moodledata/lang/it_utf8/newmod.php) from the list in the drop down menu.

Did you ever had evidence of this problem?
TIA
Average of ratings: -
In reply to Daniele Cordella

Re: I would file this as new bug.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Hi Daniele,

if I understand you correctly, this is not a bug.

As your module is not distributed as a part of standard Moodle installation, there should be no moodledata/lang/it_utf8/newmod.php. Language files of the standard modules only may be stored there. All 3rd party modules may have their language files either in the mod/newmod/xx_utf8/newmod.php or in moodledata/lang/xx_utf8_local/newmod.php only. These 3rd party modules are displayed under the horizontal rule in the file selection box (newmod, feedback and questionnaire in your example above).

As you write your code, put new strings into newmod/lang/en_utf8/newmod.php.
Then you can use Moodle language interface to translate your module into Italian. The translation of your 3rd party module will be saved by Moodle into moodledata/lang/it_utf8_local/newmod.php. As a module maintainer, you can copy the translated file from it_ut8_local into the newmod/lang/it_utf8/newmod.php and commit into CVS contrib.

HTH
Average of ratings: Useful (2)
In reply to David Mudrák

Re: I would file this as new bug.

by Joseph Rézeau -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
David > As your module is not distributed as a part of standard Moodle installation, there should be no moodledata/lang/it_utf8/newmod.php. Language files of the standard modules only may be stored there.

Exactly, that's why I recently asked the language chief maintainer to remove the questionnaire.php lang files from all the language packages where they had wrongly been placed ages ago. See this thread.

Joseph

Average of ratings: Useful (1)
In reply to David Mudrák

Re: I would file this as new bug.

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Thank you David and thank you Joseph for the lang file production protocol you made me available.

Before starting my answer: I am supposing you David made a type mismath in writing:
> As a module maintainer, you can copy the translated file from it_ut8_local into the newmod/lang/it_utf8/newmod.php and commit into CVS contrib.
that was supposed to be
> As a module maintainer, you can copy the translated file from it_ut8_local into the moodledata/lang/it_utf8/newmod.php and commit into CVS contrib.

---------

Are you saying that I am never allowed to edit the file moodledata/lang/it_utf8/newmod.php with the moodle interface?
Are you saying that I am allowed to edit only the file
moodledata/lang/it_utf8_local/newmod.php with the moodle interface?
Are you saying that the sync between moodledata/lang/it_utf8_local/newmod.php and moodledata/lang/it_utf8/newmod.php has always to be done only manually?
ok, I believe that this is a good moodle behaviour.

So... once the file moodledata/lang/it_utf8/newmod.php is created I am supposed to delete the file mod/newmod/lang/it_utf8/newmod.php, I suppose, because of two reasons:
1) it is useless, modifications will never be reflected in the use of the module in moodle
2) if the file moodledata/lang/it_utf8/newmod.php exists, this means that the module is no longer under development.

This explain why if the file mod/newmod/lang/it_utf8/newmod.php is present I can't see, in the list of the drop down menu, the file moodledata/lang/it_utf8/newmod.php
This clear all doubts and closes the issue.

Maybe I understood.

Please reply me I am still wrong.

Thank you both.
Ciao.
In reply to Daniele Cordella

Re: I would file this as new bug.

by koen roggemans -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Translators
I think you still missed something Daniele.

David didn't make a typo: The translator only maintains the language pack and that pack only contains files for standard moodle components. All other translatded files are send to the developer (contributed modules, blocks, filters, ...), who puts the files in the /mod/modname/lang folder.
That way, when installing non-standard modules, the translation works immediately, without having to move language files around. That improves the usability for the end user, but comes with a few drawbacks: not all language files are in moodledata/lang, files in the www-folder can't be changed with the moodle editor (due to write rights if Moodle is correctly installed wink ), so can't be maintained where they are.

Due to the order of which language files are searched through Moodle, there should not be non-standard language files in the language packs. I know a lot of language packs do not comply, but it is quite a job to get/keep them out of 75 packs. If you notice one, please contact the language pack maintainer or, in case not reachable, contact me.
Average of ratings: Useful (2)
In reply to Daniele Cordella

Re: I would file this as new bug.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
that was supposed to be
> As a module maintainer, you can copy the translated file from it_ut8_local into the moodledata/lang/it_utf8/newmod.php and commit into CVS contrib.

No, I did not make a typo. As was said, you never put anything into moodledata/lang/it_utf8/ until your module would be moved into the core space. All your lang files newmod.php must be in the module space, i.e. mod/newmod/lang/xx_utf8/newmod.php.
As Koen explained above, the language translation system should not be able to create or modify files in the module space directly. So the only place that remains is moodledata/lang/xx_utf8_local/ and that is the directory where Moodle translation interface saves translation of any 3rd party module found.

Are you saying that I am never allowed to edit the file moodledata/lang/it_utf8/newmod.php with the moodle interface?

I am saying that this file should not be there. Moodle lang interface does not create it there.

Are you saying that I am allowed to edit only the file moodledata/lang/it_utf8_local/newmod.php with the moodle interface?

Yes, I - see above for the reasons.

Are you saying that the sync between moodledata/lang/it_utf8_local/newmod.php and moodledata/lang/it_utf8/newmod.php has always to be done only manually?
Well, if the question is read:
Are you saying that the sync between moodledata/lang/it_utf8_local/newmod.php and mod/newmod/lang/it_utf8/newmod.php has always to be done only manually?

then yes, I am. If the translation interface wasn't there in Moodle, you would only work with lang files in mod/newmod/lang/*/newmod.php. Because admin/lang.php is intentionally prevented from modifying these files directly, you have to sync manually.

This mechanism opens some nice possibilities as well. E.g., if somebody sends me some fixed or new lang files, I simply put them into the moodledata/lang/xx_utf8_local. Then I can see differences between "official" (i.e. CVS) and contributed translation.
Also, please use the most current version of admin/lang.php (either from HEAD or MOODLE_19_STABLE) as there are issues and improvements being solved quite regularly.
Average of ratings: Useful (1)
In reply to David Mudrák

Re: I would file this as new bug.

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
I read your comments tenth of times before replying.
I believe I understood.
Thank you both.
Ciao.
In reply to Daniele Cordella

Re: I would file this as new bug.

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
> I read your comments tenth of times

Great! Then you are the best adept to elaborate it all into a wiki docs page tongueout. At least, we should put a link from docs:Translation into this thread. Although, I'm not sure if this is Translation or Development related issue thoughtful
In reply to David Mudrák

Re: I would file this as new bug.

by Daniele Cordella -
Picture of Core developers Picture of Plugin developers
Yes David.
I do accept this but... please give me enough time.
I already am in business for contrib-52. I started to rwite something and I don't know how carry on.
I can write this too, and I will be proud to do this, but for sure not now.