From bab1d444a2a7b06ba369aa1ea675f2dd0a6e867a Mon Sep 17 00:00:00 2001 From: owo Date: Fri, 18 Sep 2026 18:33:33 +0800 Subject: [PATCH 1/4] feat(i18n): add Japanese localization across the landing site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add ja as a third UI locale alongside en/zh: - New src/locales/ja.json translating every key (273 keys, full parity with en/zh), using the product's official Japanese terminology from the embedded Memoh app (マーケットプレイス, Botにインストールする, ブラウザー, …) - Register ja in i18n.ts with browser-language detection and validation of the stored preference; add 日本語 to the TopBar language menu - Pass lang=ja through to the embedded product demo (the vendored app already ships a ja locale; only the landing-owned mocks/bootstrap.ts gated it to zh/en) - Move the remaining hardcoded bilingual strings into locale files: PricingSection plan copy, HeroShowcase loading text and iframe title, the "And more" platform strip, and the TopBar aria-labels - Set globally from App.vue so it also tracks the locale on the legal pages; format blog dates with the ja calendar while post bodies fall back to English; add ja hreflang alternates - Round-trip the legal pages' ?lang= query for all three locales (the document body itself stays zh/en by design, other locales read the English text) - Load Noto Sans JP / Noto Serif JP and swap the SC font fallbacks under :lang(ja) so kana and kanji render with Japanese glyph forms - Fix blog SEO titles dropping the " | Memoh Blog" suffix in every locale: vue-i18n parsed the raw | as a plural separator; escape it as {'|'} The wechat chat demo is adapted for ja (it teaches the Chinese phrase 辛苦了 instead of explaining おつかれ to a Japanese reader). Adjacent translations reviewed against the product UI and the zh/en voice. Co-Authored-By: Claude Fable 5 --- demo-app/mocks/bootstrap.ts | 3 +- index.html | 2 +- src/App.vue | 11 + src/components/HeroShowcase.vue | 11 +- src/components/PricingSection.vue | 35 ++- src/components/TopBar.vue | 35 +-- src/i18n.ts | 16 +- src/lib/blogs.ts | 6 +- src/locales/en.json | 33 ++- src/locales/ja.json | 368 ++++++++++++++++++++++++++++++ src/locales/zh.json | 33 ++- src/pages/DownloadPage.vue | 1 + src/pages/HomePage.vue | 3 +- src/pages/LegalPage.vue | 8 +- src/pages/WaitlistPage.vue | 1 + src/style.css | 7 + 16 files changed, 514 insertions(+), 59 deletions(-) create mode 100644 src/locales/ja.json diff --git a/demo-app/mocks/bootstrap.ts b/demo-app/mocks/bootstrap.ts index edef950..fa72591 100644 --- a/demo-app/mocks/bootstrap.ts +++ b/demo-app/mocks/bootstrap.ts @@ -20,7 +20,8 @@ localStorage.setItem('workspace-workbench-open', 'true') localStorage.setItem('vueuse-color-scheme', 'dark') document.documentElement.classList.add('dark') document.documentElement.style.colorScheme = 'dark' -const locale = new URLSearchParams(location.search).get('lang') === 'zh' ? 'zh' : 'en' +const langParam = new URLSearchParams(location.search).get('lang') +const locale = langParam === 'zh' || langParam === 'ja' ? langParam : 'en' localStorage.setItem('language', locale) sessionStorage.setItem('chat-bot-id', 'bot-memoh') sessionStorage.setItem('chat-session-id', 'session-welcome') diff --git a/index.html b/index.html index 73f061b..d9cdc9f 100644 --- a/index.html +++ b/index.html @@ -23,7 +23,7 @@ - + @@ -13,12 +16,12 @@ watch(demoUrl, () => { ready.value = false })
- {{ locale === 'zh' ? '正在打开 Memoh…' : 'Opening Memoh…' }} + {{ t('hero.demoLoading') }}