Migrating angular-translate to modern Angular
angular-translate handled translations in AngularJS with JSON files, a translate filter and a directive.
What replaces it
| Option | When to choose it |
|---|---|
| Transloco | Runtime language switching with lazy-loaded translation files; actively maintained. |
| ngx-translate | The most similar API to angular-translate: same pipe and JSON files. |
| Angular built-in i18n | When one build per language is acceptable and you want compile-time translations. |
How to migrate it
- Keep your JSON translation files: Transloco and ngx-translate can read the same structure.
- Load the same files from both frameworks during the hybrid phase so the two sides never show different text.
- Replace the translate filter and directive screen by screen; check interpolation syntax and pluralization.
Watch out. Missing-key behavior differs between libraries. Decide early what a missing translation shows, and add a check in CI for unused and missing keys.
Other libraries
Planning a migration or a micro-frontend platform?
In a 20-minute call you describe your situation and I tell you how I'd approach it. If it isn't worth doing yet, I'll say so.
Message me on LinkedIn