Skip to content

feat(i18n): internationalize hardcoded strings in NewCauseClient - #1019

Open
abimbolaalabi wants to merge 7 commits into
Iris-IV:mainfrom
abimbolaalabi:fix/issue-586-i18n-new-cause-client
Open

feat(i18n): internationalize hardcoded strings in NewCauseClient#1019
abimbolaalabi wants to merge 7 commits into
Iris-IV:mainfrom
abimbolaalabi:fix/issue-586-i18n-new-cause-client

Conversation

@abimbolaalabi

Copy link
Copy Markdown

Overview

This PR internationalizes the remaining hardcoded English strings in the Create Campaign form (NewCauseClient.tsx): the description editor Write / Preview tabs, the empty-preview state, the revenue-share Exact bps input and its / 10 000 denominator, and the Cover Image URL (optional) label. These previously rendered in English even for /es users.

Related Issue

Closes #586

Changes

🏷️ Internationalization (i18n)

  • [MODIFY] src/app/[locale]/causes/new/NewCauseClient.tsx
    • Replace Write, Preview, Nothing to preview, Exact bps:, / 10 000, Cover Image URL, and (optional) with t('key') calls.
  • [MODIFY] messages/en.json
    • Add tabWrite, tabPreview, nothingToPreview, labelExactBps, revenueShareBpsDenominator, labelCoverImageUrl, and optional keys under the CreateCampaign namespace.
  • [MODIFY] messages/es.json
    • Add Spanish translations for the new keys ("Escribir", "Vista previa", "Nada que previsualizar", "Puntos base exactos:", "/ 10.000", "URL de la Imagen de Portada", "(opcional)").

Verification Results

npm run i18n:check
✅ Passes — no missing keys; all new keys are used in code and present in both en/es

npm run lint -- src/app/[locale]/causes/new/NewCauseClient.tsx
✅ 0 errors

npx tsc --noEmit
✅ No errors in NewCauseClient.tsx
Acceptance Criteria Status
'Write' / 'Preview' tabs localized t("tabWrite") / t("tabPreview")
'Nothing to preview' empty state localized t("nothingToPreview")
'Exact bps:' / '/ 10 000' localized t("labelExactBps") / t("revenueShareBpsDenominator")
'Cover Image URL (optional)' localized t("labelCoverImageUrl") + t("optional")

Add translation keys to messages/en.json and messages/es.json for the
Write/Preview tabs, empty-preview state, exact bps label and denominator,
and the Cover Image URL (optional) label, replacing hardcoded English
strings with t() calls so /es users see localized text.

Closes Iris-IV#586
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@abimbolaalabi Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@sshdopey

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

1 similar comment
@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

Comment thread scripts/check-i18n.mjs
const parts = fullKey.split(".");
const key = parts[parts.length - 1];
const namespace = parts.length > 1 ? parts[0] : '';
const namespace = parts.length > 1 ? parts[0] : "";
…etailClient

Jest cannot transform react-markdown because next/jest's default
transformIgnorePatterns match node_modules before the ESM whitelist, which made
AppPageComponents fail to run. Render the description via SafeMarkdown (mocked
in tests) instead, and remove the duplicated h1/CampaignDescription block left
by the botched merge of PR 771.
…Client

Applies prettier (--write) to files left unformatted by the botched PR 771
merge, plus the t() spans added by this PR's i18n work, so the CI Prettier
format check passes.
@abimbolaalabi
abimbolaalabi force-pushed the fix/issue-586-i18n-new-cause-client branch from 4ec2cc0 to 4ce4a01 Compare August 1, 2026 10:43
@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

NotificationBell and NotificationSettings render on every page and call the
Notifications namespace, which was lost in the 771 merge. Without it,
next-intl throws MISSING_MESSAGE on page load and breaks the Playwright
E2E connect-wallet journey. Restore the namespace for en and es using
the key shapes the current components rely on.
@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

The dashboard renders an h1 alongside body, so the .or() locator
resolves to two elements and strict mode rejects it. Use .first() to
take the first match, matching the maintainer fix in PR 1020.
@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

The CI test set was at 49.22% branch coverage, just under the 50%
threshold in jest.config.ts. Add tests for the cover image and category
icon fallback, the save button wallet guard, and async action error
paths, mirroring the maintainer coverage in PR 1020. Raises the CI set
to 50.6% branches.
@sshdopey

sshdopey commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

Auto-review failed (API error). Leaving PR for human review.

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.

[Feature] Internationalize hardcoded English strings in NewCauseClient — 'Write', 'Preview', 'Exact bps:', 'Cover Image URL'

3 participants