h5p / h5p-wordpress-plugin

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

Partial display of Brazilian Portuguese translations #102

Open arsaccol opened 5 years ago

arsaccol commented 5 years ago

First of all, I'm not sure whether it's more appropriate to put this issue under this repository, under more "core" H5P repositories, or under repos for individual libraries, because it seems affected by different parts of H5P involving various components thereof. I'm running H5P 1.14.1 on Wordpress 5.2.2.

Upon switching to Brazilian Portuguese in the Wordpress settings (and on my admin account's user settings), not all translations are working as expected, despite there being translation files available.

I have included the appropriate h5p-pt_BR.mo translation file into the plugin's languages directory, as proposed in PR #92, thus making some previously missing translations show up: menus under the Wordpress admin sidebar are now in Portuguese, as are the H5P Hub's menus. Library descriptions, however, are not shown in Portuguese. Screenshots are shown below:

The Hub's library list: image

As I've read here, the H5P Hub's content seems to not be localizable yet, which is not that much of a problem (or is a clearly identifiable one, that is, it's a feature users can clearly expect to not yet work).

Within the H5P Editor that shows up when creating new content, the labels for input fields are translated or not, depending upon the library. In all of them, the "Title" input field seems to be taken directly from the H5P Wordpress Plugin's translation: before adding the h5p-pt_BR.mo file, all "Title" input field labels were displayed in English, even in libraries where all other input fields were in Portuguese. After adding the h5p-pt_BR.mo file, all libraries in the H5P Editor have the "Title" input field showing up in Portuguese, even ones whose other input fields are displayed in English. Screenshots are shown below:

The Drag the Words library has the "Title" input field shown in Portuguese, with other input field labels being, correctly, in Portuguese: image

The Multi-Choice library has the "Title" input field label shown in Portuguese, with other input field labels being in English: image

Also, I take it that those libraries take the translation for these input fields from <language>.json files present in each individual library's language directory; and these files translate relevant parts of the semantics.json file present in the library's root directory. However, upon setting Wordpress' language to, say, Japanese, the editor's input fields for a library such as Multiple Choice (which fails in Portuguese) correctly show Japanese text. image

Comparing both the Portuguese and Japanese files, however, shows what looks like the same structure for both of them: image

I am sort of at a loss here. Seems like there's no easy fix to get consistent translation. If at all possible, could anyone give me a rundown of how translation works in H5P as a whole, were I to try and fix it in its source code? I didn't seem to find much relevant or at least comprehensive documentation regarding this. If I missed something in the docs, I'd be glad to just be pointed towards it!

BV52 commented 5 years ago

Papi Jo has provided an in depth diagnosis of the issue here. Should I create a ticket in our public board or we can handle this from here?