From c668f9a84b3f1812dfd85a153a76af6af63a9fca Mon Sep 17 00:00:00 2001 From: "gaoyizhuo.gyz" Date: Fri, 10 May 2024 13:59:00 +0800 Subject: [PATCH 1/3] :globe_with_meridians: chore: add language --- src/ProChat/demos/i18n.tsx | 2 +- src/locale/index.ts | 8 +++++--- src/locale/zh-HK.ts | 16 ++++++++++++++++ 3 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/locale/zh-HK.ts diff --git a/src/ProChat/demos/i18n.tsx b/src/ProChat/demos/i18n.tsx index 897de00..c4c9105 100644 --- a/src/ProChat/demos/i18n.tsx +++ b/src/ProChat/demos/i18n.tsx @@ -9,7 +9,7 @@ export default () => { return (
- options={['en-US', 'zh-CN']} + options={['en-US', 'zh-CN', 'zh-HK']} defaultValue="en-US" onChange={(v) => { setLanguage(v); diff --git a/src/locale/index.ts b/src/locale/index.ts index 30a5c9f..44419b1 100644 --- a/src/locale/index.ts +++ b/src/locale/index.ts @@ -1,14 +1,16 @@ import { LocaleProps } from '@/types/locale'; import enUSLocal from './en-US'; import zhCNLocal from './zh-CN'; -export type Locale = 'zh-CN' | 'en-US'; +import zhHKLocal from './zh-HK'; +export type Locale = 'zh-CN' | 'en-US' | 'zh-HK'; const locales = { 'en-US': enUSLocal, 'zh-CN': zhCNLocal, + 'zh-HK': zhHKLocal, en: enUSLocal, }; -export const gLocaleObject = (glocale: Locale): LocaleProps => { - return locales[glocale as 'zh-CN'] || locales['zh-CN']; +export const gLocaleObject = (gLocale: Locale): LocaleProps => { + return locales[gLocale as 'zh-CN'] || locales['zh-CN']; }; diff --git a/src/locale/zh-HK.ts b/src/locale/zh-HK.ts new file mode 100644 index 0000000..e3ba0d1 --- /dev/null +++ b/src/locale/zh-HK.ts @@ -0,0 +1,16 @@ +export default { + placeholder: '請輸入訊息...', + backToBottom: '回到底部', + clearCurrentDialogue: '清除當前對話', + clearDialogue: '清除對話', + clearModalTitle: '您即將清除會話,清除後將無法恢復。您確定要清除當前會話嗎?', + defaultHelloMessage: '讓我們開始聊天吧', + cancel: '取消', + confirm: '確認', + copy: '複製', + copySuccess: '複製成功', + delete: '刪除', + edit: '編輯', + history: '歷史', + regenerate: '重新生成', +}; From eedd92b8e0f85ddb570047c806af680188530d4e Mon Sep 17 00:00:00 2001 From: "gaoyizhuo.gyz" Date: Fri, 10 May 2024 14:01:35 +0800 Subject: [PATCH 2/3] :white_check_mark: chore: update snapshot --- .../__test__/__snapshots__/demo.test.tsx.snap | 1666 +++++++++-------- 1 file changed, 931 insertions(+), 735 deletions(-) diff --git a/src/ProChat/__test__/__snapshots__/demo.test.tsx.snap b/src/ProChat/__test__/__snapshots__/demo.test.tsx.snap index 7455448..9cc6c20 100644 --- a/src/ProChat/__test__/__snapshots__/demo.test.tsx.snap +++ b/src/ProChat/__test__/__snapshots__/demo.test.tsx.snap @@ -10,7 +10,7 @@ exports[` > renders actions.tsx correctly 1`] = ` style="height: 100%; width: 100%; position: relative;" >
> renders actions.tsx correctly 1`] = ` style="margin-top: 24px;" >
> renders actions.tsx correctly 1`] = `
> renders actions.tsx correctly 1`] = ` />
@@ -145,10 +145,10 @@ exports[` > renders actions.tsx correctly 1`] = `