How to change for once and forever the "Text overrides and translations" in Interactive Video? (Moodle)

Hi everyone! In first, my English is poor, I'm really sorry for that (russian is native). 

I using only Interactive video in H5P. There is a lot of education videos... And I need every time translate for my native language the "Text overrides and translations", when I adding videos. It's really annoying. Unfotunatelly, I'm not the coder or someone like that, and I don't get how I can switch this block to my native lang. I have accsess to FTP of my Moodle and can't find there any h5p's file with "Text overrides and translations".

I'll be grateful for any tips and instructions how to translate this. 

BV52's picture

Hi Lira,

The easiest way to do this is create a "template". If this is an Interactive Video, create one without any interactions and place your translations. Download it locally and upload it everytime you are creating a new activity. This way you do not need to place the translations everytime.

-BV52

Wow, I'll try! Thank you

Hi,
there's a way to save an empty interactive video template (without videoclip) just for edited texts? I publish many interactive videos on the platform and I would like to override everytime the texts (which are not just translations) automatically and permanently. Thank you!

BV52's picture

Hi AleScand,

I'm afraid this is not possible.

-BV

Hi and thank you for your kind feedback.
I'm aware that it is not the best solution, but there is a way to manually edit the main language file to override text? Is this file present locally on my Moodle installation? Thanks

Hi and thank you for your kind feedback.
I'm aware that it is not the best solution, but there is a way to manually edit the main language file to override text? Is this file present locally on my Moodle installation? Thanks

otacke's picture

Hi!

Have you familiarized yourself with the alter_params hook that H5P offers? It can be used to, well alter all parameters that can be set in the editor - so you could basically override the default language settings. Please consult https://h5p.org/node/2692 and choose your host system (Drupal, moodle or WordPress customization).

Best,

Oliver 

Hi Oliver and thank you very much for your suggestion!!!
I'm on Moodle... so could I use "hvp_alter_filtered_parameters" hook in the renderer.php of h5pmod theme?

Would it be possible to have an example of syntax to intercept, for example, the "True" label of the "True / False" question, to better understand how it works?

Thank you very much!

otacke's picture

Hi!

You could. Have you had a look at https://github.com/h5p/h5pmods-moodle-plugin/blob/master/renderers.php#L85-L92 ? You should see how you can check for a particular content type, and then you simply parse the $parameters object that follows the structure of (https://github.com/h5p/h5p-true-false/blob/master/semantics.json) and overwrite what you want to override.

Best,

Oliver 

Hi

I'm having trouble figuring out the syntax for changing "True/False" to "Good/Bad", in semantics.json we have:

"options": [ { "value": "true", "label": "True" }, { "value": "false", "label": "False" }

In the file renderer renderers.php in the theme h5pmod we have:

public function hvp_alter_semantics(&$semantics, $name, $majorVersion, $minorVersion) { if ( $name === 'H5P.MultiChoice' && $majorVersion == 1 ) { array_shift($semantics); } }

Now what is the code for parsing the parameters for Options if the value is "true" or "false"  that I should insert in the public function hvp_alter_semantics?

otacke's picture

Hi ms930!

Hope you'll find someone who has enough time to help you out. I don't this forum is a free code factory. I am sure that someone may support you if you show some effort to solve the problem yourself, but not if you just ask for someone to give you the code to solve your specific problem.

Best,
Oliver

Thanks Otacke for your reply. Anyways, this is not my specific problem. I am not familiar with php and I wanted to have a sample code for local translation of h5p activities. Any code that overrides some semantics. I have no problem altering styles. Cheers

otacke's picture

If you're sure you really need the hooks: I am pretty confident that you'll find examples for altering semantics here on the forum. There's also demo code at https://github.com/h5p/h5pmods-wordpress-plugin/blob/master/h5pmods.php including useful helper functions.

Thank you very much! That's exactly what I was looking for