Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68227

H5P editor: integrate translations with Moodle String API

XMLWordPrintable

    • MOODLE_39_STABLE
    • MOODLE_39_STABLE
    • MDL-68227-master
    • Hide

      Setup

      1. Login as admin.
      2. Access to "Site administration / H5P / Manage H5P content types" and upload the chart.h5p attached file as H5P content types.
      3. Check the "Chart" library is displayed in the "Installed H5P content types" tab.
      4. Download the test_editor.php file attached and put it into the root folder.
      5. Access to "Site administration / Language / Language packs" and install "Català (ca)" and "Español - Internacional (es)" language packs.
      6. Go to "Site administration / Language / Language customisation" and customise the following string in the "English (en)" language pack (you will need to "Open language pack for editing" and then search the following string in h5plib_v124.php component):
        • editor:pasteandreplacebutton: Paste & Replace - ENGLISH from h5plib_v124
      7. Go to "Site administration / Language / Language customisation" and customise the following strings in the "Català (ca)" language pack (you will need to "Open language pack for editing" and then search the following strings in h5plib_v124.php component):
        • editor:pasteandreplacebutton: Paste & Replace - CATALAN from h5plib_v124
        • editor:metadata: Metadata - CATALAN from h5plib_v124
      8. Open the file "h5p/h5plib/v124/joubel/editor/language/es.js" and edit the following strings (" - SPANISH from JS" has been added at the end of the original value):
        • metadata: 'Metadata - SPANISH from JS',
        • pasteAndReplaceButton: 'Pegar y Reemplazar - SPANISH from JS',

       

      Testing scenario 1: English

      1. Load https://yoursite/test_editor.php.
      2. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button.
      3. Check the editor is displayed.
      4. Check all the strings are displayed in English.
      5. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Paste & Replace - ENGLISH from h5plib_v124".

      Testing scenario 2: Language from Moodle strings for a language without JS file

      1. Go to the Dashboard.
      2. Select "Català (ca)" as the default language (using the dropdown in the header, next to the Moodle site name).
      3. Load https://yoursite/test_editor.php.
      4. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button.
      5. Check the editor is displayed.
      6. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Paste & Replace - CATALAN from h5plib_v124".
      7. Check the "Metadata" button near "Title" contains the text "Metadata - CATALAN from h5plib_v124".

      Testing scenario 3: Language from JS or Moodle strings for a language with JS file

      1. Go to the Dashboard.
      2. Select "Español - Internacional (es)" as the default language (using the dropdown in the header, next to the Moodle site name).
      3. Load https://yoursite/test_editor.php.
      4. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button.
      5. Check the editor is displayed.
      6. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Pegar y Reemplazar - SPANISH from JS".
      7. Check the "Metadata" button near "Title" contains the text "Metadata - SPANISH from JS".
      8. Go to "Site administration / Language / Language customisation" and customise the following string in the "Español - Internacional (es)" language pack (you will need to "Open language pack for editing" and then search the following strings in h5plib_v124.php component):
        • editor:metadata: Metadata - SPANISH from h5plib_v124
      9. Load https://yoursite/test_editor.php.
      10. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button.
      11. Check the editor is displayed.
      12. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor) still contains the text "Pegar y Reemplazar - SPANISH from JS".
      13. Check the "Metadata" button near "Title" now contains the text "Metadata - SPANISH from h5plib_v124".

       

      Show
      Setup Login as admin. Access to "Site administration / H5P / Manage H5P content types" and upload the chart.h5p attached file as H5P content types. Check the "Chart" library is displayed in the "Installed H5P content types" tab. Download the test_editor.php  file attached and put it into the root folder. Access to "Site administration / Language / Language packs" and install "Català (ca)" and "Español - Internacional (es)" language packs. Go to "Site administration / Language / Language customisation" and customise the following string in the "English (en)" language pack (you will need to "Open language pack for editing" and then search the following string in h5plib_v124.php component): editor:pasteandreplacebutton: Paste & Replace - ENGLISH from h5plib_v124 Go to "Site administration / Language / Language customisation" and customise the following strings in the "Català (ca)" language pack (you will need to "Open language pack for editing" and then search the following strings in h5plib_v124.php component): editor:pasteandreplacebutton: Paste & Replace - CATALAN from h5plib_v124 editor:metadata: Metadata - CATALAN from h5plib_v124 Open the file "h5p/h5plib/v124/joubel/editor/language/es.js" and edit the following strings (" - SPANISH from JS" has been added at the end of the original value): metadata: 'Metadata - SPANISH from JS', pasteAndReplaceButton: 'Pegar y Reemplazar - SPANISH from JS',   Testing scenario 1: English Load https:// yoursite /test_editor.php. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button. Check the editor is displayed. Check all the strings are displayed in English. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Paste & Replace - ENGLISH from h5plib_v124". Testing scenario 2: Language from Moodle strings for a language without JS file Go to the Dashboard. Select "Català (ca)" as the default language (using the dropdown in the header, next to the Moodle site name). Load https:// yoursite /test_editor.php. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button. Check the editor is displayed. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Paste & Replace - CATALAN from h5plib_v124". Check the "Metadata" button near "Title" contains the text "Metadata - CATALAN from h5plib_v124". Testing scenario 3: Language from JS or Moodle strings for a language with JS file Go to the Dashboard. Select "Español - Internacional (es)" as the default language (using the dropdown in the header, next to the Moodle site name). Load https:// yoursite /test_editor.php. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button. Check the editor is displayed. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor), contains the text "Pegar y Reemplazar - SPANISH from JS". Check the "Metadata" button near "Title" contains the text "Metadata - SPANISH from JS". Go to "Site administration / Language / Language customisation" and customise the following string in the "Español - Internacional (es)" language pack (you will need to "Open language pack for editing" and then search the following strings in h5plib_v124.php component): editor:metadata: Metadata - SPANISH from h5plib_v124 Load https:// yoursite /test_editor.php. In the "Select a content to create" dropdown, choose the option "Chart" and click the "Create" button. Check the editor is displayed. Check the "Paste & Replace" button next to "Copy" (at the right top of the editor) still contains the text "Pegar y Reemplazar - SPANISH from JS". Check the "Metadata" button near "Title" now contains the text "Metadata - SPANISH from h5plib_v124".  

      H5P editor has a folder with all supported languages (and their translations) in JS files. It would be good to integrate these translations to Moodle String API, in order to make easier to translate them.
       

        1. chart.h5p
          107 kB
        2. Screenshot_1.png
          Screenshot_1.png
          42 kB
        3. Screenshot_2.png
          Screenshot_2.png
          45 kB
        4. Screenshot_3.png
          Screenshot_3.png
          74 kB
        5. test_editor.php
          5 kB

            sarjona Sara Arjona (@sarjona)
            sarjona Sara Arjona (@sarjona)
            Carlos Escobedo Carlos Escobedo
            Victor Déniz Falcón Victor Déniz Falcón
            Janelle Barcega Janelle Barcega
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 6 hours, 55 minutes
                4d 6h 55m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.