It is always better to have applications that will have a broader range of audience. Localizing an app gives organizations wider audience with a much lesser cost compared to developing individual app per language. We can have this done as a user profile attribute and be able to deliver the content based off the user profile. For our app, we just added a simple drop down and are setting a client side cookie to hold the preferred language. For now, we added Spanish as the alternate language. I am not good with Spanish. So, for this example, we appended “Esp ” in front of the configuration driven text. There should not be any static text in the code. Everything should be driven off of language files. Also, Starting from Version 9, Angular introduced ngx-translate for translating to other languages. We stayed off of it for this exercise. But, it looks promising and will try it out sooner. Here is an article about ngx-translate https://www.techiediaries.com/angular/angular-9-internationalization-ngx-translate-tutorial-example/
Here is a snapshot of our app after adding localization functionality.
At BundleN, we experiment with stack combinations on our own time.
For potential clients interested in this stack, we can always give a demo of what we have up until that point of time. You can reach us at sales@BundleN.com
For more details on this stack, click here
Here is the latest about our Angular + Java project.
Backend API for Localization
Add End points to retrieve language specific configurations.
Localized Content in Frontend
Setup a localization value Cookie when user switches the language dropdown. Based off the cookie value, get the localized static content from the backend.
Pub Sub Vs Observer
Let us take a dig at Pub Sub Design Pattern Vs Observer Pattern and have a use case for each of them.