Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add translations of es_419 and es_ES #22

Merged
merged 3 commits into from
Sep 8, 2023

Conversation

BryanttV
Copy link
Contributor

@BryanttV BryanttV commented Aug 17, 2023

Description

This PR adds translations of es_419 and es_ES to the H5P XBlock.

How To Test

  1. Install this branch in your environment.
  2. Change the platform language in (Account → Site Preferences → Site Language). Set it to "Spanish (Latin America)"
  3. Add a H5P block in a unit from Studio.
  4. You should see the block in the selected language.

Using translations commands

A Makefile was created that includes the necessary commands (based on the edX cookie-cutter) to extract and compile the translations.

  1. Run make extract_translations, this will update the strings to be translated in h5pxblock/locale/en/LC_MESSAGES/text.po
  2. Create a folder for your translations (If it does not exist) in h5pxblock/locale/, ie: h5pxblock/locale/es_419/LC_MESSAGES/, and create your text.po file, based on the file generated above.
  3. Add all translations for strings according to language.
  4. Run make compile_translations, this will generate the text.mo file in all created language folders.

Screenshots

  1. In the LMS
    image
  2. In Studio
    image
    image
    image
    image

@BryanttV BryanttV marked this pull request as ready for review August 17, 2023 18:53
template_str = self.resource_string(template_path)
template = Template(template_str)
return template.render(Context(context))
return loader.render_django_template(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add docstrings here? thanks!

@BryanttV BryanttV changed the title docs: add translations of es_419 and es_ES feat: add translations of es_419 and es_ES Aug 18, 2023
Copy link
Contributor

@mariajgrimaldi mariajgrimaldi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deployed in one of our instances and it's working fine! Thanks

@ziafazal
Copy link
Contributor

@BryanttV thanks for creating this PR. However, it appears E2E tests are failing on it.

@mariajgrimaldi
Copy link
Contributor

@ziafazal: I added xblock-utils that seem missing in the testing environment. Can we rerun the tests?

Copy link
Contributor

@ziafazal ziafazal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ziafazal ziafazal merged commit 9d47419 into edly-io:master Sep 8, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants