mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
7753ba2d37
Co-authored-by: Joel <iamjoel007@gmail.com> Co-authored-by: Yeuoly <admin@srmxy.cn> Co-authored-by: JzoNg <jzongcode@gmail.com> Co-authored-by: StyleZhang <jasonapring2015@outlook.com> Co-authored-by: jyong <jyong@dify.ai> Co-authored-by: nite-knite <nkCoding@gmail.com> Co-authored-by: jyong <718720800@qq.com>
28 lines
706 B
Python
28 lines
706 B
Python
|
|
|
|
languages = ['en-US', 'zh-Hans', 'pt-BR', 'es-ES', 'fr-FR', 'de-DE', 'ja-JP', 'ko-KR', 'ru-RU', 'it-IT', 'uk-UA', 'vi-VN']
|
|
|
|
language_timezone_mapping = {
|
|
'en-US': 'America/New_York',
|
|
'zh-Hans': 'Asia/Shanghai',
|
|
'pt-BR': 'America/Sao_Paulo',
|
|
'es-ES': 'Europe/Madrid',
|
|
'fr-FR': 'Europe/Paris',
|
|
'de-DE': 'Europe/Berlin',
|
|
'ja-JP': 'Asia/Tokyo',
|
|
'ko-KR': 'Asia/Seoul',
|
|
'ru-RU': 'Europe/Moscow',
|
|
'it-IT': 'Europe/Rome',
|
|
'uk-UA': 'Europe/Kyiv',
|
|
'vi-VN': 'Asia/Ho_Chi_Minh',
|
|
}
|
|
|
|
|
|
def supported_language(lang):
|
|
if lang in languages:
|
|
return lang
|
|
|
|
error = ('{lang} is not a valid language.'
|
|
.format(lang=lang))
|
|
raise ValueError(error)
|