Skip to content

fix(landing): localize the injected supported-rails FAQ and anchor it by id - #2700

Merged
jjramirezn merged 1 commit into
devfrom
fix/localize-rails-faq
Aug 17, 2026
Merged

fix(landing): localize the injected supported-rails FAQ and anchor it by id#2700
jjramirezn merged 1 commit into
devfrom
fix/localize-rails-faq

Conversation

@0xkkonrad

Copy link
Copy Markdown
Contributor

Problem

Two locale bugs in the code-injected "Which networks, tokens and banks…" FAQ on the localized landings (/es-419, /es-ar, /pt-br), both visible on prod today:

  1. withSupportedRails anchored the insert on the English question text (/what is peanut\??/i), so on localized pages the rails FAQ falls to the end of the list instead of slotting after "¿Qué es Peanut?" / "O que é o Peanut?".
  2. The question + answer were English constants, so one English FAQ entry sits inside the otherwise-translated FAQ lists — also emitted into the FAQPage JSON-LD.

Fix

  • Anchor by FAQ id ('1') — the content/landing/{locale}.md files keep FAQ ids aligned across locales by design.
  • Move the question + answer sentence templates into the marketing i18n catalogs (landingSupportedRailsFaqQuestion / landingSupportedRailsFaqAnswer / listJoinAnd), interpolated via the existing t() helper. The fact lists (EVM chains, other chains, fiat rails) still derive from rhino.consts, so the public answer can't drift from what the app supports.
  • Translations follow the register of each catalog (tú for es-419, voseo for es-ar, você for pt-br) and were reviewed by an independent native-speaker pass.

Verification

  • jest src/i18n — 117 tests green (incl. key-parity + placeholder-parity across locales).
  • tsc --noEmit: 231 pre-existing TS2307 module-resolution errors in this worktree (uninitialized src/content submodule / asset stubs), zero in changed files, all-TS2307 histogram identical in kind to untouched base.
  • Prettier: no changes needed.

Notes

  • Overlap: feat(landing): homepage rebuild — persona manifesto, card beat high, /lp/card retired #2690 (homepage rebuild) appends to the same i18n catalogs — no shared code files, whichever lands second has a trivial additive rebase.
  • Known follow-up: FIAT_RAILS region labels ("United States", "36 countries", …) still render in English inside the localized answer and in the client chip UI (SupportedRailsFaqAnswer) — localizing those touches the chip component and is left for a separate small PR.

🤖 Generated with Claude Code

… by id

Two locale bugs in the code-injected rails FAQ on /es-419, /es-ar, /pt-br:
the insert anchored on the English question text (/what is peanut/i), so on
localized pages it fell to the end of the list, and the question/answer were
English constants, leaving one English FAQ inside translated pages (visible
live today, also in the FAQPage JSON-LD).

Anchor by FAQ id instead (content files keep ids aligned across locales) and
move the question + answer sentence templates into the marketing i18n
catalogs; the fact lists (chains, rails) still interpolate from rhino.consts
so the answer can't drift from what the app supports.

Known follow-up: FIAT_RAILS region labels still render in English inside the
localized answer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 17, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
peanut-wallet Ready Ready Preview Aug 17, 2026 1:28pm

Request Review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 127e6240-01ea-4a48-ad79-6f86087b3138

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

Code-analysis diff

Painscore total: 7158.71 → 7159.84 (+1.13)
Findings: 0 net (+3 new, -3 resolved)

🆕 New findings (3)

  • medium complexity — src/lib/landingContent.ts — CC 14, MI 61.32, SLOC 55
  • medium complexity — src/constants/faq.consts.ts — CC 3, MI 56.98, SLOC 48
  • low high-mdd — src/lib/landingContent.ts:65 — readLandingContent: MDD 11.0 (uses across many lines from declarations)

✅ Resolved (3)

  • src/lib/landingContent.ts — CC 14, MI 61.2, SLOC 56
  • src/constants/faq.consts.ts — CC 2, MI 54.74, SLOC 39
  • src/lib/landingContent.ts:71 — readLandingContent: MDD 11.0 (uses across many lines from declarations)

📈 Painscore deltas (top movers)

File Before After Δ
src/constants/faq.consts.ts 5.0 6.0 +1.0

@github-actions

Copy link
Copy Markdown
Contributor

🧪 UI test report — ✅ all green

Suites

  • unit: 3063 ran, 0 failed, 0 skipped, 50.6s

📊 Coverage (unit)

metric %
statements 66.9%
branches 52.0%
functions 57.2%
lines 67.7%
⏱ 10 slowest test cases
time test
3.4s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › never places two stickers in heavy overlap (broad seed sweep)
1.0s src/utils/__tests__/demo-api.test.ts › isDemoMode() is false when not running under Capacitor
0.4s src/app/actions/__tests__/api-headers.test.ts › should include Content-Type in validateInviteCode
0.4s src/utils/__tests__/sentry.utils.test.ts › defaults to the client budget under a browser global
0.3s src/components/Card/share-asset/__tests__/shareAssetLayout.test.ts › every sticker stays within canvas at any count
0.3s src/app/(mobile-ui)/withdraw/__tests__/withdraw-states.test.tsx › Bank withdrawal keeps the $1 minimum for sub-$1 amounts
0.3s src/utils/__tests__/sentry.utils.test.ts › still lets a per-call timeoutMs win over the default
0.3s src/utils/__tests__/auth-token.test.ts › authReady does not park — hydrates the plain token without an unlock
0.3s src/utils/__tests__/auth-token.test.ts › returns the token hydrated from Preferences after authReady
0.2s src/utils/__tests__/auth-token.test.ts › is none — never guarded — when only the guarded marker is present
📍 Inline annotations are in the **Unit test report** check above. Coverage artifact: `coverage-unit`. Generated by `.github/workflows/tests.yml`.

@jjramirezn
jjramirezn merged commit b2001c7 into dev Aug 17, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants