What is the "right" way for plugin developers to get their plugins translated?

What is the "right" way for plugin developers to get their plugins translated?

by Justin Hunt -
Number of replies: 6
Picture of Particularly helpful Moodlers Picture of Plugin developers

I am asked periodically (and quite a lot recently) about providing translations for Poodll into other languages.

What really is the right way to do that? Assuming I dont speak German, Dutch, Arabic etc.
Waiting for volunteers to use AMOS is fine, and I do appreciate the work they do. But we do not get enough coverage that way.

What if I get the files under each plugins lang folder, eg /lang/en/mod_readaloud.php , translated and then submit that to AMOS ? Does that work?

Or do I send willing translators to lang.moodle.org ?

Or is there some better way?

Average of ratings: -
In reply to Justin Hunt

Re: What is the "right" way for plugin developers to get their plugins translated?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you release your plugins in the plugins database, the English language strings are automatically sent to lang.moodle.org so they can be translated. (Of course, if you already have translations, you can submit them to lang.moodle.org yourself.)
Average of ratings: Useful (5)
In reply to Justin Hunt

Re: What is the "right" way for plugin developers to get their plugins translated?

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
If you have the translations as a file, there is a file upload function in AMOS. You can find it under https://lang.moodle.org/local/amos/stage.php - there is a question mark help popup to inform you how the files should look like.
Make sure you contribute them to the right language wink
The language pack maintainer of the language you contribute to, will review the file for consistency and technical errors and modify or approve the file.
Average of ratings: Useful (4)
In reply to koen roggemans

Re: What is the "right" way for plugin developers to get their plugins translated?

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Thanks. There are three workflows I can imagine.
i) A user customizes the lang strings on their Moodle site, and then we retrieve those and submit them to AMOS.
ii) A translator is given a file, translates the file and then we submit those to AMOS.
iii) A user or translator goes to AMOS and does the translations for us.

Users will have a better idea of the context of the text than a translator who just sees a word e.g "enable." So that is preferable. And though some users might be willing to go to AMOS. Editing on their own site gives users the immediate benefit, rather than waiting for it to be reviewed on AMOS, manage the corrections process and update their language pack when its approved.

So I think the first workflow would be best.  However the only way for a user to share their customizations seems to be to manually go into their data directory and do this:
If you customised a language pack xx, the only folder you need to back up is $CFG->dataroot/lang/xx_local. All others without the _local suffix are standard packages that can be installed and uninstalled via the admin tool.
(from https://docs.moodle.org/311/en/Language_customisation#How_to_backup_and_restore_a_customised_language_pack )

Thats not something we can ask regular users to do.

Sorry this has turned into a brain dump, but after thinking about it (and without coding a solution) probably the best workflow is just to get the user to translate the lang strings in the lang file, and send that to me. And then I will upload that to AMOS.

In reply to Justin Hunt

Re: What is the "right" way for plugin developers to get their plugins translated?

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
Hi Justin,

Thank you for thinking aloud about this smile

For option 1: the disadvantage on top of it being a cumbersome process, is that improvements or even changes to outdated, invalid strings that are made later on AMOS, will not trickle down to the users site anymore, because those strings are locally overwritten if the local changes remain there. Not a good idea - only use for local modifications, not for translations.
For option 2: the disadvantage is that the files are php files and the syntax should be correct ( {$a} ; " BOM UTF-8 ...). Also problematic is when English words make their way to the translated language pack by translating half a file and not deleting what isn't done yet - there is no way to find those untranslated strings anymore except looking at all strings one by one. The problems this workflow creates was one of the reasons why AMOS was written. This option still exists for regions on low or really expensive internet connections.
For option 3: the disadvantage is that the one who wants to make the translation, needs an account on https://amos.moodle.org. That's all. Approved translations are available within the hour and installed on every internet connected Moodle site on the planet within 24 hours.

Apart from working with a local file, there is no way to get around the language pack maintainer for obvious reasons.
I don't see any benefits in having people emailing files to you and you uploading them. I think the fastest and safest way to get things done is to let users translate on AMOS. It only requires an account They might see something else they want to translate along the way wink . Translation can be done It also attributes the credits to the one who did the work, rather then the one who uploaded the file.
Average of ratings: Useful (3)
In reply to koen roggemans

Re: What is the "right" way for plugin developers to get their plugins translated?

by Justin Hunt -
Picture of Particularly helpful Moodlers Picture of Plugin developers
Ah, I had not considered that customizations overwrite even language pack updates. That rules out option 1.

OK, as you suggest, perhaps its just best that we direct users and helpers to AMOS.
In reply to Justin Hunt

Re: What is the "right" way for plugin developers to get their plugins translated?

by Séverin Terrier -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators
Going with 1 could be an option, but once done, and approved by translation maintainer, you should delete your customised language file, so that your site use (again) the default translation.

HTH,
Séverin