diff options
author | Bryan Newbold <bnewbold@archive.org> | 2022-08-12 12:19:33 -0700 |
---|---|---|
committer | Bryan Newbold <bnewbold@archive.org> | 2022-08-12 12:19:33 -0700 |
commit | cc8a89d9d4a529af3eb87d50ed2ff36051e674f3 (patch) | |
tree | c5204e46997d5ac9e963b6ae5771dbe9f9651269 /fatcat_scholar | |
parent | c9e78dd607bcfdd0bac5741b7e2d5fcf458d7341 (diff) | |
download | fatcat-scholar-cc8a89d9d4a529af3eb87d50ed2ff36051e674f3.tar.gz fatcat-scholar-cc8a89d9d4a529af3eb87d50ed2ff36051e674f3.zip |
start moving I18N language options to config file
Diffstat (limited to 'fatcat_scholar')
-rw-r--r-- | fatcat_scholar/config.py | 19 | ||||
-rw-r--r-- | fatcat_scholar/web.py | 20 |
2 files changed, 19 insertions, 20 deletions
diff --git a/fatcat_scholar/config.py b/fatcat_scholar/config.py index 86870bc..43b03a3 100644 --- a/fatcat_scholar/config.py +++ b/fatcat_scholar/config.py @@ -10,3 +10,22 @@ settings = Dynaconf( GIT_REVISION = ( subprocess.check_output(["git", "describe", "--always"]).strip().decode("utf-8") ) + +I18N_LANG_OPTIONS = [ + "ar", + "de", + "el", + "es", + "en", + "fa", + "fr", + "hr", + "it", + "ko", + "nb", + "nl", + "pt", + "ru", + "zh", +] +assert settings.I18N_LANG_DEFAULT in I18N_LANG_OPTIONS diff --git a/fatcat_scholar/web.py b/fatcat_scholar/web.py index 1e04400..73088d6 100644 --- a/fatcat_scholar/web.py +++ b/fatcat_scholar/web.py @@ -45,26 +45,6 @@ from fatcat_scholar.search import ( logger = logging.getLogger() -I18N_LANG_TRANSLATIONS = [ - "ar", - "de", - "el", - "es", - "fa", - "fr", - "hr", - "it", - "ko", - "nb", - "nl", - "pt", - "ru", - "zh", -] -I18N_LANG_OPTIONS = I18N_LANG_TRANSLATIONS + [ - settings.I18N_LANG_DEFAULT, -] - class LangPrefix: """ |