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.
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