Translation of the H5P editor

Translation of the H5P editor

by Sara Arjona Téllez -
Number of replies: 19

Hi everybody!

As you'll probably know, we're trying to improve the integration between H5P and Moodle. For Moodle 3.8 some features were added, like the H5P player and for 3.9 we're working on the integration of the H5P editor.

There are several technical issues we've found while working on this integration. One of them is related to the H5P editor translation. We would like to share our findings here and heard your opinion.


How do translations work in H5P editor?

When loading the H5P editor form, the strings may come from two different places:

  • H5P editor. General fields, actions and messages, like "Copy", "Title" or "The :property is required and must have a value." are defined into the H5P editor library. This library will be included in Moodle core and will be upgraded only for major versions.
  • Content-type libraries. Each H5P content-type library has its own specific fields, actions and messages. They are defined in the semantics.js file and the translatable information can be found inside JS files in the language folder: https://h5p.org/documentation/for-developers/translate-h5p-libraries . These content-type libraries can be upgraded by administrators using "Manage H5P content types" settings page.


Green boxes in the following screenshot are displaying the "H5P editor" strings (they are shown in Spanish, in order to make easier to see the difference). English strings (so the ones outside the green boxes) are coming from the H5P Chart content-type library.

H5P editor translations


What's our approach?

We've created a couple of issues for supporting localization in the H5P editor:

  • MDL-68227. For now, we're planning to add these strings into core_h5p in order to let users translate them using AMOS. We'll try to find some mechanism to send the new translations from AMOS to the H5P project.
  • MDL-68271. In that case, our idea is to use always the translations coming from the H5P content-type JS language files. So translators should edit these JSON files and push changes to the content-type repository (it's not as easy and straight as AMOS, but with a good explanation, might work). We're also planning to add a tool to let admins upload manual translations (to avoid they have to wait a new content-type library has to be released for using the latest language files).


Thoughts? Ideas? Proposals? We'll love to listen to what you think about this smile

In reply to Sara Arjona Téllez

Odg: Translation of the H5P editor

by Mitja Podreka -
Picture of Language pack maintainers
A while ago I suggested to use Weblate for translating Moodle. The response was favourable.
Weblate would be useful also for H5P translation since it supports JSON files.
In reply to Mitja Podreka

Re: Odg: Translation of the H5P editor

by David Mudrák -
Picture of Language pack maintainers

Yes, and we are working on preparing the migration from the current AMOS Translator UI to Weblate.

The point here is that (as far as I understood it) H5P content type library are software packages maintained by the H5P developer community members and by design, the translations are part of the packages themselves. On contrary to Moodle where translations are by design maintained by the project itself in parallel - so plugin maintainers do not need to worry about translations at all (with all the pros and cons that come with it).

To have an H5P content library translated, the translations must be provided upstream to content type library maintainers, who can include them to the package and release a new version. Then this new version can be used on Moodle sites and all other platforms that use H5P.

This may bring new challenges to Moodle translators who will want to contribute to H5P translations as they will need to learn how the content type library maintainer handles the translation, how to submit the files to them etc.

So yes, the H5P content type library maintainers could decide to use Weblate, e.g. the one hosted on https://hosted.weblate.org/ or their own installation. Also, once we have our own Weblate set up, we might be able to make it so that it is used for H5P too, in a similar way how it will be used for Moodle components.

For the start though, I think we will need to get ready for the need to translate H5P via upstream.

In reply to Sara Arjona Téllez

Er: Translation of the H5P editor

by Iñigo Zendegi Urzelai -

Hi Sara,

You at HQ are doing a great job integrating H5P on Moodle, well done!

I'll tell you our experience: we (at Librezale) have been translating H5P to Basque for the last two years or so (both the mod_hvp plugin and the content-type libraries), and the translation of the content-type libraries via GitHub has been a real pain.

I guess that the ideal scenario is an IT person doing the entire job, but in our team most of the translation has been done by non-IT people collaboratively (there are so many strings to translate), so we have been forced to use a manually-handled-kind-of-AMOS to be able to:

  • Find the strings to translate on GitHub (dive on each repo's folders searching for new/modified strings one by one)
  • Translate them collaboratively (create each JSON file and edit them in a shared folder on NextCloud with Collabora). Take into account that this is non-IT people editing JSON files (!!!), so we even had to create little manuals to tell what has to be edited (and what has not).
  • Once the translation has been done, push the strings back to GitHub (do a pull request on each repo)
  • Once in a while, repeat the process to update the translation

So, that said, if you're planning to find some mechanism to send the new translations from AMOS to the H5P project  of the core_h5p, please I'd ask you to consider adding also the translation of the content-type libraries on AMOS and use that mechanism for them too, because that would help us a lot.

I know that all this is not on the Moodle side but on the H5P side but anyway, as long as a lot of people is using it from Moodle you may help us to make it easier wink

In reply to Iñigo Zendegi Urzelai

Re: Er: Translation of the H5P editor

by David Mudrák -
Picture of Language pack maintainers

Just for the record, this is exactly what Weblate should be able to do - fetch the data from upstream JSON, let translators translate the strings via an AMOS-like UI, generate the required files and submit them via a pull request in the upstream Github repository.

We were considering to use the current AMOS but

  • there would be a non-trivial custom development needed to keep the upstream translations with our own ones in AMOS in sync
  • there is an ongoing project to switch over to Weblate

so it did not sound like a wise approach for now.

We still want to provide a common environment for our translators community for sure.

In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by Sara Arjona Téllez -

Thanks a lot to everybody for giving your opinion and explaining your experience with translations & H5P! 

Some days ago, we also sent a message to the H5P team, to share our plans with the translation and let them know the messages sent to this forum. They said they definitively want to improve their translation system but, unfortunately, they'll probably not have time to set anything up this year sad

BTW, there is a page providing an overview of the H5P content-type translation status here: https://localization.h5p.org/ 

Kind regards

In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by Bohumil Havel -

Hi,

I translate H5P (GITHub) modules and have this experience:

  • https://localization.h5p.org/ does not show all accepted translations, I don't know why
  • it takes a long time to take over  module and update it in a running Moodle
  • I got a link to a German Weblade group, but registration doesn't work

Kind regards

In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by German Valero -
Picture of Language pack maintainers

The instructions for translating H5P plugin components have been updated at https://docs.moodle.org/dev/Translating_plugins#H5P_plugin .


Please feel free to add/remove/change as needed.

In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by Ralf Hilgenstock -
Picture of Language pack maintainers

Hi Sara


great job.

German translation of content types in H5P is done I didn't understand how to add them into Moodle.  Can you explain? Thanks.

Ralf

In reply to Ralf Hilgenstock

Re: Translation of the H5P editor

by Sara Arjona Téllez -

Hi Ralf!

My apologies for the late reply (I was on holidays! :-S).

The .json files included in the H5P content-type libraries are updated by the H5P team every time they release a new content-type library version. So, for instance, if you've been translating to German the "Interactive video" content-type sending them a pull-request to the main repository (https://github.com/h5p/h5p-interactive-video/blob/master/language/de.json), it will be included once the H5P team approve your changes and a new interactive video library version will be released. For now, this is the recommended way to follow in order to install/update H5P content-type translations.

Does this answer your question? Or are you talking about a different translation (as there are several points to translate related to H5P, maybe I've misunderstood you)? 

Kind regards!

In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by Fábio Santos -

Is it possible to translate the titles of the H5P activities both in the editor and in the select of the content bank?

Attachment Captura de Tela 2021-02-04 às 17.11.14.png
Attachment Captura de Tela 2021-02-04 às 17.46.14.png
In reply to Fábio Santos

Re: Translation of the H5P editor

by Sara Arjona Téllez -
Hi Fabio!
Good question! For now, it's not possible (this information is taken from {h5p_libraries} table and it can't be translated for now). If you feel that's something that would be nice to have, I would suggest creating an issue in the Tracker: https://docs.moodle.org/dev/Tracker_introduction
Kind regards! smile
In reply to Sara Arjona Téllez

Re: Translation of the H5P editor

by Nadav Kavalerchik -
Sebastian Rettig setup a non H5P.org official weblate service at https://translate-h5p.tk/weblate/projects/h5p/#languages
I am using it for translating the Hebrew parts of H5P content libraries, and I know other language maintainers use it too.
So better contact him for more information about the proper way of updating the content library JSON files at h5p github repository.
In reply to Nadav Kavalerchik

Re: Translation of the H5P editor

by German Valero -
Picture of Language pack maintainers
@Nadav:
I tried to use webslate (https://translate-h5p.tk/weblate/translate/h5p/h5p-three-image/es_MX/?checksum=1f95619e8ad8ce2d#suggestions ), but I get "Insufficient privileges for saving translations" messages and I cannot save the translated strings for Mexican Spanish.
What am I doing wrong?
In reply to German Valero

Re: Translation of the H5P editor

by Nadav Kavalerchik -
You better write to the website maintainer Sebastian Rettig serettig AT posteo.de , he can help you get proper privileges.
In reply to Nadav Kavalerchik

Re: Translation of the H5P editor

by German Valero -
Picture of Language pack maintainers
Thanks Nadav. I did, and I am now translating H5P there.

But I need help!

How do you deal with an empty string in webslate?

empty string in webslate
In reply to German Valero

Re: Translation of the H5P editor

by German Valero -
Picture of Language pack maintainers
If the English source string is blank, you can simply leave it blank in your translation, too. Weblate might complain about an untranslated string, but you can ignore that!