From 0401c5336b34b1731736045da4877fef11889274 Mon Sep 17 00:00:00 2001 From: Grace Hawkins Date: Mon, 20 Dec 2021 22:45:29 +0330 Subject: [PATCH] Complete language codes list (#1197) --- cmscontrib/loaders/polygon.py | 65 +++++++++++++++++++++++++++++++++-- 1 file changed, 63 insertions(+), 2 deletions(-) diff --git a/cmscontrib/loaders/polygon.py b/cmscontrib/loaders/polygon.py index 07808ee2ac..6107b6b3e9 100644 --- a/cmscontrib/loaders/polygon.py +++ b/cmscontrib/loaders/polygon.py @@ -5,6 +5,7 @@ # Copyright © 2014-2017 Stefano Maggiolo # Copyright © 2018 Edoardo Morassutto # Copyright © 2018 Luca Wehrstedt +# Copyright © 2021 Grace Hawkins # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -40,8 +41,68 @@ def make_timedelta(t): return timedelta(seconds=t) -# TODO: add all languages. -LANGUAGE_MAP = {'english': 'en', 'russian': 'ru', 'italian': 'it'} +LANGUAGE_MAP = { + 'afrikaans': 'af', + 'arabic': 'ar', + 'armenian': 'hy', + 'azerbaijani': 'az', + 'belarusian': 'be', + 'bengali': 'bn', + 'bosnian': 'bs', + 'bulgarian': 'bg', + 'catalan': 'ca', + 'chinese': 'zh', + 'croatian': 'hr', + 'czech': 'cs', + 'danish': 'da', + 'dutch': 'nl', + 'english': 'en', + 'estonian': 'et', + 'filipino': 'fil', + 'finnish': 'fi', + 'french': 'fr', + 'georgian': 'ka', + 'german': 'de', + 'greek': 'el', + 'hebrew': 'he', + 'hindi': 'hi', + 'hungarian': 'hu', + 'icelandic': 'is', + 'indonesian': 'id', + 'irish': 'ga', + 'italian': 'it', + 'japanese': 'ja', + 'kazakh': 'kk', + 'korean': 'ko', + 'kyrgyz': 'ky', + 'latvian': 'lv', + 'lithuanian': 'lt', + 'macedonian': 'mk', + 'malay': 'ms', + 'mongolian': 'mn', + 'norwegian': 'no', + 'persian': 'fa', + 'polish': 'pl', + 'portuguese': 'pt', + 'romanian': 'ro', + 'russian': 'ru', + 'serbian': 'sr', + 'sinhala': 'si', + 'slovak': 'sk', + 'slovene': 'sl', + 'spanish': 'es', + 'swedish': 'sv', + 'tajik': 'tg', + 'tamil': 'ta', + 'thai': 'th', + 'turkish': 'tr', + 'turkmen': 'tk', + 'ukrainian': 'uk', + 'urdu': 'ur', + 'uzbek': 'uz', + 'vietnamese': 'vi', + 'other': 'other', +} class PolygonTaskLoader(TaskLoader):