In my application it is possible to change the language without reloading the page.
So, when the user change the language, I need to update the locale of the DevExtreme widgets (for example the months label in the calendar widget).
In the documentation I found methods like the following:
Globalize.locale(navigator.language || navigator.browserLanguage);
DevExpress.localization.locale(navigator.language || navigator.browserLanguage);
But I can't import Globalize
nor DexExpress
in my component.
Is there an other way?
Thanks a lot
Here is what I did to localize my devextreme components: In
app.module
right in the import statements:And then before declaring the module, setting the locale like this:
You could try to call this at runtime, but I have doubts that it will update the locale in the components automatically.