Skip to content

Commit

Permalink
feat!: remove Transifex calls for FC-0012 - OEP-58
Browse files Browse the repository at this point in the history
  • Loading branch information
shadinaif committed Feb 28, 2024
1 parent ebd3aa6 commit bd3e348
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
8 changes: 0 additions & 8 deletions .tx/config

This file was deleted.

19 changes: 0 additions & 19 deletions recommender/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,31 +952,12 @@ def _construct_view_resource(self, resource):

return result

@staticmethod
def _get_deprecated_i18n_js_url(): # pragma: no cover
"""
Returns the deprecated 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

def _get_statici18n_js_url(self):
"""Return the JavaScript translation file provided by the XBlockI18NService."""
if url_getter_func := getattr(self.i18n_service, 'get_javascript_i18n_catalog_url', None):
if javascript_url := url_getter_func(self):
return javascript_url

if deprecated_url := self._get_deprecated_i18n_js_url():
return self.resource_string(deprecated_url)

return None

@property
Expand Down

0 comments on commit bd3e348

Please sign in to comment.