Using AMOS tool for language pack translation

(Some) Contributed plugins are not automatically imported into AMOS

 
Picture of German Valero
(Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Sunday, 11 November 2012, 12:15 PM
Language pack maintainers

Hi David,

I am sorry to bother you again, but I have contacted the developers for some plugins whose English language strings are not available for translation in AMOS and they do not  seem to find where the problem is.


So far, the census report (https://moodle.org/plugins/view.php?plugin=block_censusreport) AJAX marking (https://moodle.org/plugins/view.php?plugin=block_ajax_marking), user information (https://moodle.org/plugins/view.php?plugin=block_userinfo) and tutorship in the old plugins database (https://moodle.org/mod/data/view.php?d=13&rid=4347) are the plugins with this problem.

I realize the tutorship plugin in the old plugins database is out of reach for AMOS, but the other three modules would benefit from having translations available in languages other than English.

Is there any other page with instructions for plugin developers which deals with the proper way to use English and foreign language strings besides http://lang.moodle.org/mod/forum/discuss.php?d=2485 , which I could direct them to ?

I would really appreciate your help.

Thanks in advance.

Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Monday, 12 November 2012, 4:14 PM
Language pack maintainers
Hi German

I looked at the plugins code and this is what caught my eyes:

* https://github.com/mattgibson/moodle-block_ajax_marking/blob/MOODLE_23_STABLE/lang/en/block_ajax_marking.php#L53 - invalid concatenation of strings using the dot operator
* https://github.com/remotelearner/moodle-block_censusreport/blob/MOODLE_23_STABLE/lang/en/block_censusreport.php#L54 - invalid concatenation of strings using the dot operator

With regards to the User information block, its string file is valid. I'm not quite sure why it has not been sent into AMOS. I have a suspicion that the block has set 1.9 as the Moodle version it is intended for, together with 2.x versions. That might be the reason why that version has not been pushed into AMOS (because it does not accept any 1.x versions).

And correct, plugins in the old Plugins directory are not being registered with AMOS. Maintainers have to publish them in the new Plugins directory.

I will appreciate if you pass this information to the maintainers of the first two blocks and ask them to release a fix version of their plugin. Thanks for your help!
Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Tuesday, 13 November 2012, 1:18 AM
Language pack maintainers

Thanks David,

I will contact the plugin maintainers and pass them the information you discovered.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Thursday, 22 November 2012, 12:04 AM
Language pack maintainers

Hi David,

I found some weird situation with the multinumerical question type plugin (https://moodle.org/plugins/pluginversions.php?plugin=qtype_multinumerical). I contacted the author but we could not find the cause of the problem.

The author (Nicolas Dunand) has included the English strings correctly in the En folder (he also included a french translation folder).

The plugin is marked as available for Moodle 2.3, 2.2, 2.1 and (in other version files for 2.0 and 1.9), but AMOS only shows the 2.0 branch as available for translation, and that branch has a funny looking string in french language within [multinumerical_help,qtype_multinumerical].

It seems Moodle is pushing only the wrong (old) 1.9 or 2.0 version of the string into AMOS.

Could you please check into it and suggest a solution.

Thanks in advance for your help.

Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Thursday, 22 November 2012, 6:20 PM
Language pack maintainers

Hi German

This strings syntax is not supported by AMOS: https://github.com/ndunand/moodle-qtype_multinumerical/blob/master/lang/en/qtype_multinumerical.php#L50

String definition must use the simple form of

$string['stringid'] = 'String value';

The heredoc syntax or concatenation operators are not supported by the AMOS parser.

The maintainer of the plugin has to fix this issue and release a new version of the plugin at moodle.org/Plugins directory.

Picture of Joseph Rézeau
Re: (Some) Contributed plugins are not automatically imported into AMOS
by Joseph Rézeau - Thursday, 22 November 2012, 7:03 PM
 

Hi David (and German).

Since Moodle 2, Help files have been removed from the plugins /lang/language/help folders. Contributors are invited to use the $string['somestring_help'] strings instead. I expect what has happened in the qtype_multinumerical lang file is that the contributor has copied-pasted the contents of his former help file into that string, hence the various problems.

The real problem is that the contents of a $string['somestring_help'] string must be SHORT and formatting is limited to a strict minimum. Contributors are invited to place more detailed help (including e.g. images) into the Documentation wiki. Since this question type seems to need more detailed documentation than can be contained inside a help string, the author (Nicolas Dunand) should be encouraged to create a specific page in the Moodle Documentation Wiki. I have written to him in this regard.

Joseph

Picture of Nicolas Dunand
Re: (Some) Contributed plugins are not automatically imported into AMOS
by Nicolas Dunand - Thursday, 22 November 2012, 7:40 PM
 

Hi all,

German and Joseph, thanks for bringing this to my attention. Thanks David for pointing out what the problem was.

I therefore have updated my plugin and submitted the new version to the official plugins database. It seems that AMOS has imported all lang strings correctly.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Friday, 23 November 2012, 12:59 AM
Language pack maintainers

Thanks David,smile

Thanks Joseph,smile

Thanks Nicolas,smile

I was able to translate into Spanish all the English strings for all Moodle 2.x branches for the multinumerical question type plugin.

One minor bug remains: The 2.0 branch still has the English help string [multinumerical_help,qtype_multinumerical] (How this works) in French. All other branches have this string in English. surprise

Thank you all and greetings from México.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Monday, 26 November 2012, 3:46 AM
Language pack maintainers

Hi David,

I can not find in AMOS the English language strings for translating the green theme plugin (https://moodle.org/plugins/view.php?plugin=theme_green). I looked into the plugin /lang/en folder and the strings seem to be there, but when I tried to make a local translation, I had the following DATABASE WRITING ERRORS:

  • line 427 of \lib\dml\moodle_database.php: dml_write_exception thrown
  • line 1107 of \lib\dml\mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1149 of \lib\dml\mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->insert_record_raw()
  • line 190 of \admin\tool\customlang\locallib.php: call to mysqli_native_moodle_database->insert_record()
  • line 60 of \admin\tool\customlang\index.php: call to tool_customlang_utils::checkout()

When I removed the green theme plugin, the error disappeared.

There is obviously something very wrong with the code  for this plugin. Can you please help me point the author in the right direction, so that he will correct it?

Thanks in advance.

Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Wednesday, 12 December 2012, 7:00 PM
Language pack maintainers
The one malicious thing might be the string['choosereadme'] in the English pack. Can you try to replace it with an empty string and see how it goes then? Please do not forget to purge local caches after you modify the string file and only then try to checkout strings.
Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Monday, 26 November 2012, 4:46 AM
Language pack maintainers

Hi David,

theme_aaradyha (https://moodle.org/plugins/pluginversion.php?id=917) misses the following English language strings which should be available for translation in AMOS and also for local language modification:

 Custom header theme_aaradyha | masthead  and its associated default value string
 Custom CSS theme_aaradyha | customcss and its associated default value string
 Custom footer theme_aaradyha | footnote and its associated default value string
 
Oddly, the string  (spanish translation = Ítems del menú personalizado)  theme_aaradyha | custommenuitems appears as already translated in spite of not being available for local or AMOS translation ???

I am really perplexed surprise.

I creted issue CONTRIB-4040 at tracker.


UPDATE: It seems the error happened because I have a local 2.4dev branch where I was checking the English strings and making local language modifications before uploading the PHP file to AMOS.

AMOS does show the mentioned strings correctly.

My mistake. I apologize sad

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Saturday, 1 December 2012, 1:11 AM
Language pack maintainers

Hi David,

I tried to translate the plugin Certificates Wall (https://moodle.org/plugins/view.php?plugin=mod_certificateswall) but the English strings are not available in AMOS even though they are within the plugin lang/en folder available for local language edition.

Would you be so kind as to check what the problem is with this module so that I can ask the author to correct it ?

And, I wonder if it would not be a good idea (or too much work) to document the problems and solutions seen with all the plugins discussed in this thread in the documentation of instructions for programmers wishing to contribute plugins for Moodle thoughtful.

Thanks in advance.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Sunday, 2 December 2012, 8:38 AM
Language pack maintainers

Hi David,

I translated the language strings for the DataPlus plugin (https://moodle.org/plugins/pluginversions.php?plugin=mod_dataplus) for Moodle branches 2.0 and 2.1 but the strings for the 2.3 branch are not available in AMOS, even though the plugin itself has a specific version file available for the 2.3 branch in the Moodle plugins database, and it does contain the English language strings within the lang/en folder of the zip file.

Could you please look into it so that we can tell the author how to fix it ?

Thanks in advance.

Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Wednesday, 12 December 2012, 7:14 PM
Language pack maintainers
DataPlus for 2.3 uses heredoc syntax for string definition (e.g. templates_hookstext). That is not supported.
Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Wednesday, 12 December 2012, 7:11 PM
Language pack maintainers
The plugin has classic mistake with concatenating strings in the English language pack.
Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Friday, 7 December 2012, 2:08 AM
Language pack maintainers

Hi David,

The Vmoodle block (https://moodle.org/plugins/view.php?plugin=local_externalzip) does not have the English strings available for translation in AMOS, even though the English strings do seem to be in the right /lang/en folder within the plugin files. The author even has a /lang/fr translation.

Could you please find out what is wrong with this plugin so that the author can be told and fix it ?

Thanks in advance.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Friday, 14 December 2012, 12:16 AM
Language pack maintainers

Hi David,

The module Certificates Wall (https://moodle.org/plugins/view.php?plugin=mod_certificateswall) does not have the English language strings available in AMOS, even though they do appear within the /lang/en folder of the module ZIP file, and are available for local language customization if installed.

This module has had quite a few downloads (total=1341), so I think many sites might like to have trnslations for it.

Would you please check what is wrong with it, so that the mainatiner can be made aware and fix it?

Thanks in advance for your help.

Picture of David Mudrák
Re: (Some) Contributed plugins are not automatically imported into AMOS
by David Mudrák - Monday, 17 December 2012, 7:33 PM
Language pack maintainers

I have already commented about this plugin earlier in this thread. See my reply to your original post.

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Tuesday, 1 January 2013, 12:17 AM
Language pack maintainers

Hi David,

I am sorry to bother you again, but the navigation buttons plugin (https://moodle.org/plugins/view.php?plugin=block_navbuttons) does not have the English language strings available for translation in AMOS, and it seems to be very useful plugin.

I would really appreciatte your help in diagnosing the cause for the problem, so that the author (Davo Smith) can fix it.

Thanks in advance and Happy New Year smile

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Wednesday, 2 January 2013, 12:31 AM
Language pack maintainers

Hi David,

Davo Smith just opened a tracker issue https://tracker.moodle.org/browse/MDLSITE-2072 about the navigation buttons plugin not having the English language strings available in AMOS, because he can not find out the cause of the problem. Your expertise will be greatly appreciatted for solving this problem

Happy New Year smile

Picture of German Valero
Re: (Some) Contributed plugins are not automatically imported into AMOS
by German Valero - Thursday, 14 February 2013, 12:09 AM
Language pack maintainers

Hi David,

The booking add-on is listed in the plugins database as released for 2.0 to 2.4 branches, (https://moodle.org/plugins/view.php?plugin=mod_booking) but AMOS only has 2.0 to 2.3 strings,  and the 2.4 strings are not available for translation sad .

Would you be so kind as to have a loook at it and show us what needs to be done by the plugin author?

Thanks in advance.