Skip to main content

Posts

Showing posts from November, 2021

Angular 12+ multi language

 I wrote a similar post that works for Angular 8, 9, 10, 11. Click here for the previous post. In Angular 12+ the config seems to be a bit different. 1. Create an angular web project. we will start by creating a project with minimal setup to demonstrate. To create an angular app, in command prompt type: ng new multiLanguageApp Open "app.component.html" delete the default code and paste this code: < div >    < a   href = "/" > de </ a > &nbsp;    < a   href = "/en" > en </ a > </ div > < div > Danke! </ div > Run "ng serve" to serve your app. Go to localhost:4200 you should see: I am creating an app with German as the default language and English as the second language. "Danke" is a word in German means "Thank you". When we click "de" or "en" in the UI to switch language, we expect this word to change respectively. 2. Set up i18n and translate. In the tag...