Skip to content

feat: i18n EN/ES support + transaction simulation preview#178

Open
pugsleyonesimus-dev wants to merge 1 commit into
OpenLedger-Foundation:mainfrom
pugsleyonesimus-dev:feat/i18n-tx-simulation
Open

feat: i18n EN/ES support + transaction simulation preview#178
pugsleyonesimus-dev wants to merge 1 commit into
OpenLedger-Foundation:mainfrom
pugsleyonesimus-dev:feat/i18n-tx-simulation

Conversation

@pugsleyonesimus-dev
Copy link
Copy Markdown

closes #161
closes #160

Summary

Implements two features in a single PR.


Closes #113 — Internationalization (EN/ES)

  • Installed next-intl@3.22.0, wired withNextIntl plugin in next.config.js
  • Added messages/en.json and messages/es.json with 400+ translation keys covering all UI strings, error messages, toast notifications, and form labels
  • Added i18n/ module: config.ts, locale.ts (browser Accept-Language detection + localStorage persistence), request.ts (App Router server config), LocaleProvider.tsx (client context, hydration-safe)
  • Added LanguageSwitcher dropdown in the Navbar — globe icon, persists selection to localStorage
  • Updated middleware.ts to detect locale from Accept-Language header and set kora-locale cookie on first visit, fallback to English
  • Translated all hardcoded strings: Navbar, WalletButton, WalletConnectModal, RepaymentDialog, CancelInvoiceDialog, ConnectWalletGuard, NetworkStatusIndicator, and all pages (not-found, error, offline, marketplace, dashboards, create invoice, transactions, analytics)
  • useToast retry/dismiss labels and useTransaction stage messages fully translated

Closes #112 — Transaction Simulation Preview

  • Added SimulationPreview type and parseSimulationPreview() to useTransaction.ts; simulation races against a 10-second timeout
  • Added TxSimulationPreview dialog: shows estimated fee (stroops → XLM → USD), CPU instructions, read/write bytes; blocks Proceed on simulation error; spinner while simulating
  • Added useTxSimulation hook: Promise-based gate, resolves true/false on user action
  • Wired onSimulationPreview into all four transaction flows: fund (marketplace/[id]), mint (invoice/create), repay (dashboard/sme), claim (dashboard/investor)

Other

  • Removed stale next.config.ts duplicate

Closes OpenLedger-Foundation#113 - Internationalization with next-intl
Closes OpenLedger-Foundation#112 - Transaction simulation preview before signing

## i18n (OpenLedger-Foundation#113)
- Install next-intl@3.22.0, wire withNextIntl plugin in next.config.js
- Add messages/en.json and messages/es.json with 400+ keys covering
  all UI strings, error messages, toast notifications, and form labels
- Add i18n/config.ts (locale list, default), i18n/locale.ts (browser
  Accept-Language detection + localStorage persistence),
  i18n/request.ts (server-side App Router config),
  i18n/LocaleProvider.tsx (client context, hydration-safe)
- Add LanguageSwitcher dropdown in Navbar (globe icon, persists to
  localStorage)
- Update middleware.ts to detect locale from Accept-Language header
  and set kora-locale cookie on first visit
- Translate all hardcoded strings: Navbar, WalletButton,
  WalletConnectModal, RepaymentDialog, CancelInvoiceDialog,
  ConnectWalletGuard, NetworkStatusIndicator, all pages
  (not-found, error, offline, marketplace, dashboards, create invoice,
  transactions, analytics)
- Translate useToast retry/dismiss labels and useTransaction stage
  messages (Building, Simulating, Signing, Submitting, Polling)

## Tx Simulation Preview (OpenLedger-Foundation#112)
- Add SimulationPreview type and parseSimulationPreview() to
  useTransaction.ts; race rpc.simulateTransaction against 10s timeout
- Add TxSimulationPreview dialog: shows estimated fee (stroops -> XLM
  -> USD), CPU instructions, read/write bytes; blocks Proceed on
  simulation error; spinner while simulating
- Add useTxSimulation hook: Promise-based gate that opens dialog on
  simulation result and resolves true/false on user action
- Wire onSimulationPreview into all four transaction flows:
  fund (marketplace/[id]), mint (invoice/create), repay (dashboard/sme),
  claim (dashboard/investor)
- Remove stale next.config.ts duplicate
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 31, 2026

@pugsleyonesimus-dev 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

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.

Implement Multi-Language Support (i18n) Implement Soroban Transaction Simulation Preview

1 participant