traslate title of library h5p

Hi.I want to translate libraries to persian language.and I do not know how to translate title of library.

I changed title of library in library.json but  the title of library did not translate in selected list of "create h5p question".

Could you please guide me how to translate title of library

Thanks.

 

thomasmars's picture

Check out the H5P contributing guide, under Translating Content Types: https://h5p.org/contributing

Thanks for your guide.

Please guide me Where is address of widgets folder?(How do I access the widget file  in H5P)

fnoks's picture

Sorry, I am not able to understand your question. What do you mean when saying H5P widget file? What are you trying to accomplish?

I din't notice to how translate widget.I attached a photo to this comment To better explain what I mean.in each library i translated title of library but title do not translated.please guide me.

Attachments: 
thomasmars's picture

Judging from the image it looks like you are trying to translate the h5p-editor-image-hotspot-question library, which is an editor widget. That means it has a bit of a different approach to translating than a runnable library. You can check out the guide for translating editor widgets.

The basics are that you will find the translatable string in the JavaScript file, and then add a file with your language code to the language folder with the key of the translatable string from the JavaScript file. An example for norwegian translation can be found in nb.json. When you have added the new translation for your language to the editor widget you should create a pull request to the github repository.

thomasmars's picture

In order to test that you got the translations right, you can use the H5P CLI to pack the translated library and upload it to your test environment/server.

Hi.

Thanks for your guide.I added:

// Default english translations

H5PEditor.language['H5PEditor.ImageHotspotQuestion'] = {

  libraryStrings: {

    noImage: 'You have not selected an image.',

    done: 'Done',

    remove: 'Remove hotspot',

    rectangle: 'Create rectangle',

    circle: 'Create circle',

    guiDescription: 'Drag and drop the desired figure from the toolbar to create a new hotspot.'

  }

};

in  file "image-hotspot-question.js "

and I added a file with my language code(fa.json) to the translate folder language folder، But still have not been translated widgets.

and To translate as title of libraries What should I do?

Attachments: 
thomasmars's picture

You can not translate the title of an H5P library as far as I know.

Do you know, Thomas, whether a issue has been opened for that request? Just to let people subscribe to it and be informed as soon as it is about to get implemented to come and help translating.
Thanks very much.

tim's picture

An issue has not been opened up. I'll make sure it is announced through a blog post when the content type titles and their metadata are able to be translated.