Repository navigation
i18n: wire the Insights page to next-intl - #518
Conversation
gkhngyk
left a comment
There was a problem hiding this comment.
The mentions / citations wirings are exactly right, and the narrow scope is fine — #439 explicitly says keys that don't match live text are a follow-up. But three of the wirings compose translated fragments with hardcoded English, which breaks the moment a real locale lands:
{t('runPrompts')} Now— renders half-translated (" Now").${t('positive')} ${t('sentiment')}—positive/neutral/negativeare sentiment value labels; word-by-word composition doesn't survive other languages' word order.Share of Voice by {t('platform')}— same hardcoded-prefix + translated-suffix hybrid.
These look wired but would ship half-English sentences to any future locale — worse than staying hardcoded, because a translator will assume they're done.
Either is fine with me:
- (a) Leave those three strings hardcoded — the existing keys don't actually match them, and #439 scopes unmatched text as follow-up; or
- (b) Add three proper keys (
runPromptsNow,positiveSentiment,sovByPlatform) and wire them whole — a three-line addition that stays within scope.
Happy to re-review right away.
|
@gkhngyk Please review it now. |
|
The three composed strings are exactly right now — thanks! One last step: the branch conflicts with just-merged #512 in |
6d3d421 to
df21e60
Compare
Summary
The Insights page (
web/src/app/[locale]/(dashboard)/dashboard/insights/page.tsx) never wired theinsightsnext-intl namespace that already exists inen.json(~14 keys), despite the page rendering hardcoded English. This wires the keys that actually correspond to live text on the page today:title(already partially wired),runPrompts(the empty-state "Run Prompts Now" button),mentionsandcitations(KPI card titles),positive+sentimentcomposed together (the "Positive Sentiment" KPI card title), andplatform(the "Share of Voice by Platform" card title). The remaining keys (description,promptResults,score,neutral,negative) don't match any text currently rendered on this page — per the issue's scope note, adding new keys for uncovered text is a follow-up, not part of this PR. No behavior change; English renders identically to today.Related issue
Closes #439
Type of change
fix— Bug fixChecklist
feature/,fix/,chore/,docs/) — see CONTRIBUTING.mdyarn lintpasses (run fromweb/)yarn typecheckpasses (run fromweb/)yarn format:checkpasses (run fromweb/)