mirror of
https://github.com/langgenius/webapp-conversation.git
synced 2025-12-08 17:32:27 +08:00
feat: lint code
This commit is contained in:
@ -12,7 +12,6 @@ export const getLocaleOnClient = (): Locale => {
|
||||
export const setLocaleOnClient = (locale: Locale, notReload?: boolean) => {
|
||||
Cookies.set(LOCALE_COOKIE_NAME, locale)
|
||||
changeLanguage(locale)
|
||||
if (!notReload) {
|
||||
if (!notReload)
|
||||
location.reload()
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import commonEn from './lang/common.en'
|
||||
import commonZh from './lang/common.zh'
|
||||
import appEn from './lang/app.en'
|
||||
import appZh from './lang/app.zh'
|
||||
import { Locale } from '.'
|
||||
import type { Locale } from '.'
|
||||
|
||||
const resources = {
|
||||
'en': {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { createInstance } from 'i18next'
|
||||
import resourcesToBackend from 'i18next-resources-to-backend'
|
||||
import { initReactI18next } from 'react-i18next/initReactI18next'
|
||||
import { Locale } from '.'
|
||||
import type { Locale } from '.'
|
||||
|
||||
// https://locize.com/blog/next-13-app-dir-i18n/
|
||||
const initI18next = async (lng: Locale, ns: string) => {
|
||||
@ -21,6 +21,6 @@ export async function useTranslation(lng: Locale, ns = '', options: Record<strin
|
||||
const i18nextInstance = await initI18next(lng, ns)
|
||||
return {
|
||||
t: i18nextInstance.getFixedT(lng, ns, options.keyPrefix),
|
||||
i18n: i18nextInstance
|
||||
i18n: i18nextInstance,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,33 +1,33 @@
|
||||
const translation = {
|
||||
common: {
|
||||
welcome: "Welcome to use",
|
||||
appUnavailable: "App is unavailable",
|
||||
appUnkonwError: "App is unavailable"
|
||||
welcome: 'Welcome to use',
|
||||
appUnavailable: 'App is unavailable',
|
||||
appUnkonwError: 'App is unavailable',
|
||||
},
|
||||
chat: {
|
||||
newChat: "New chat",
|
||||
newChatDefaultName: "New conversation",
|
||||
openingStatementTitle: "Opening statement",
|
||||
powerBy: "Powered by",
|
||||
prompt: "Prompt",
|
||||
privatePromptConfigTitle: "Conversation settings",
|
||||
publicPromptConfigTitle: "Initial Prompt",
|
||||
configStatusDes: "Before start, you can modify conversation settings",
|
||||
newChat: 'New chat',
|
||||
newChatDefaultName: 'New conversation',
|
||||
openingStatementTitle: 'Opening statement',
|
||||
powerBy: 'Powered by',
|
||||
prompt: 'Prompt',
|
||||
privatePromptConfigTitle: 'Conversation settings',
|
||||
publicPromptConfigTitle: 'Initial Prompt',
|
||||
configStatusDes: 'Before start, you can modify conversation settings',
|
||||
configDisabled:
|
||||
"Previous session settings have been used for this session.",
|
||||
startChat: "Start Chat",
|
||||
'Previous session settings have been used for this session.',
|
||||
startChat: 'Start Chat',
|
||||
privacyPolicyLeft:
|
||||
"Please read the ",
|
||||
'Please read the ',
|
||||
privacyPolicyMiddle:
|
||||
"privacy policy",
|
||||
'privacy policy',
|
||||
privacyPolicyRight:
|
||||
" provided by the app developer.",
|
||||
' provided by the app developer.',
|
||||
},
|
||||
errorMessage: {
|
||||
valueOfVarRequired: "Variables value can not be empty",
|
||||
valueOfVarRequired: 'Variables value can not be empty',
|
||||
waitForResponse:
|
||||
"Please wait for the response to the previous message to complete.",
|
||||
'Please wait for the response to the previous message to complete.',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default translation;
|
||||
export default translation
|
||||
|
||||
@ -1,28 +1,28 @@
|
||||
const translation = {
|
||||
common: {
|
||||
welcome: "欢迎使用",
|
||||
appUnavailable: "应用不可用",
|
||||
appUnkonwError: "应用不可用",
|
||||
welcome: '欢迎使用',
|
||||
appUnavailable: '应用不可用',
|
||||
appUnkonwError: '应用不可用',
|
||||
},
|
||||
chat: {
|
||||
newChat: "新对话",
|
||||
newChatDefaultName: "新的对话",
|
||||
openingStatementTitle: "对话开场白",
|
||||
powerBy: "Powered by",
|
||||
prompt: "提示词",
|
||||
privatePromptConfigTitle: "对话设置",
|
||||
publicPromptConfigTitle: "对话前提示词",
|
||||
configStatusDes: "开始前,您可以修改对话设置",
|
||||
configDisabled: "此次会话已使用上次会话表单",
|
||||
startChat: "开始对话",
|
||||
privacyPolicyLeft: "请阅读由该应用开发者提供的",
|
||||
privacyPolicyMiddle: "隐私政策",
|
||||
privacyPolicyRight: "。",
|
||||
newChat: '新对话',
|
||||
newChatDefaultName: '新的对话',
|
||||
openingStatementTitle: '对话开场白',
|
||||
powerBy: 'Powered by',
|
||||
prompt: '提示词',
|
||||
privatePromptConfigTitle: '对话设置',
|
||||
publicPromptConfigTitle: '对话前提示词',
|
||||
configStatusDes: '开始前,您可以修改对话设置',
|
||||
configDisabled: '此次会话已使用上次会话表单',
|
||||
startChat: '开始对话',
|
||||
privacyPolicyLeft: '请阅读由该应用开发者提供的',
|
||||
privacyPolicyMiddle: '隐私政策',
|
||||
privacyPolicyRight: '。',
|
||||
},
|
||||
errorMessage: {
|
||||
valueOfVarRequired: "变量值必填",
|
||||
waitForResponse: "请等待上条信息响应完成",
|
||||
valueOfVarRequired: '变量值必填',
|
||||
waitForResponse: '请等待上条信息响应完成',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default translation;
|
||||
export default translation
|
||||
|
||||
@ -16,7 +16,7 @@ const translation = {
|
||||
lineBreak: 'Line break',
|
||||
like: 'like',
|
||||
dislike: 'dislike',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
@ -16,7 +16,7 @@ const translation = {
|
||||
lineBreak: '换行',
|
||||
like: '赞同',
|
||||
dislike: '反对',
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
export default translation
|
||||
|
||||
Reference in New Issue
Block a user