Skip to content

Add internationalization (i18n) support across all modules#60

Merged
antosubash merged 4 commits intomainfrom
claude/add-page-localization-JO9VG
Apr 3, 2026
Merged

Add internationalization (i18n) support across all modules#60
antosubash merged 4 commits intomainfrom
claude/add-page-localization-JO9VG

Conversation

@antosubash
Copy link
Copy Markdown
Owner

Summary

This PR introduces comprehensive internationalization (i18n) support across the SimpleModule platform by adding translation keys and English locale files to all modules, along with integration of the useTranslation hook throughout the UI components.

Key Changes

  • Translation Infrastructure: Added Locales/keys.ts files to all modules (Admin, AuditLogs, BackgroundJobs, Dashboard, FeatureFlags, FileStorage, Marketplace, OpenIddict, Orders, PageBuilder, Settings, Tenants, Users) that define typed translation key constants for each module's UI strings.

  • English Locale Files: Created Locales/en.json files for each module containing English translations for all UI strings, supporting parameterized strings (e.g., {count}, {displayName}) and plural forms (e.g., _one, _other).

  • Component Integration: Updated all UI components and pages to use the useTranslation hook from @simplemodule/client/use-translation, replacing hardcoded strings with translation key references. This includes:

    • Admin pages (Users, UsersEdit, UsersCreate, Roles, RolesEdit, RolesCreate)
    • AuditLogs views (Browse, Dashboard, Detail)
    • BackgroundJobs pages (Dashboard, List, Detail, Recurring)
    • Dashboard home page
    • FeatureFlags management
    • FileStorage browse view
    • Marketplace views (Browse, Detail)
    • OpenIddict client pages (Clients, ClientsCreate, ClientsEdit)
    • Orders pages (List, Create, Edit)
    • PageBuilder views (Manage, Editor, Viewer, PagesList)
    • Settings views (AdminSettings, UserSettings, MenuManager)
    • Tenants views (Browse, Manage, Create, Edit, Features)
    • Users account pages (TwoFactorAuthentication, EnableAuthenticator, Disable2fa, GenerateRecoveryCodes, ResetAuthenticator, ShowRecoveryCodes)
  • Project Configuration: Updated all module .csproj files to embed locale JSON files as resources, ensuring translations are packaged with the modules.

  • Code Refactoring: Moved hardcoded strings from component definitions to translation keys, improving maintainability and enabling future language support. Refactored tab definitions and permission group definitions to use translation keys instead of static labels.

Notable Implementation Details

  • Translation keys follow a hierarchical naming convention (e.g., UsersEdit.TabDetails, Roles.DeleteDialog.Title) for better organization and discoverability.
  • Parameterized translations support dynamic content injection (e.g., user names, counts).
  • The implementation maintains backward compatibility while preparing the codebase for multi-language support.
  • All hardcoded UI strings have been systematically replaced with translation key references throughout the application.

https://claude.ai/code/session_01Qeb6VZofPxGMHNEGfskwi9

- Create Locales/en.json with all user-visible strings for each module
- Generate Locales/keys.ts with typed nested constants
- Update all React page components to use useTranslation hook
- Add EmbeddedResource to each module csproj to embed locale JSON

Modules localized: Admin, AuditLogs, BackgroundJobs, Dashboard,
FeatureFlags, FileStorage, Marketplace, OpenIddict, Orders, PageBuilder,
Products, Settings, Tenants, Users
@antosubash antosubash force-pushed the claude/add-page-localization-JO9VG branch from 4bbc7ec to fd22ba7 Compare April 3, 2026 07:55
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 3, 2026

Deploying simplemodule-website with  Cloudflare Pages  Cloudflare Pages

Latest commit: f30971b
Status: ✅  Deploy successful!
Preview URL: https://2d836fa3.simplemodule-website.pages.dev
Branch Preview URL: https://claude-add-page-localization.simplemodule-website.pages.dev

View logs

@antosubash antosubash merged commit 9218a37 into main Apr 3, 2026
4 checks passed
@antosubash antosubash deleted the claude/add-page-localization-JO9VG branch April 3, 2026 08:08
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.

1 participant