dify/web/utils/language.ts

137 lines
4.5 KiB
TypeScript
Raw Normal View History

2024-01-23 21:14:53 +08:00
export type Item = {
2023-05-15 08:51:32 +08:00
value: number | string
name: string
example: string
2023-05-15 08:51:32 +08:00
}
2024-01-23 21:14:53 +08:00
export const LanguagesSupported = ['en-US', 'zh-Hans', 'pt-BR', 'es-ES', 'fr-FR', 'de-DE', 'ja-JP', 'ko-KR', 'ru-RU', 'it-IT', 'th-TH', 'id-ID', 'uk-UA']
export const LanguagesSupportedUnderscore = ['en_US', 'zh_Hans', 'pt_BR', 'es_ES', 'fr_FR', 'de_DE', 'ja_JP', 'ko_KR', 'ru_RU', 'it_IT', 'th_TH', 'id_ID', 'uk_UA']
2024-01-24 11:08:11 +08:00
2024-01-23 21:14:53 +08:00
export const languages = [
2023-05-15 08:51:32 +08:00
{
value: 'en-US',
name: 'English(United States)',
example: 'Hello, Dify!',
2023-05-15 08:51:32 +08:00
},
{
value: 'zh-Hans',
name: '简体中文',
example: '你好Dify',
2023-05-15 08:51:32 +08:00
},
2024-01-23 21:14:53 +08:00
{
value: 'pt-BR',
name: 'Português(Brasil)',
example: 'Olá, Dify!',
2024-01-23 21:14:53 +08:00
},
{
value: 'es-ES',
name: 'Español(España)',
example: 'Saluton, Dify!',
},
{
value: 'fr-FR',
name: 'Français(France)',
example: 'Bonjour, Dify!',
},
{
value: 'de-DE',
name: 'Deutsch(Deutschland)',
example: 'Hallo, Dify!',
},
{
value: 'ja-JP',
name: '日本語(日本)',
example: 'こんにちは、Dify!',
},
{
value: 'ko-KR',
name: '한국어(대한민국)',
example: '안녕, Dify!',
},
{
value: 'ru-RU',
name: 'Русский(Россия)',
example: ' Привет, Dify!',
},
{
value: 'it-IT',
name: 'Italiano(Italia)',
example: 'Ciao, Dify!',
},
{
value: 'th-TH',
name: 'ไทย(ประเทศไทย)',
example: 'สวัสดี Dify!',
},
{
value: 'id-ID',
name: 'Bahasa Indonesia',
example: 'Saluto, Dify!',
},
{
value: 'uk-UA',
name: 'Українська(Україна)',
example: 'Привет, Dify!',
},
2023-05-15 08:51:32 +08:00
]
2024-01-23 21:14:53 +08:00
export const getModelRuntimeSupported = (locale: string) => {
if (locale === 'zh-Hans')
return locale.replace('-', '_')
return LanguagesSupported[0].replace('-', '_')
}
2023-05-15 08:51:32 +08:00
export const languageMaps = {
2024-01-23 21:14:53 +08:00
'en-US': 'en-US',
2023-05-15 08:51:32 +08:00
'zh-Hans': 'zh-Hans',
2024-01-23 21:14:53 +08:00
'pt-BR': 'pt-BR',
'es-ES': 'es-ES',
'fr-FR': 'fr-FR',
'de-DE': 'de-DE',
'ja-JP': 'ja-JP',
'ko-KR': 'ko-KR',
'ru-RU': 'ru-RU',
'it-IT': 'it-IT',
'uk-UA': 'uk-UA',
2024-01-23 21:14:53 +08:00
}
export type I18nText = {
'en-US': string
'zh-Hans': string
'pt-BR': string
'es-ES': string
'fr-FR': string
'de-DE': string
'ja-JP': string
'ko-KR': string
'ru-RU': string
'it-IT': string
'uk-UA': string
2024-01-23 21:14:53 +08:00
}
export const NOTICE_I18N = {
title: {
en_US: 'Important Notice',
zh_Hans: '重要公告',
pt_BR: 'Aviso Importante',
es_ES: 'Aviso Importante',
fr_FR: 'Avis important',
de_DE: 'Wichtiger Hinweis',
ja_JP: '重要なお知らせ',
ko_KR: '중요 공지',
uk_UA: 'Важливе повідомлення',
2024-01-23 21:14:53 +08:00
},
desc: {
en_US: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
zh_Hans: '为了有效提升数据检索能力及稳定性Dify 将于 2023 年 8 月 29 日 03:00 至 08:00 期间进行服务升级,届时 Dify 云端版及应用将无法访问。感谢您的耐心与支持。',
pt_BR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
es_ES: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
fr_FR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
de_DE: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
ja_JP: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
ko_KR: 'Our system will be unavailable from 19:00 to 24:00 UTC on August 28 for an upgrade. For questions, kindly contact our support team (support@dify.ai). We value your patience.',
uk_UA: 'Наша система буде недоступна з 19:00 до 24:00 UTC 28 серпня для оновлення. Якщо у вас виникнуть запитання, будь ласка, зв’яжіться з нашою службою підтримки (support@dify.ai). Дякуємо за терпіння.',
2024-01-23 21:14:53 +08:00
},
href: '#',
2023-05-15 08:51:32 +08:00
}