-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add i18n_js_namespace to support atlas - FC-0012
- Loading branch information
Showing
4 changed files
with
63 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Utils for the Recommender XBlock""" | ||
|
||
|
||
def _(text): | ||
""" | ||
Make '_' a no-op so we can scrape strings | ||
""" | ||
return text | ||
|
||
|
||
def ngettext_fallback(text_singular, text_plural, number): | ||
""" Dummy `ngettext` replacement to make string extraction tools scrape strings marked for translation """ | ||
if number == 1: | ||
return text_singular | ||
else: | ||
return text_plural | ||
|
||
|
||
class DummyTranslationService: | ||
""" | ||
Dummy drop-in replacement for i18n XBlock service | ||
""" | ||
gettext = _ | ||
ngettext = ngettext_fallback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters