feat: i18n EN/ES support + transaction simulation preview#178
Open
pugsleyonesimus-dev wants to merge 1 commit into
Open
feat: i18n EN/ES support + transaction simulation preview#178pugsleyonesimus-dev wants to merge 1 commit into
pugsleyonesimus-dev wants to merge 1 commit into
Conversation
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
|
@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! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #161
closes #160
Summary
Implements two features in a single PR.
Closes #113 — Internationalization (EN/ES)
next-intl@3.22.0, wiredwithNextIntlplugin innext.config.jsmessages/en.jsonandmessages/es.jsonwith 400+ translation keys covering all UI strings, error messages, toast notifications, and form labelsi18n/module:config.ts,locale.ts(browserAccept-Languagedetection +localStoragepersistence),request.ts(App Router server config),LocaleProvider.tsx(client context, hydration-safe)LanguageSwitcherdropdown in the Navbar — globe icon, persists selection tolocalStoragemiddleware.tsto detect locale fromAccept-Languageheader and setkora-localecookie on first visit, fallback to EnglishuseToastretry/dismiss labels anduseTransactionstage messages fully translatedCloses #112 — Transaction Simulation Preview
SimulationPreviewtype andparseSimulationPreview()touseTransaction.ts; simulation races against a 10-second timeoutTxSimulationPreviewdialog: shows estimated fee (stroops → XLM → USD), CPU instructions, read/write bytes; blocks Proceed on simulation error; spinner while simulatinguseTxSimulationhook: Promise-based gate, resolvestrue/falseon user actiononSimulationPreviewinto all four transaction flows: fund (marketplace/[id]), mint (invoice/create), repay (dashboard/sme), claim (dashboard/investor)Other
next.config.tsduplicate