In the previous blog post series, we have seen how to achieve the internationalization support using ngx-translate library. Please read this post if you didn’t read yet. In this blog post, you will see how to achieve it through Angular’s official i18n tools. “Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes”. Angular uses ngx-i18n tools to support internationalization. The process involves four steps.
- Identify the messages: Initially mark the static text messages in your component templates.
- Generate standard translation files: Extracts the marked messages into an industry standard translation source file(XLIFF and XMB formats).
- Translating the messages: Translating the extracted text messages into the target language by Translator tool.
- Complete the translation files: Angular compiler imports the compiled translation files and replace the original text with translation text files. Finally it creates translation files based target language.
The demo example is powered by PrimeNG components and the internationalization support for German and Spanish languages. You can close the Github URL to play with the features.