first commit
This commit is contained in:
18
src/locale/index.ts
Normal file
18
src/locale/index.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import * as Langs from './lang'
|
||||
import type { SelectOptionType } from '@/types/provider'
|
||||
|
||||
export type LanguageType = keyof typeof Langs
|
||||
|
||||
export interface TranslatePair {
|
||||
[key: string]: string | string[] | TranslatePair
|
||||
}
|
||||
|
||||
export interface language {
|
||||
name: string
|
||||
desc: string
|
||||
locales: TranslatePair
|
||||
}
|
||||
|
||||
export const locales = Object.fromEntries(Object.entries(Langs).map(([key, value]) => [key, value.locales]))
|
||||
|
||||
export const localesOptions: SelectOptionType[] = Object.entries(Langs).map(([key, value]) => ({ label: value.desc, value: key }))
|
||||
40
src/locale/lang/en.ts
Normal file
40
src/locale/lang/en.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { language } from '..'
|
||||
|
||||
export const en = {
|
||||
name: 'en',
|
||||
desc: 'English',
|
||||
locales: {
|
||||
settings: {
|
||||
title: 'Settings',
|
||||
save: 'Save',
|
||||
general: {
|
||||
title: 'General',
|
||||
requestWithBackend: 'Request With Backend',
|
||||
locale: 'Change system language',
|
||||
},
|
||||
openai: {
|
||||
title: 'OpenAI',
|
||||
key: '',
|
||||
},
|
||||
replicate: {},
|
||||
},
|
||||
conversations: {
|
||||
title: 'Conversations',
|
||||
add: 'New',
|
||||
recent: 'Recents',
|
||||
noRecent: 'No recents',
|
||||
untitled: 'Untitled',
|
||||
confirm: {
|
||||
title: 'Delete all messages in this chat',
|
||||
desc: 'This action cannot be undone.',
|
||||
message: 'Delete this record',
|
||||
btn: 'confirm',
|
||||
cancel: 'cancel',
|
||||
},
|
||||
},
|
||||
send: {
|
||||
placeholder: 'Enter Something...',
|
||||
button: 'Send',
|
||||
},
|
||||
},
|
||||
} as language
|
||||
2
src/locale/lang/index.ts
Normal file
2
src/locale/lang/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './en'
|
||||
export * from './zh-cn'
|
||||
40
src/locale/lang/zh-cn.ts
Normal file
40
src/locale/lang/zh-cn.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import type { language } from '..'
|
||||
|
||||
export const zhCN = {
|
||||
name: 'zhCN',
|
||||
desc: '简体中文',
|
||||
locales: {
|
||||
settings: {
|
||||
title: '设置',
|
||||
save: '保存',
|
||||
general: {
|
||||
title: '通用',
|
||||
requestWithBackend: '请求代理后端',
|
||||
locale: '切换语言',
|
||||
},
|
||||
openai: {
|
||||
title: 'OpenAI',
|
||||
key: '',
|
||||
},
|
||||
replicate: {},
|
||||
},
|
||||
conversations: {
|
||||
title: '对话列表',
|
||||
add: '新对话',
|
||||
recent: '最近对话',
|
||||
noRecent: '暂无最近对话',
|
||||
untitled: '未命名对话',
|
||||
confirm: {
|
||||
title: '删除本会话的所有消息',
|
||||
desc: '这将删除本会话的所有消息,且不可恢复',
|
||||
message: '删除这条记录',
|
||||
btn: '确认',
|
||||
cancel: '取消',
|
||||
},
|
||||
},
|
||||
send: {
|
||||
placeholder: '输入内容...',
|
||||
button: '发送',
|
||||
},
|
||||
},
|
||||
} as language
|
||||
Reference in New Issue
Block a user