feat(i18n): add internationalization and localization#92
Merged
Conversation
Implement end-to-end i18n/l10n for the tenant Next.js app and Django REST API so users can work in their preferred language and receive translated API payloads where supported. Frontend: - Restructure routes under app/[locale] for auth and dashboard segments - Add locale JSON catalogs (ar, en, es, fr, rw, sw) and LanguageSwitcher - Wire Next.js middleware and config for locale detection and redirects - Sync tenant default language from the API (tenant-locale-sync) Backend: - Resolve request language (Accept-Language) and apply translatable representation for serializers/views across inventory, sales, procurement, tenants, invitations, reservation, and auth - Add language helpers, localized string serializers, schema/i18n support, translatable read/write mixins, and API middleware Tooling and docs: - Update .env.example, ARCHITECTURE, ENVIRONMENT, TASKS, and frontend README - Add Cursor rules; refresh agent/memory-bank notes where relevant - Add LanguageSwitcher component tests Closes #81 Made-with: Cursor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Extend the localization work with integration-style tests that render pages under the [locale] layout and shared app shell. - Add test-app-shell helper wrapping NextIntlClientProvider and app Providers - Cover root entry redirect, login, register, and dashboard pages - Export clearQueryClientCache from Providers for isolated Vitest cases - Harden vitest.setup with navigation/link mocks as needed for App Router Closes #81 Made-with: Cursor
18b9e0a to
58d7191
Compare
Align the shared Button wrapper with Base UI primitives so composed controls stay valid when using custom elements instead of a native <button>.
- Pass through optional render and nativeButton; when render is set, default nativeButton to false so Next.js Link (and similar) are not forced into button semantics
- Update GRN list "New GRN" action to use Link via render with explicit nativeButton={false}
- Refactor invite dialog trigger to use DialogTrigger render={<Button />} so the trigger remains a single styled control
Closes #81
Made-with: Cursor
- Add home.i18n_sync to merge wagtailcore.Locale into LANGUAGES and WAGTAIL_CONTENT_LANGUAGES at startup (home.apps) and clear translation caches; include Kinyarwanda fallback label where Django lacks it. - Expose public GET /api/v1/... locales list (WagtailLocalesListView) with code, display_name, RTL, and default flags for clients and tooling. - Add sync_frontend_locales management command and locales-config.json export so Next.js routing matches Wagtail; extend seeders (wagtail_locale_seeder, seeder_manager) and document workflow in seeders/README. - Point next-intl routing and api-client at the shared locale source; refine LanguageSwitcher, tenant-locale-sync, layout, and locale JSON files. - Align procurement supplier and sales (customers, dispatches, sales orders) serializers, forms, schemas, types, and pages with API/locale behavior. - Update settings for i18n; adjust Wagtail locale seed migrations. - Add tests for Wagtail locales API, expanded procurement/sales API coverage, and Wagtail locale seeding. Made-with: Cursor
…, API locale Sales / dispatches - Extend SalesService.process_dispatch with issue_available_only for partial issues against available (unreserved) stock; clearer InsufficientStockError messaging; add fulfillment_preview for ordered vs available quantities. - DispatchViewSet: pass issue_available_only on process; add GET fulfillment-preview with product names in the request display locale. - Frontend: fulfillment preview dialog, dispatch list/actions, columns, API hooks and types; expand sales API tests. Account settings - Add settings/profile route and AccountSettingsPage with profile, password, and tenant-context UI; wire updateProfile (PATCH /auth/me/) and related auth types, schemas, hooks, and exports. Localization and shell - Add api-ui-locale Zustand store; sync from tenant-locale-sync; append language to api-client query params for DRF; normalize array/object error detail in API errors. - Internationalize sidebar, breadcrumbs, command search, tenant switcher, user menu, LanguageSwitcher; grow locale JSON catalogs. - Document localization service vs static UI strings in inventory/services/ localization.py. Made-with: Cursor
Expand public/locales JSON for en, fr, sw, rw, es, and ar with namespaced keys (Common, Dashboard, Inventory, Procurement, Sales, Reports, Settings, Auth, Audit, bulk operations, cycle counts, reservations, and related areas) so CI key-tree parity stays aligned. Wire pages, tables, dialogs, charts, badges, and layout chrome (search command, theme toggle) to useTranslations / translation-aware column factories and constants; update Zod schemas and form copy to resolve messages from the active locale. Add frontend/scripts merge and patch utilities (merge-all-locales.mjs, domain-specific merges, payload JSON) and package.json script locale:merge for maintaining merged locale files. Add Vitest locale JSON parity test; adjust login, register-company, and dashboard tests for translated assertions. Extract location-form-schema for inventory location forms; drop obsolete reservation-columns helper after column factory refactor. Refresh docs/TASKS.MD to focus on remaining next-intl work and mark completed checklist items where applicable. Made-with: Cursor
Resolve yarn.lock add/add conflict by regenerating from merged package.json. Made-with: Cursor
…rough an exception Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.
Implement end-to-end i18n/l10n for the tenant Next.js app and Django REST API so users can work in their preferred language and receive translated API payloads where supported.
Frontend:
Backend:
Tooling and docs:
Closes #81