Shipping a client portal in 23 languages: what we learned
ClientsPlace is a client portal for service businesses: proposals, contracts with e-signature, invoices paid online, files and messages. The frontend is Angular, the backend is .NET, and the interface ships in 23 languages, three of them right-to-left (Arabic, Hebrew and Urdu). We didn't plan for 23 languages at the start. The translation README in our repo still describes two, English and…
ClientsPlace is a client portal for service businesses that allows users to create proposals, contracts with e-signature, invoices, files, and messages. The portal's frontend is built using Angular, and the backend is written in .NET. It offers translations in 23 languages, including right-to-left languages like Arabic, Hebrew, and Urdu. The initial plan did not include 23 languages; the translation README in the repository initially described only two languages: English and Arabic.
As the number of languages increased, several changes were implemented to accommodate the translation requirements. Each area of the portal has its own folder, and each folder contains one file per locale. These files are TypeScript modules that export flat key/value maps rather than JSON files. This approach ensures that missing imports or typos in export names will fail the build, preventing runtime errors.
To manage the various locales, the team created a lazy loading system where each non-English locale is loaded as a separate chunk. The English locale is eagerly loaded and kept in memory for faster access. The translation function is synchronous, as an impure pipe calls it on every change-detection cycle. If a locale fails to load (e.g., due to offline access or a stale chunk), the error is handled gracefully, and English remains visible.
The translation lookup process follows a specific order: the workspace owner's wording, the active locale, and finally, the key itself. This fallback chain ensures that users never see raw keys. Additionally, there are tests in place to verify completeness, key count, and runtime parity between eager and lazy loaded modules. These tests help catch any missed keys or changes that may affect the user experience.
While the focus is primarily on translation, the team also ensures that the portal remains accessible to users with different language preferences. Right-to-left languages like Arabic, Hebrew, and Urdu are supported, with a single flag and place to manage the layout. CSS is used to handle the layout accordingly.
Despite thorough testing, there are still potential pitfalls to watch out for. For instance, key tests may not catch translation errors, so additional checks are implemented to verify the translations. A small script is also used to compare values against the English text, looking out for missing or broken encoding issues. This meticulous process helps ensure that the client portal delivers a consistent and error-free user experience across all supported languages.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to