From cc8a89d9d4a529af3eb87d50ed2ff36051e674f3 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 12 Aug 2022 12:19:33 -0700 Subject: start moving I18N language options to config file --- fatcat_scholar/config.py | 19 +++++++++++++++++++ fatcat_scholar/web.py | 20 -------------------- 2 files changed, 19 insertions(+), 20 deletions(-) (limited to 'fatcat_scholar') 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: """ -- cgit v1.2.3