I've been building frontends for Swiss banks and financial software companies for over ten years. First AngularJS, then Angular, with some React in between. Switzerland has four national languages, so almost every one of these projects had to ship in German, French and English, and often Italian too.
So I've done a lot of Angular i18n. And I've come to a strong opinion: translation keys are built for the translation process, not for the developers who have to live with them.
Every project starts the same way
Someone sets up ngx-translate, creates en.json , and the templates start to look like this:
<h2> {{ 'PORTFOLIO.OVERVIEW.PERFORMANCE_TITLE' | translate }} </h2> <button> {{ 'COMMON.ACTIONS.SAVE' | translate }} </button>
Enter fullscreen mode
Exit fullscreen mode
It feels clean for about two sprints. Then:
Nobody knows whether PORTFOLIO.OVERVIEW.PERFORMANCE_TITLE is still used anywhere, so nobody dares to delete it.…