From ebe471bdb45b304c42cc3f3ec4325fa75989dbbe Mon Sep 17 00:00:00 2001 From: Daniel McKnight Date: Tue, 2 Aug 2022 10:36:01 -0700 Subject: [PATCH] Add more default BCP-47 languages based on https://cloud.google.com/speech-to-text/docs/languages Also defined: 'ga-ie' --- lingua_franca/internal.py | 59 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/lingua_franca/internal.py b/lingua_franca/internal.py index 2733e673..4b7685a6 100644 --- a/lingua_franca/internal.py +++ b/lingua_franca/internal.py @@ -18,24 +18,79 @@ "fa-ir", "pt-pt", "ru-ru", "sl-si", "sv-se", "tr-tr", "eu-eu") -_DEFAULT_FULL_LANG_CODES = {'ca': 'ca-es', +_DEFAULT_FULL_LANG_CODES = {'af': 'af-za', + 'am': 'am-et', + 'ar': 'ar-sa', # Is this a good default? + 'az': 'az-az', + 'bg': 'bg-bg', + 'bn': 'bn-bd', + 'bs': 'bs-ba', + 'ca': 'ca-es', 'cs': 'cs-cz', 'da': 'da-dk', 'de': 'de-de', + 'el': 'el-gr', 'en': 'en-us', 'es': 'es-es', + 'et': 'et-ee', 'eu': 'eu-eu', 'fa': 'fa-ir', + 'fi': 'fi-fi', + 'fil': 'fil-ph', 'fr': 'fr-fr', + 'ga': 'ga-ie', + 'gl': 'gl-es', + 'gu': 'gu-in', + 'hi': 'hi-in', + 'hr': 'hr-hr', 'hu': 'hu-hu', + 'hy': 'hy-am', + 'id': 'id-id', + 'is': 'is-is', 'it': 'it-it', + 'iw': 'iw-il', + 'ja': 'ja-jp', + 'jv': 'jv-id', + 'ka': 'ka-ge', + 'kk': 'kk-kz', + 'km': 'km-kh', + 'kn': 'kn-id', + 'ko': 'ko-kr', + 'lo': 'lo-la', + 'lv': 'lv-lv', + 'lt': 'lt-lt', + 'mk': 'mk-mk', + 'ml': 'ml-in', + 'mn': 'mn-mn', + 'mr': 'mr-in', + 'ms': 'ms-my', + 'my': 'my-mm', + 'ne': 'ne-np', 'nl': 'nl-nl', + 'no': 'no-no', 'pl': 'pl-pl', 'pt': 'pt-pt', + 'ro': 'ro-ro', 'ru': 'ru-ru', + 'si': 'si-lk', + 'sk': 'sk-sk', 'sl': 'sl-si', + 'sq': 'sq-al', + 'sr': 'sr-rs', + 'su': 'su-id', 'sv': 'sv-se', - 'tr': 'tr-tr'} + 'sw': 'sw-ke', # Is this a good default? + 'ta': 'ta-in', # Is this a good default? + 'te': 'te-in', + 'th': 'th-th', + 'tr': 'tr-tr', + 'uk': 'uk-ua', + 'ur': 'ur-in', # Is this a good default? + 'uz': 'uz-uz', + 'vi': 'vi-vn', + 'zh': 'zh-cn', # Sometimes defined as cmn-cn? + 'zu': 'zu-za' + } __default_lang = None __active_lang_code = None