Suggestions to improve the translation process

papi Jo's picture

I am continuing in this forum a thread I started in the Translate libraries Developer Guide because I need to attach some sample files, which is not possible there.

In order to facilitate the translators' task for the semantics.json files, and after spending the whole day studying and testing things out, here are my suggestions.

1. For developers

1.1. When creating a new H5P activity, in your semantics.json file include "English" tags for all fields that can be translated. Example: see attached modified Accordion semantics.json file.

1.2. For H5P maintainers: in the h5p-cli library in the h5p.js file function removeUntranslatables(field, name) change line 797 to:

else if (name === undefined || (name !== 'label' && name !== 'englishLabel' && name !== 'description' && name !== 'englishDescription' && name !== 'entity' && name !== 'englishEntity' && name !== 'default' && name !== 'englishDefault')) {

1.3. Using the h5p-cli command: h5p create-language-file LIBRARY_NAME en to produce an English language file en.json which will be written to the LIBRARY/language directory. See attached Accordion en.json file produced that way.

2.- For translators

2.1. in the LIBRARY/language directory copy the en.json file to your language code, e.g. fr.json.

2.2 Open that file in a text editor and translate the strings to your language. See attached Accordion fr.json file.

Looking forward to H5P team (and translators) reactions.

tim's picture

You've understood the process very well and have come up with some excellent suggestions :) 

I agree that the main problem is that the 'memory' of the english translation is lost and it makes it extremely tricky to work with future translations. 

The only disadvantage I see with adding an "English tag" to the semantics.json is that it might cause it to bloat up unnecessarily.

The best short term solution I could come up with was to create a script to check a language file for completeness. It works by creating a en.json of just the translatable strings and makes sure that the new language file has all the required strings:

https://github.com/h5p/h5p-cli/pull/11

I think this solution is cleaner as it generates the en.json in memory and just deletes it after the check. This will hopefully solve a lot of back and forth on github.

A longer term solution that the Core Team hope to put in place is to integrate H5P with Transifex:

https://www.transifex.com/

It will allow translations to be crowdsourced from the community and it has an extremely friendly UI.

If you wish to experiment with either the language checker or transifex just let me know. I'm handling a bit of the translation work in the core team and I will be more than happy to join in!

Hi Tim,

I'm using H5P on wordpress (I love H5P!).
I'm looking into translating the terms for the person watching the video. You know, things like: 'correct!' 'Wrong!' 'Your score is...'. I know I can translate manually everytime I create a new content, but I was looking into having it translated in the core so I don't need to manually translate everytime. How I can do this?

Thank you!
Fernando

tim's picture

Hello Fernando, 

if you're interested in translating for Wordpress, I would recommend poedit:

https://poedit.net/

Poedit should create a new file with your translations. You can either submit the file to this thread directly and I can handle the integration. If you are feeling a bit adventurous, you could read up on how to make a pull request to the codebase:

https://h5p.org/contributing

Let me know how it goes!

- Tim

papi Jo's picture

A longer term solution that the Core Team hope to put in place is to integrate H5P with Transifex: https://www.transifex.com/

As far as I can see, Transifex is not free. Is that not a problem?

tim's picture

Transifex is fortunately free for open source projects :)

papi Jo's picture

Great!

boton's picture

I would love to have a translation to use Portuguese Language (Brazilian and European).
Translation in itself it is easy, but the technicalities here presented are beyond my knowledge completely.
It would help to have a translate activity to generate a language pack, and the new laguage pack could be read by H5P.
Any man, like me, and his pet could do the job, and many new languages could be part of H5P .
or maybe I'm dreaming... Is this possible?

Beto

tim's picture

Hi Beto, we are slowly testing out a translation service called 'crowdin'. It gives users a simple interface for translating H5Ps.

Try searching for 'h5p' on this page:

https://crowdin.com/projects#advanced-search

There are around 5 content types ready for translation and you should be able to find Brazillian Portuguese as an option. I'll be adding more in the future.

Let me know how it goes!

- Tim 

danieltebs's picture

I want to help to translate the strings for h5p content types to german.

Shall i send you my json-files or shall i use crowdin.com?

otacke's picture

If nothing slipped my eye, there should be pull requests on github for all content types already. But you're welcome to improve the translations, of course! Some things are a bit tricky.

tim's picture

Hi Daniel, there isn't a way to translate the strings for the content types yet. I'll make sure to post back here once that functionality is added.

boton's picture

Hello Tim

This is just perfect (or nearly...)
We made an attempt to suggest a few translations for the Course Presentation activity. 
Hopefully they will help.

I will try to return to crowdin and check if I can do a few more soon

Kind Regards

Beto & Eliani Boton

 

falcon's picture

Great Beto & Eliani Boton!

Hi I want to use "Loco translate" WP plugin to translate H5P.
Could you please provide the ".po" file?
Thanx

otacke's picture

Hi ferdo!

You can always have a look at the latest versions of the translation files on github. You should also find them (maybe not the latest ones) locally at YOURSITE_WITH_WORDPRESS/wp-content/plugins/h5p/languages

Best,

Oliver