h5p / h5p-wordpress-plugin

Adds support for H5P Content in WordPress.
https://wordpress.org/plugins/h5p/
70 stars 75 forks source link

Translations update from Translate H5P #161

Closed translate-h5p closed 9 months ago

translate-h5p commented 1 year ago

Translations update from Translate H5P for H5P/wordpress-plugin.

Current translation status:

Weblate translation status

bernhardkaindl commented 1 year ago

@translate-h5p For WordPress plugins there is: https://translate.wordpress.org

For example, can you import translations from there?

Example: https://translate.wordpress.org/locale/de/default/wp-plugins/h5p/

Could you tell me what's the benefit of running a second translation project for a plugin when WordPress will already install its own plugin translations for h5p?

sr258 commented 1 year ago

@bernhardkaindl I didn't know about the way WordPress manages plugin translations. The translate-h5p project focusses on the H5P libraries (which have a lot more strings the the plugin) and adding the WordPress translation was just an afterthought. I mostly added it because the translation files the h5p-wordpress-plugin repository seemed very out of date. If the translations can be managed better and completely on translate.wordpress.org, I don't see the need for having the project on translate-h5p.

bernhardkaindl commented 1 year ago

Hi @sr258! Thanks for your help and nice reply! Sorry that I wasn't aware of this project!

I looked at / investigated how this appears to work and found what I describe below.

The h5p WordPress plugin has this configuration for localisation:

 * Text Domain:       h5p
 * Domain Path:       /languages

Quoting from: https://github.com/h5p/h5p-wordpress-plugin/blob/master/h5p.php#L22C1-L25C4

* Text Domain: h5p * License: MIT * License URI: http://opensource.org/licenses/MIT * Domain Path: /languages

On one hand, this specifies that WordPress shall the plugin's directory /languages to search for translations, but it seems that, at least for the h5p plugin, because translations on https://translate.wordpress.org/projects/wp-plugins/h5p/ are active, at least when languages on https://translate.wordpress.org reach a translation ration of 90%, https://translate.wordpress.org creates a "language pack" for that language and WordPress installs it and also updates it on a regular basis, even independent of an update of the plugin.

The current translation status on https://translate.wordpress.org/projects/wp-plugins/h5p/ is that German (Du/Informal), German (Sie/Formal), Spanish(Costa Rica), Italian, French, Dutch, Persian and Slovak are 100% translated.

One component which should not be forgotten for WordPress plugins is also the readme,txt: It which is shown in the language of the WordPress User and e.g for German at https://de.wordpress.org/plugins/h5p/#description and the translated changelog is e.g. shown at https://de.wordpress.org/plugins/h5p/#developers. So far the readme.txt is only translated to German (Du/Informal), German (Sie/Formal), Spanish(Costa Rica).

bernhardkaindl commented 1 year ago

One difference I see so far is that WordPress Plugins can have many flavours. For example, for German, while the informal default German uses "Du", there is also the formal German variant "Deutsch (Sie)".

For example, I am the "Plugin Translation Editor" of the H5P WordPress Plugin for those two variants of the German translation, and recently, I translated recently reviewed, approved the existing translations and translated remaining strings weren't yet translated at https://translate.wordpress.org/projects/wp-plugins/h5p for these two German translation variants.

Some WordPress Plugins even have translations to Swiss (informal) and Swiss (formal), but that should be rather rare (but e.g. BuddyPress has them). Hopefully, not a topic for the H5P translations. ;-)

bernhardkaindl commented 1 year ago

So, when I finished the two H5P WordPress Plugin German translations, I did not even know that this project exists.

Had I known, I think would have applied to be an Editor (Reviewer/Approver) of the German translation (is translated in the informal "Du" variant) and I could have imported the resulting po file to https://translate.wordpress.org/projects/wp-plugins/h5p/stable/de/default/ using a simple po file upload (after offline review with a graphical diff tool like Meld).

I could still do that, if we'd approve the remaining not approved German translations and then I could do a graphical merge of the two po files, and upload the merge result (where your project has better translations I could add them, if I am able to sort both po files into the same sort order, by merging them) to WordPress.org.

And the same could be done for other languages, and either submitted to the respective Plugin Translation Editors for that language, or we could apply to become global Plugin translation Editors for the H5P plugin and submit (upload) the translations ourselves.

While we could upload the po files without having a global Plugin translation editor, these would then just be "suggested" translations in the "waiting" status, and then a translation editor for that language has to review/approve them again, even if they were already approved by your editors, so having global rights would be good for that.

But AFAIK, only the authors/maintainers of the H5P WordPress plugin can nominate people to get this permission, it would need their blessing.

bernhardkaindl commented 1 year ago

As far as I can see, your initiative has led to many translations for the WordPress Plugin, so we should notify the translation editors of those languages and submit these translations to them.

The best candidates would be those which are in the "light green zone" (between 60% and 90%) on https://translate.wordpress.org/projects/wp-plugins/h5p/ as those could benefit from them to become fully active languages on WordPress.org.

While other plugins might not use https://translate.wordpress.org/, a plugin that is already being translated on wordpress.org, should get their translations uploaded there, if that language has as responsive Plugin translation editor on wordpress.org, I think.

bernhardkaindl commented 1 year ago

The other way around, if Translate H5P can support uploading po files could also be possible.

Or, maybe best would be if one (or both systems) could their new translations to the other system automatically. At least, the translations for the readme.txt are independent of the others, and should be able to be completed even if the plugin strings aren't above 90%.

If my first look is correct, Translate H5P has very active translators, so keeping the WordPress plugin on would be great. Maybe, if an automatic or periodic import from the other is possible. If you have administrative rights on Translate H5P, then some periodic script to submit wordpress.org translations (if they add new or change) using the API might be possible?

In principle, uploads to the defined POST URLs to translate.wordpress.org might also be possible (in order to this to be not one-sided)

bernhardkaindl commented 1 year ago

BTW, something like this (DeepL is quite good and only requires a credit card registration to allow the translator to gen the needed API key) could help Translate H5P too: https://make.wordpress.org/polyglots/2023/03/29/adding-chatgpt-and-deepl-in-the-translation-memory/

sr258 commented 1 year ago

@bernhardkaindl Downloading and upload .po files works within Weblate, if you have editor permission. I have given it to you for German, and you should be able to try it out (Files --> Download translation / Upload Translation). Translators without Borders have used this functionality very extensively and it should work fine.

Probably the easiest way to merge the currently different translations would be to download Weblate's po file, merge them locally with WordPress's version and then upload them on both platforms. I think it would make most sense to then disable new translations on translate-h5p for the WordPress plugin and redirect them to the WordPress platform. Weblate can automatically only sync with Git-based systems and all conflicts have to be resolved manually with a git merge or rebase. This is pretty tedious and I'd prefer to avoid it as much as possible.

translate-h5p already has the Google Translate engine for auto-suggestions. You can use it as an editor under "Automatic suggestions".