feat(i18n): add language switcher with en/ja translations
- New client-side i18n via React Context (useI18n, tArray, I18nProvider) - Catalog ships 21 locale stubs; only zh-CN/en/ja have reviewed translations - Header language switcher (globe icon + short label) before settings gear - All hardcoded Chinese UI text migrated to keys: typewriter, options, hints (with embedded gear icon via dangerouslySetInnerHTML), settings panel, footer/about, play page hints - AI output language follows user-selected locale via trailing one-liner directive appended to Architect/Writer/CharacterDesigner/InsertBeat user messages (preserves system-prompt cacheability) - Per-locale separator rule: zh uses middot between every glyph; en/ja use plain spaces - Option value → i18n key suffix maps preserve Chinese as the underlying identifier so analytics unions and STYLE_MAP keys stay byte-stable Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
// Traditional Chinese (Hong Kong)
|
||||
// Auto-generated by scripts/translate-i18n.mjs
|
||||
|
||||
export const zhHK = {
|
||||
"layout": {
|
||||
"metadata": {
|
||||
"title": "InfiPlot",
|
||||
"description": "InfiPlot"
|
||||
}
|
||||
},
|
||||
"home": {
|
||||
"examples": {
|
||||
"male": [],
|
||||
"female": [],
|
||||
"x": []
|
||||
},
|
||||
"options": {
|
||||
"gender": "",
|
||||
"artStyle": "",
|
||||
"plotStyle": "",
|
||||
"voice": "",
|
||||
"pacing": ""
|
||||
},
|
||||
"genders": {
|
||||
"male": "",
|
||||
"female": "",
|
||||
"x": ""
|
||||
},
|
||||
"artStyles": {},
|
||||
"plotStyles": {
|
||||
"straightforward": "",
|
||||
"twist": ""
|
||||
},
|
||||
"voiceOptions": {
|
||||
"off": "",
|
||||
"on": ""
|
||||
},
|
||||
"pacings": {
|
||||
"fast": "",
|
||||
"relaxed": ""
|
||||
},
|
||||
"stories": {},
|
||||
"ui": {
|
||||
"start": "",
|
||||
"loadStory": "",
|
||||
"settings": "",
|
||||
"searchPlaceholder": "",
|
||||
"noMatchingStyle": "",
|
||||
"close": "",
|
||||
"back": "",
|
||||
"save": "",
|
||||
"cancel": "",
|
||||
"saveAndSelect": ""
|
||||
},
|
||||
"styleModal": {},
|
||||
"hero": {
|
||||
"title": "",
|
||||
"placeholder": " ",
|
||||
"enterHint": ""
|
||||
},
|
||||
"hint": {
|
||||
"text": (params: { authEnabled?: boolean }) => {
|
||||
const authHint = params.authEnabled ? '(測試期間,登入即可免費暢玩)' : '';
|
||||
return `輸入想法、配置風格,點擊「開始」即可遊玩${authHint};也可以從下方精選故事集挑一篇快速體驗 <em>InfiPlot</em>。點擊「設置」還能填入你的名字,以及你自己的文本、繪圖、識圖模型和配音 Key——全部只存在本地瀏覽器,體驗更穩定。`;
|
||||
},
|
||||
"closeAriaLabel": "不再顯示此提示"
|
||||
},
|
||||
"about": {},
|
||||
"errors": {
|
||||
"emptyFile": "",
|
||||
"fileTooLarge": "",
|
||||
"unpackFailed": "",
|
||||
"parseFailed": "",
|
||||
"cardNotFound": ""
|
||||
}
|
||||
},
|
||||
"play": {},
|
||||
"settings": {},
|
||||
"auth": {},
|
||||
"history": {},
|
||||
"customForm": {},
|
||||
"language": {
|
||||
"title": "",
|
||||
"current": "",
|
||||
"select": ""
|
||||
}
|
||||
} as const;
|
||||
|
||||
export type ZhHKTranslations = typeof zhHK;
|
||||
Reference in New Issue
Block a user