From ab464fb3e82a0784476e7f755c2cd01e9ecaf0f8 Mon Sep 17 00:00:00 2001 From: Train Chen Date: Wed, 27 May 2026 01:29:38 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20chrome=20translation=20=E2=80=94=20refl?= =?UTF-8?q?ection=20flow=20(ja/zh-Hans/zh-Hant)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds Japanese, Simplified Chinese, and Traditional Chinese keys to the three post-write reflection screens: - ReflectionScreen.tsx - GratitudeScreen.tsx - FeedbackScreen.tsx ~16 t()/bilingual() sites total. Cherry-picked from the larger sweep branch (feat/chrome-translation-tier2-3) as a per-flow reviewable PR. The hard-coded isFr/isEs ternaries inside ReflectionScreen and FeedbackScreen are pre-existing technical debt (not t() calls) and remain out of scope for this pass — they'll be cleaned up in a follow-up that refactors them into proper t() sites. Register: polite Japanese (です・ます), neutral Mandarin (S/T distinguished where they differ). Co-Authored-By: Claude Opus 4.7 (1M context) --- docs/CHANGELOG.md | 13 +++++++++++++ src/components/journal/FeedbackScreen.tsx | 14 +++++++------- src/components/journal/GratitudeScreen.tsx | 10 +++++----- src/components/journal/ReflectionScreen.tsx | 12 ++++++------ 4 files changed, 31 insertions(+), 18 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 311057b..a2fc1b0 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -15,6 +15,19 @@ Files in this PR: Register matches PR #40 + PR #44: polite Japanese (です・ます), neutral Mandarin with S/T distinguished where they diverge (继续/繼續, 字 is shared, 书写/書寫, etc.). Cherry-picked from the larger sweep branch (`feat/chrome-translation-tier2-3`) as a reviewable per-flow PR. Native review pass still planned post-merge. +--- +### Chrome translation — reflection flow (Reflection + Gratitude + Feedback) + +**Adds ja / zh-Hans / zh-Hant keys to the three post-write reflection screens.** + +Files in this PR: +- `ReflectionScreen.tsx` — Back, "Taking a moment to reflect..." loader, error-state Continue, response placeholder + optional-helper, "Finish with gratitude" bilingual anchor +- `GratitudeScreen.tsx` — Back, optional-skip helper, placeholder, Complete journal, Skip and finish +- `FeedbackScreen.tsx` — header "A moment of clarity", three section bilingual anchors (Naming with precision / A small note / Vocabulary bridge), Continue, Skip + +Note: the hard-coded `isFr ? : isEs ? : ...` ternaries in ReflectionScreen and FeedbackScreen are pre-existing technical debt (they are not `t()` calls). They are outside the scope of this chrome-translation pass and are tracked separately. + +Register matches PR #40 + PR #44. --- diff --git a/src/components/journal/FeedbackScreen.tsx b/src/components/journal/FeedbackScreen.tsx index 1f69859..e8f16db 100644 --- a/src/components/journal/FeedbackScreen.tsx +++ b/src/components/journal/FeedbackScreen.tsx @@ -128,7 +128,7 @@ export function FeedbackScreen({ journalContent, onContinue, onSkip }: FeedbackS const hasEmotionalGranularity = feedback?.emotionalGranularity?.detected && feedback?.emotionalGranularity?.alternatives?.length > 0; - const headerText = t({ fr: 'Un moment de clarté', en: 'A moment of clarity', es: 'Un momento de claridad' }); + const headerText = t({ fr: 'Un moment de clarté', en: 'A moment of clarity', es: 'Un momento de claridad', ja: '澄んだひととき', 'zh-Hans': '清明片刻', 'zh-Hant': '清明片刻' }); return (
@@ -193,7 +193,7 @@ export function FeedbackScreen({ journalContent, onContinue, onSkip }: FeedbackS
- {bilingual({ fr: 'Nommer avec précision', en: 'Naming with precision', es: 'Nombrar con precisión', 'zh-Hans': '精准命名', 'zh-Hant': '精準命名' })} + {bilingual({ fr: 'Nommer avec précision', en: 'Naming with precision', es: 'Nombrar con precisión', ja: '言葉で正確に表す', 'zh-Hans': '精准命名', 'zh-Hant': '精準命名' })}
@@ -234,7 +234,7 @@ export function FeedbackScreen({ journalContent, onContinue, onSkip }: FeedbackS
- {bilingual({ fr: 'Une petite note', en: 'A small note', es: 'Una pequeña nota', 'zh-Hans': '小提示', 'zh-Hant': '小提示' })} + {bilingual({ fr: 'Une petite note', en: 'A small note', es: 'Una pequeña nota', ja: 'ひとこと', 'zh-Hans': '小提示', 'zh-Hant': '小提示' })}
@@ -259,7 +259,7 @@ export function FeedbackScreen({ journalContent, onContinue, onSkip }: FeedbackS
- {bilingual({ fr: 'Une petite note', en: 'A small note', es: 'Una pequeña nota', 'zh-Hans': '小提示', 'zh-Hant': '小提示' })} + {bilingual({ fr: 'Une petite note', en: 'A small note', es: 'Una pequeña nota', ja: 'ひとこと', 'zh-Hans': '小提示', 'zh-Hant': '小提示' })}
{feedback.suggestions.slice(0, 1).map((suggestion, index) => (
@@ -287,7 +287,7 @@ export function FeedbackScreen({ journalContent, onContinue, onSkip }: FeedbackS
- {bilingual({ fr: 'Pont de vocabulaire', en: 'Vocabulary bridge', es: 'Puente de vocabulario', 'zh-Hans': '词汇桥梁', 'zh-Hant': '詞彙橋樑' })} + {bilingual({ fr: 'Pont de vocabulaire', en: 'Vocabulary bridge', es: 'Puente de vocabulario', ja: '語彙の橋渡し', 'zh-Hans': '词汇桥梁', 'zh-Hant': '詞彙橋樑' })} {isLoading && ( )}
diff --git a/src/components/journal/GratitudeScreen.tsx b/src/components/journal/GratitudeScreen.tsx index 52d7910..337ce6f 100644 --- a/src/components/journal/GratitudeScreen.tsx +++ b/src/components/journal/GratitudeScreen.tsx @@ -31,7 +31,7 @@ export function GratitudeScreen({ prompt, onSave, onSkip, onBack }: GratitudeScr className="inline-flex items-center text-muted-foreground hover:text-foreground transition-colors mb-8 self-start" > - {t({ fr: 'Retour', en: 'Back', es: 'Volver' }).primary} + {t({ fr: 'Retour', en: 'Back', es: 'Volver', ja: '戻る', 'zh-Hans': '返回', 'zh-Hant': '返回' }).primary} {/* Header */} @@ -43,7 +43,7 @@ export function GratitudeScreen({ prompt, onSave, onSkip, onBack }: GratitudeScr {promptText.secondary}

- {t({ fr: "C'est optionnel. Passez si rien ne vous vient.", en: 'This is optional. Skip if nothing comes to mind.', es: 'Es opcional. Omite si no se te ocurre nada.' }).primary} + {t({ fr: "C'est optionnel. Passez si rien ne vous vient.", en: 'This is optional. Skip if nothing comes to mind.', es: 'Es opcional. Omite si no se te ocurre nada.', ja: '任意です。思い浮かばなければスキップしてください。', 'zh-Hans': '这是可选的,想不到就跳过。', 'zh-Hant': '這是選填的,想不到就跳過。' }).primary}

@@ -52,7 +52,7 @@ export function GratitudeScreen({ prompt, onSave, onSkip, onBack }: GratitudeScr