Feat/upgrade check i18n scripts (#4671)

This commit is contained in:
crazywoola
2024-05-27 10:36:34 +08:00
committed by GitHub
parent af026c5953
commit 8152bc6fbf
13 changed files with 270 additions and 122 deletions

View File

@@ -1,3 +1,4 @@
import data from './languages.json'
export type Item = {
value: number | string
name: string
@@ -23,127 +24,7 @@ export type I18nText = {
'pl-PL': string
}
export const languages = [
{
value: 'en-US',
name: 'English (United States)',
prompt_name: 'English',
example: 'Hello, Dify!',
supported: true,
},
{
value: 'zh-Hans',
name: '简体中文',
prompt_name: 'Chinese Simplified',
example: '你好Dify',
supported: true,
},
{
value: 'zh-Hant',
name: '繁體中文',
prompt_name: 'Chinese Traditional',
example: '你好Dify',
supported: true,
},
{
value: 'pt-BR',
name: 'Português (Brasil)',
prompt_name: 'Portuguese',
example: 'Olá, Dify!',
supported: true,
},
{
value: 'es-ES',
name: 'Español (España)',
prompt_name: 'Spanish',
example: 'Saluton, Dify!',
supported: false,
},
{
value: 'fr-FR',
name: 'Français (France)',
prompt_name: 'French',
example: 'Bonjour, Dify!',
supported: true,
},
{
value: 'de-DE',
name: 'Deutsch (Deutschland)',
prompt_name: 'German',
example: 'Hallo, Dify!',
supported: true,
},
{
value: 'ja-JP',
name: '日本語 (日本)',
prompt_name: 'Japanese',
example: 'こんにちは、Dify!',
supported: true,
},
{
value: 'ko-KR',
name: '한국어 (대한민국)',
prompt_name: 'Korean',
example: '안녕하세요, Dify!',
supported: true,
},
{
value: 'ru-RU',
name: 'Русский (Россия)',
prompt_name: 'Russian',
example: ' Привет, Dify!',
supported: false,
},
{
value: 'it-IT',
name: 'Italiano (Italia)',
prompt_name: 'Italian',
example: 'Ciao, Dify!',
supported: false,
},
{
value: 'th-TH',
name: 'ไทย (ประเทศไทย)',
prompt_name: 'Thai',
example: 'สวัสดี Dify!',
supported: false,
},
{
value: 'id-ID',
name: 'Bahasa Indonesia',
prompt_name: 'Indonesian',
example: 'Saluto, Dify!',
supported: false,
},
{
value: 'uk-UA',
name: 'Українська (Україна)',
prompt_name: 'Ukrainian',
example: 'Привет, Dify!',
supported: true,
},
{
value: 'vi-VN',
name: 'Tiếng Việt (Việt Nam)',
prompt_name: 'Vietnamese',
example: 'Xin chào, Dify!',
supported: true,
},
{
value: 'ro-RO',
name: 'Română (România)',
prompt_name: 'Romanian',
example: 'Salut, Dify!',
supported: true,
},
{
value: 'pl-PL',
name: 'Polski (Polish)',
prompt_name: 'Polish',
example: 'Cześć, Dify!',
supported: true,
},
]
export const languages = data.languages
export const LanguagesSupported = languages.filter(item => item.supported).map(item => item.value)