Skip to content

feat(i18n): add internationalization and localization#92

Merged
Ndevu12 merged 8 commits intomainfrom
feat/localization-81
Mar 24, 2026
Merged

feat(i18n): add internationalization and localization#92
Ndevu12 merged 8 commits intomainfrom
feat/localization-81

Conversation

@Ndevu12
Copy link
Copy Markdown
Owner

@Ndevu12 Ndevu12 commented Mar 24, 2026

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

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
@Ndevu12 Ndevu12 self-assigned this Mar 24, 2026
@Ndevu12 Ndevu12 added the enhancement New feature or request label Mar 24, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
the-inventory Ready Ready Preview, Comment Mar 24, 2026 4:17pm
the-inventory-ui Ready Ready Preview, Comment Mar 24, 2026 4:17pm

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
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>
@Ndevu12 Ndevu12 merged commit 78bb0b8 into main Mar 24, 2026
6 of 9 checks passed
@Ndevu12 Ndevu12 deleted the feat/localization-81 branch March 24, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: localization

2 participants