Translating content.json text
We are looking to translate the course content in the h5p courses. I originally thought we would have to follow the process described in the translate libraries page, but all of the content that we actually need translated is contained within the content.json file of the content folder. This JSON file seems to include all of the required activity text and the text included in the editable "Text overrides and translations" fields. The semantics.json files don't seem to include any of the text from the activity questions.
My question is: if we translate this content offline, how can we import the translated h5p files back into the h5p platform? Do we follow the same process of creating a languages folder within the content folder, and adding the translated language files back in with the corresponding language code? Or is there a different process for this file?
Thank you!
hollygil
Thu, 03/20/2025 - 10:33
Permalink
h5p validation failed - content file
Well, we tried adding the language folder with the translated json file to the content folder but no luck. We got this message instead. If anyone has any suggestions on how to import the translated content file that would be appreciated!
Validating h5p package failed.
otacke
Thu, 03/20/2025 - 18:19
Permalink
That's what you get if the
That's what you get if the h5p file was not zipped with the flags -X and -D (plenty of posts on this forum) ...
hollygil
Mon, 03/24/2025 - 22:44
Permalink
Thank you! We have now
Thank you! We have now figured out the folder issue and successfully uploaded the folder to the h5p editor. But none of the translated content displayed in the target language, so we're obviously still not doing something right.
We couldn't seem to find the actual question content strings in any of the semantics.json files, only in the content.json file. But adding the language file for that translated content in a language folder doesn't seem to do the trick either.
otacke
Mon, 03/24/2025 - 23:50
Permalink
You cannot have more than one
You cannot have more than one language in an H5P file, so adding a language folder into the content folder serves no purpose.
You'll have to replace the contents of content.json with what you have put into language/es-mx.json, and additionally you should set the value of the "language" key in h5p.json to "es-mx".