-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kendo angular 5 - change culture dynamically #1455
Comments
Just fyi: Afaik there's currently no "angular official" was to change culture dynamically. They are working on it: angular/angular#11405. |
Hi @papushe, we are working on a way to change dynamically locale (i18n settings) and it will be available soon. Basically, we will provide a way to change the locale id dynamically using IntlService. Stay tuned for updates. As @cluetjen, mentioned there is no "official" way to change locales dynamically, hence we will provide our own way to do that. |
@papushe, @cluetjen https://www.telerik.com/kendo-angular-ui-develop/components/internationalization/locale-changes/ |
I'll check it out, and will update accordingly! tnx! |
The dynamic globalization is available in official releases of the Kendo UI for Angular. Here is a demo that demonstrates its usage with the DatePicker. https://plnkr.co/edit/y0IGNn539crrjvYRLV3c?p=preview I will close the thread as resolved. |
@ggkrustev does it change also the number formatting dynamically (i.e. numeric-textbox) or just the DatePicker? I tried to change it but it doesn't seems to work. |
@scacchif, I've modified the demo and it seems to work just fine - https://plnkr.co/edit/y0IGNn539crrjvYRLV3c?p=preview |
@ggkrustev thank you for the quick reply, in fact it works. In my application doesn't work because I use a different tipe of 'format' (i.e. '#.##' instead of 'n2'). |
Hi @ggkrustev, really thanks the work of your team in making the i18n feature more complete. 1. Reflect adopted language at lazy-loaded modulesAt my project, I use angular 6 and latest versions of However, my project also uses lazy-load module feature from angular. My language-switching dropdown menu is actually at my root module, while my date-picker (and some other kendo UIs which involves localization) will be put at lazy-loaded modules. FYI, I have tried these ways on importing kendo-modules to my own modules: Would you please advise how I can achieve it? 2. Missing localization on word "TODAY"?? "culture" vs "text"??Further, it seems the button "TODAY" on upper right corner of the calendar popup of date picker is missing localization support, isn't it? I tried switching to some other languages, but it seems the word "TODAY" is not changing. I even cannot find the word "today" from Thanks in advance for your help! |
Hi, The first problem will occur because the root and the child module will not have the same IntlService instance. Currently, all packages that depend on the
I have created a sample that demonstrates this approach. We will consider exposing child modules that do not automatically provide the service or we will document this approach. The component specific messages like |
Thank you very much for your kind help. With your demo and the linked documentation, I can now adopt appropriate culture and fully localize all the texts on Kendo UI components. |
Unfortunately we cannot use the providedIn option yet. It was introduced in Angular 6 and the Kendo packages are still compatible with Angular 4+. |
@danielkaradachki is it possible to set up culture for numbers and dates independent of messages language? |
How can I change culture dynamically in kendo angular 5 app?
datePicker,
timePicker,
grid,
pager
from en (english):
to de (german) :
The text was updated successfully, but these errors were encountered: