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: support JavaScript translations from edx-platform | FC-0012 #78

Closed
OmarIthawi opened this issue Feb 1, 2024 · 3 comments
Closed

Comments

@OmarIthawi
Copy link
Member

@shadinaif please convert the lines below into the modern code base:

def _get_statici18n_js_url(): # pragma: no cover
"""
Returns the Javascript translation file for the currently selected language, if any found by `pkg_resources`
"""
lang_code = translation.get_language()
if not lang_code:
return None
text_js = 'public/js/translations/{lang_code}/text.js'
country_code = lang_code.split('-')[0]
for code in (translation.to_locale(lang_code), lang_code, country_code):
if pkg_resources.resource_exists(resource_loader.module_name, text_js.format(lang_code=code)):
return text_js.format(lang_code=code)
return None
(similar to openedx/xblock-drag-and-drop-v2#365)

Also completely remove the pkg_resource translations in the deprecated PR: #77 (similar to openedx/xblock-drag-and-drop-v2#352 )

@navinkarkera
Copy link
Contributor

@OmarIthawi @shadinaif Is this already resolved by #77 ?

@navinkarkera
Copy link
Contributor

@OmarIthawi Gentle reminder.

@OmarIthawi
Copy link
Member Author

Yes @navinkarkera. Sorry for the delayed response.

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

No branches or pull requests

2 participants