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

Django command to debug i18n translations #948

Merged
merged 1 commit into from
Jun 22, 2021
Merged

Django command to debug i18n translations #948

merged 1 commit into from
Jun 22, 2021

Conversation

OmarIthawi
Copy link

@OmarIthawi OmarIthawi commented Jun 14, 2021

This command makes it easier to debug translations without the need to use the GUI. This should remove the most annoying step when debugging i18n issues for missing translations.

I'll update our Runbooks and this is a good thing to be contributed to the Open edX community.

Related: Problem with xblock-utils:ProxyTransNode.merge_translation method

The merge_translation method isn't cleaning up after the merge and leaves stray translations in the following way:

  • ✔️ Calling `i18n.helpers.translate('fr_CA', 'Thank you.') returns the untranslated 'Thank you.'
  • ✔️ Calling `i18n.helpers.xblock_translate('fr_CA', 'Thank you.') returns 'Merci !'
  • ❌ Calling i18n.helpers.translate('fr_CA', 'Thank you.') again returns the the translated 'Merci !' which means that the merge_translation didn't clean up after itself

Workaround: Call translate then xblock_translate in the tahoe_translate command.

Long term fix: Work with upstream to fix the cleanup process around translation.activate(...) as documented in #954

@coveralls
Copy link

coveralls commented Jun 14, 2021

Coverage Status

Coverage increased (+0.03%) to 42.025% when pulling 888a693 on i18n_debug into e7db32d on main.

This command makes it easier to debug translations without the need to
use the GUI.
@OmarIthawi OmarIthawi merged commit 89f58c9 into main Jun 22, 2021
@OmarIthawi OmarIthawi deleted the i18n_debug branch June 22, 2021 15:09
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.

None yet

4 participants