Feat/portuguese support (#2075)

This commit is contained in:
crazywoola 2024-01-23 21:14:53 +08:00 • committed by GitHub
commit c17baef172
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
78 changed files with 2849 additions and 376 deletions

View file

@ -3,6 +3,7 @@ export type FormValue = Record<string, any>
export type TypeWithI18N<T = string> = {
'en_US': T
'zh_Hans': T
[key: string]: T
}
export enum FormTypeEnum {

View file

@ -16,7 +16,7 @@ import {
ConfigurateMethodEnum,
ModelTypeEnum,
} from './declarations'
import { languageMaps } from './utils'
import { getModelRuntimeSupported } from '@/utils/language'
import I18n from '@/context/i18n'
import {
fetchDefaultModal,
@ -59,8 +59,7 @@ export const useSystemDefaultModelAndModelList: UseDefaultModelAndModelList = (
export const useLanguage = () => {
const { locale } = useContext(I18n)
return languageMaps[locale]
return getModelRuntimeSupported(locale)
}
export const useProviderCrenditialsFormSchemasValue = (

View file

@ -15,14 +15,6 @@ import {
validateModelProvider,
} from '@/service/common'
export const languageMaps = {
'en': 'en_US',
'zh-Hans': 'zh_Hans',
} as {
'en': 'en_US'
'zh-Hans': 'zh_Hans'
}
export const MODEL_PROVIDER_QUOTA_GET_FREE = ['minimax', 'spark', 'zhipuai']
export const MODEL_PROVIDER_QUOTA_GET_PAID = ['anthropic', 'openai', 'azure_openai']