[PR #2371] feat(i18n): comprehensive internationalization improvements #2255

Open
opened 2026-02-26 20:33:06 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/documenso/documenso/pull/2371
Author: @rsalcara
Created: 1/10/2026
Status: 🔄 Open

Base: mainHead: main


📝 Commits (10+)

  • 50e7d26 feat(i18n): comprehensive internationalization improvements
  • 1134e1e feat(i18n): comprehensive internationalization improvements
  • 7f07aaa fix(i18n): resolve merge conflicts and add context to billing translations
  • 8e13db4 fix(i18n): resolve merge conflicts and add context to billing translations
  • 2aeae69 feat(i18n): make language names translatable with context
  • e999d38 feat(i18n): make language names translatable with context
  • 53771a7 Merge branch 'documenso:main' into main
  • f0bfdba Merge branch 'documenso:main' into main
  • e40948d Merge branch 'main' into main
  • 3070860 fix(i18n): add Albanian support and fix pt-PT mapping

📊 Changes

31 files changed (+14825 additions, -182 deletions)

View changed files

📝 apps/remix/app/components/embed/authoring/configure-document-advanced-settings.tsx (+1 -1)
📝 apps/remix/app/components/forms/document-preferences-form.tsx (+6 -4)
📝 apps/remix/app/components/forms/subscription-claim-form.tsx (+27 -0)
📝 apps/remix/app/components/general/app-command-menu.tsx (+5 -5)
📝 apps/remix/app/components/general/envelope-editor/envelope-editor-settings-dialog.tsx (+1 -1)
📝 apps/remix/app/components/general/multiselect-role-combobox.tsx (+30 -13)
📝 apps/remix/app/components/general/webhook-multiselect-combobox.tsx (+7 -7)
📝 apps/remix/app/components/tables/admin-organisations-table.tsx (+1 -1)
📝 apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx (+31 -1)
📝 packages/lib/constants/billing.ts (+6 -4)
📝 packages/lib/constants/i18n.ts (+53 -58)
packages/lib/constants/roles.ts (+8 -0)
📝 packages/lib/server-only/email/get-email-context.ts (+1 -1)
📝 packages/lib/translations/de/web.po (+184 -1)
📝 packages/lib/translations/en/web.po (+184 -0)
📝 packages/lib/translations/es/web.po (+184 -1)
📝 packages/lib/translations/fr/web.po (+183 -0)
📝 packages/lib/translations/it/web.po (+335 -0)
📝 packages/lib/translations/ja/web.po (+183 -0)
📝 packages/lib/translations/ko/web.po (+183 -0)

...and 11 more files

📄 Description

Summary

This PR implements extensive internationalization enhancements across the entire Documenso platform, making it more accessible to non-English users.

New Language Support

  • Added Portuguese (Portugal) - pt-PT: Complete 11,948 string translation with proper European Portuguese terminology
    • utilizador (vs usuário), palavra-passe (vs senha), ficheiro (vs arquivo)
    • equipa (vs equipe), eliminar (vs excluir), guardar (vs salvar)

Previously Untranslated Strings Now Available in ALL Languages

Added 31 new translatable strings that were previously hardcoded in English across all 13 supported languages:

Webhook Events (7 strings)

  • document.created, document.sent, document.opened, document.signed
  • document.completed, document.rejected, document.cancelled

Subscription Features (11 strings)

  • Unlimited documents, Branding, Email domains
  • Embed authoring, Embed signing, Authentication portal
  • White label options, 21 CFR compliance, Legacy envelopes

Document Settings (9 strings)

  • Visibility: Admins only, Everyone, Managers and above
  • Authentication: Require account, passkey, 2FA, password
  • None (Overrides global settings)

Admin Panel (4 strings)

  • Subscription status: Active, Inactive, Past Due
  • User roles: User, Admin

Impact: These strings are now properly translated in de, en, es, fr, it, ja, ko, nl, pl, pt-BR, pt-PT, sq, zh

Additional Translation Improvements

  • Italian (it): +44 missing translations for AI features, pagination, and document management
  • Portuguese Brazil (pt-BR): Additional terminology improvements

i18n Infrastructure Enhancements

  • Refactored language detection system: Added comprehensive browser language mapping for 40+ regional variants with improved fallback logic
  • Enhanced i18n configuration: Refactored to use LanguageMetadata type with comprehensive JSDoc documentation

Component Refactoring for Translation Support

Converted 18+ components from hardcoded strings to Lingui MessageDescriptor:

New Constants Files

  • packages/lib/constants/roles.ts: USER, ADMIN translations
  • Updated billing, document-auth, document-visibility, webhook constants

React/Remix Components

All admin panel, document settings, and webhook components now use proper t() or _() translation wrappers.

Bug Fixes

Email Language Inheritance

  • Issue: Empty language strings were not inheriting from organization/team settings
  • Fix: Added trimming check to enable proper inheritance
  • Impact: Emails now correctly use org/team language when document language is unset

Document Preferences Form

  • Issue: "Inherit from organisation" option appeared at organization level, causing validation errors
  • Fix: Added canInherit condition to only show at team level
  • Impact: Organization-level preferences now save correctly

Translation File Statistics

Language New Strings Total Strings
pt-PT (NEW) 11,948 11,948
pt-BR 75 ~11,900
it 69 (31 + 44 missing) ~11,900
de, en, es, fr, ja, ko, nl, pl, sq, zh 31 each ~11,900 each

Files Changed

31 files: +13,996 insertions, -189 deletions

Testing

  • All TypeScript compilation errors resolved
  • MessageDescriptor properly translated with t() and _() wrappers
  • Language detection tested across multiple browser locales
  • Email language inheritance verified
  • Document preferences form tested at org and team levels

Breaking Changes

None - all changes are additive or fix existing bugs

Migration Notes

  • No database migrations required
  • No environment variable changes needed
  • pt-PT will automatically appear in language selectors after deployment

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/documenso/documenso/pull/2371 **Author:** [@rsalcara](https://github.com/rsalcara) **Created:** 1/10/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `main` --- ### 📝 Commits (10+) - [`50e7d26`](https://github.com/documenso/documenso/commit/50e7d2669a657540f4c5d9bda1c4a204731e3163) feat(i18n): comprehensive internationalization improvements - [`1134e1e`](https://github.com/documenso/documenso/commit/1134e1e86b6bddf959907f93d74f1b5042ed921f) feat(i18n): comprehensive internationalization improvements - [`7f07aaa`](https://github.com/documenso/documenso/commit/7f07aaa390d33c866013ce4e551d5bc61410f8a7) fix(i18n): resolve merge conflicts and add context to billing translations - [`8e13db4`](https://github.com/documenso/documenso/commit/8e13db4f439d9aee7d7e3f899051b1fd9e9cd6ef) fix(i18n): resolve merge conflicts and add context to billing translations - [`2aeae69`](https://github.com/documenso/documenso/commit/2aeae69c6531f0be623df3e8c927e16028a08fd4) feat(i18n): make language names translatable with context - [`e999d38`](https://github.com/documenso/documenso/commit/e999d38f5b695f02f710822be1e7018ee649792b) feat(i18n): make language names translatable with context - [`53771a7`](https://github.com/documenso/documenso/commit/53771a76254a0009517cca2b371eb58cf5ba1cdd) Merge branch 'documenso:main' into main - [`f0bfdba`](https://github.com/documenso/documenso/commit/f0bfdbaeb02d026a300bc04846d7fedbf8ebf67e) Merge branch 'documenso:main' into main - [`e40948d`](https://github.com/documenso/documenso/commit/e40948d19f5606e712e80d44b80d7d03841bbe59) Merge branch 'main' into main - [`3070860`](https://github.com/documenso/documenso/commit/3070860cb6ccefe11e2a843bf167826979e3e72d) fix(i18n): add Albanian support and fix pt-PT mapping ### 📊 Changes **31 files changed** (+14825 additions, -182 deletions) <details> <summary>View changed files</summary> 📝 `apps/remix/app/components/embed/authoring/configure-document-advanced-settings.tsx` (+1 -1) 📝 `apps/remix/app/components/forms/document-preferences-form.tsx` (+6 -4) 📝 `apps/remix/app/components/forms/subscription-claim-form.tsx` (+27 -0) 📝 `apps/remix/app/components/general/app-command-menu.tsx` (+5 -5) 📝 `apps/remix/app/components/general/envelope-editor/envelope-editor-settings-dialog.tsx` (+1 -1) 📝 `apps/remix/app/components/general/multiselect-role-combobox.tsx` (+30 -13) 📝 `apps/remix/app/components/general/webhook-multiselect-combobox.tsx` (+7 -7) 📝 `apps/remix/app/components/tables/admin-organisations-table.tsx` (+1 -1) 📝 `apps/remix/app/routes/_authenticated+/admin+/organisations.$id.tsx` (+31 -1) 📝 `packages/lib/constants/billing.ts` (+6 -4) 📝 `packages/lib/constants/i18n.ts` (+53 -58) ➕ `packages/lib/constants/roles.ts` (+8 -0) 📝 `packages/lib/server-only/email/get-email-context.ts` (+1 -1) 📝 `packages/lib/translations/de/web.po` (+184 -1) 📝 `packages/lib/translations/en/web.po` (+184 -0) 📝 `packages/lib/translations/es/web.po` (+184 -1) 📝 `packages/lib/translations/fr/web.po` (+183 -0) 📝 `packages/lib/translations/it/web.po` (+335 -0) 📝 `packages/lib/translations/ja/web.po` (+183 -0) 📝 `packages/lib/translations/ko/web.po` (+183 -0) _...and 11 more files_ </details> ### 📄 Description ## Summary This PR implements extensive internationalization enhancements across the entire Documenso platform, making it more accessible to non-English users. ## New Language Support - **Added Portuguese (Portugal) - pt-PT**: Complete 11,948 string translation with proper European Portuguese terminology - utilizador (vs usuário), palavra-passe (vs senha), ficheiro (vs arquivo) - equipa (vs equipe), eliminar (vs excluir), guardar (vs salvar) ## Previously Untranslated Strings Now Available in ALL Languages Added **31 new translatable strings** that were previously hardcoded in English across **all 13 supported languages**: ### Webhook Events (7 strings) - document.created, document.sent, document.opened, document.signed - document.completed, document.rejected, document.cancelled ### Subscription Features (11 strings) - Unlimited documents, Branding, Email domains - Embed authoring, Embed signing, Authentication portal - White label options, 21 CFR compliance, Legacy envelopes ### Document Settings (9 strings) - Visibility: Admins only, Everyone, Managers and above - Authentication: Require account, passkey, 2FA, password - None (Overrides global settings) ### Admin Panel (4 strings) - Subscription status: Active, Inactive, Past Due - User roles: User, Admin **Impact:** These strings are now properly translated in de, en, es, fr, it, ja, ko, nl, pl, pt-BR, pt-PT, sq, zh ## Additional Translation Improvements - **Italian (it)**: +44 missing translations for AI features, pagination, and document management - **Portuguese Brazil (pt-BR)**: Additional terminology improvements ## i18n Infrastructure Enhancements - **Refactored language detection system**: Added comprehensive browser language mapping for 40+ regional variants with improved fallback logic - **Enhanced i18n configuration**: Refactored to use LanguageMetadata type with comprehensive JSDoc documentation ## Component Refactoring for Translation Support Converted 18+ components from hardcoded strings to Lingui MessageDescriptor: ### New Constants Files - `packages/lib/constants/roles.ts`: USER, ADMIN translations - Updated billing, document-auth, document-visibility, webhook constants ### React/Remix Components All admin panel, document settings, and webhook components now use proper `t()` or `_()` translation wrappers. ## Bug Fixes ### Email Language Inheritance - **Issue:** Empty language strings were not inheriting from organization/team settings - **Fix:** Added trimming check to enable proper inheritance - **Impact:** Emails now correctly use org/team language when document language is unset ### Document Preferences Form - **Issue:** "Inherit from organisation" option appeared at organization level, causing validation errors - **Fix:** Added `canInherit` condition to only show at team level - **Impact:** Organization-level preferences now save correctly ## Translation File Statistics | Language | New Strings | Total Strings | |----------|-------------|---------------| | pt-PT (NEW) | 11,948 | 11,948 | | pt-BR | 75 | ~11,900 | | it | 69 (31 + 44 missing) | ~11,900 | | de, en, es, fr, ja, ko, nl, pl, sq, zh | 31 each | ~11,900 each | ## Files Changed 31 files: +13,996 insertions, -189 deletions ## Testing - ✅ All TypeScript compilation errors resolved - ✅ MessageDescriptor properly translated with t() and _() wrappers - ✅ Language detection tested across multiple browser locales - ✅ Email language inheritance verified - ✅ Document preferences form tested at org and team levels ## Breaking Changes None - all changes are additive or fix existing bugs ## Migration Notes - No database migrations required - No environment variable changes needed - pt-PT will automatically appear in language selectors after deployment --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/documenso#2255
No description provided.