Repository navigation
feat(i18n): prepare internationalization message catalogue and Intl formatting (closes #80) - #115
Open
shobhamerabacha-star wants to merge 1 commit into
Conversation
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.
Summary
Closes #80
Prepares ModelTrace for internationalization by introducing a stable message catalogue architecture, adopting Next.js i18n routing (English-only active locale), replacing ambiguous hand-formatted numbers/currencies/dates with standard
Intlformatters, and length-proofing responsive layouts for text expansion (such as German and Finnish).Key Changes
lib/i18n/):lib/i18n/config.ts: ConfiguredDEFAULT_LOCALE = 'en',SUPPORTED_LOCALES = ['en'], and bidirectional text direction detection (getLocaleDirection) with RTL readiness (Arabic, Hebrew, Persian, Urdu).lib/i18n/messages/en.ts: Structured, canonical message catalogue coveringcommon,home,operators,compliance, anderrors.lib/i18n/index.ts: Type-safe dot-notated lookupt(key, params?)with variable interpolation and resilient fallback.middleware.ts):x-locale,Content-Language, andx-directionheaders.IntlFormatting (lib/i18n/formatters.ts):formatNumber,formatCurrency(USD/EUR/XLM),formatPercent,formatCompactNumber(e.g. 1.2M),formatDate,formatDateTime, andformatTimepreventing financial figure misinterpretations across regions.app/layout.tsx: Configured root<html lang="en" dir="ltr">.app/page.tsx: Wired landing headline, lead, CTAs, stats, and pillars to message catalogue.components/site-footer.tsx: Wired footer text and repository link label to message catalogue.app/operators/components/SettlementsPanel.tsx: Replaced ad-hoc number formatting withformatCompactNumberand localized labels.app/operators/components/QuotasPanel.tsx: Formatted used/limit quotas viaformatNumberandformatPercent.app/operators/components/AttestationsPanel.tsx: Formatted timestamps and token counts viaformatTimeandformatNumber.app/globals.css):overflow-wrap: break-word,hyphens: auto, and flex-wrap wrapping for buttons, pills, cards, and tables ensuring layouts remain stable when strings expand 30-50% in languages like German or Finnish.[dir="rtl"]: bidirectional alignment and spacing foundations.tests/unit/i18n.test.ts):Verification
npm test: 24/24 test files passed, 150/150 tests passing green (100%).npm run lint: 0 ESLint warnings or errors.npm run build(next build): Production build compiled and generated all 21 static pages successfully.