Phase 19: the copy stops being hardcoded Mandarin
Every `中文 · English` string moves out of ~29 components into web/src/i18n: one Pack type, a verbatim zh pack, and two ways to read it — usePack() for components, pack() for the modules that build a line when something happens rather than when something renders. Anything with a value in it is a function on the pack rather than a template at the call site, English pluralisation included: word order isn't universal, and a pack author has to be able to move the number. The roster constants (tones, rewrite styles, export formats, companions) keep only value + emoji, so a label can't drift from its key. On the server, internal/llm/lang.go replaces "Simplified Chinese" in the three prompts that actually name her language. pt-PT is spelled "European Portuguese (pt-PT, never Brazilian Portuguese)" in the prompt itself, and each Lang carries her word for "why" so the tutor prompt still recognises the question when she asks it her way. pair_lang reaches the model through the row-scoped query each handler already ran — the one that proves she owns the document — rather than a second lookup that could disagree with it. Also records Phase 18's deploy: migration 0011 rehearsed against a copy of the live VPS database, then applied for real.
This commit is contained in:
@@ -1,10 +1,12 @@
|
||||
import { useState } from 'react'
|
||||
import { usePack } from '../../i18n'
|
||||
|
||||
// UpdateBanner gently floats down from the top when a newer build has been
|
||||
// deployed, inviting a refresh. Mandarin-first copy (north star Note #17), soft
|
||||
// rose styling, and a clear primary action. Dismissable — if she dismisses it,
|
||||
// the next deploy (or reload) will surface a fresh one.
|
||||
export function UpdateBanner() {
|
||||
const t = usePack()
|
||||
const [dismissed, setDismissed] = useState(false)
|
||||
if (dismissed) return null
|
||||
|
||||
@@ -30,7 +32,7 @@ export function UpdateBanner() {
|
||||
className="truncate text-sm font-bold leading-snug"
|
||||
style={{ color: 'var(--color-plum)' }}
|
||||
>
|
||||
有新版本啦
|
||||
{t.update.available}
|
||||
</p>
|
||||
<p className="truncate text-xs leading-snug" style={{ color: 'var(--color-muted)' }}>
|
||||
A new version is ready — refresh to update.
|
||||
@@ -44,13 +46,13 @@ export function UpdateBanner() {
|
||||
onMouseEnter={(e) => (e.currentTarget.style.background = 'var(--color-accent-hover)')}
|
||||
onMouseLeave={(e) => (e.currentTarget.style.background = 'var(--color-accent)')}
|
||||
>
|
||||
刷新 · Refresh
|
||||
{t.update.refresh}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setDismissed(true)}
|
||||
aria-label="稍后再说 · Dismiss"
|
||||
title="稍后再说 · Dismiss"
|
||||
aria-label={t.update.dismiss}
|
||||
title={t.update.dismiss}
|
||||
className="shrink-0 rounded-full px-1.5 text-lg leading-none transition-colors"
|
||||
style={{ color: 'var(--color-muted)' }}
|
||||
onMouseEnter={(e) => (e.currentTarget.style.color = 'var(--color-plum)')}
|
||||
|
||||
Reference in New Issue
Block a user