Skip to content

DatePicker: localization #499

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

Closed
EricSch opened this issue Apr 26, 2017 · 9 comments
Closed

DatePicker: localization #499

EricSch opened this issue Apr 26, 2017 · 9 comments

Comments

@EricSch
Copy link

EricSch commented Apr 26, 2017

In en-US it shows the text:
image

In de-CH it doesn't:
image

The project (IntlService, ..) is correctly configured, everything else is translated correctly.
I assume you are using the CLDR packages and not LocalizationService for that?

Thanks

@danielkaradachki
Copy link
Contributor

Seems to be working here. Have you loaded the cldr-data/main/de-CH/dateFields.json data?

@EricSch
Copy link
Author

EricSch commented Apr 26, 2017

No, that was it.
Seems I didn't got the requirements changes 😄, I was still loading only 4 local data files.

@danielkaradachki
Copy link
Contributor

I guess we should throw an error in this case. We will fix this.

We are also considering generating locale files that include all the data that we need. Should simplify the loading unless you are also using the cldr data for some other purpose.

@EricSch
Copy link
Author

EricSch commented Apr 26, 2017

Locale files:
Using generally the cldr data is a smart move. So if you stick to the format, but prebuilding them, this would simply our whole build process. Are you also considering to load configured languages automatically?
We are using the cldr data only for your controls.

@danielkaradachki
Copy link
Contributor

Could you clarify what you mean by "load configured languages automatically"?
I do not think we can dynamically load a locale when requested without including all locales in the bundle.

@tsvetomir
Copy link
Member

This could be solved elegantly by an Angular CLI plugin.
Sadly, the extensibility story there is still up in the air.

@EricSch
Copy link
Author

EricSch commented Apr 26, 2017

And we don't use Angular CLI.
I solved it via a factory provider for the APP_INITIALIZER in app.module.ts. { provide: APP_INITIALIZER, useFactory: AppInitializerFactory.initialize, deps: [UserService], multi: true },
This loads depending of our language (LOCALE_ID, that depends on the browser language), the corresponding cldr data (only one language). Of course we published first all (for us) possible cldr JSON files to our wwwroot folder.

Perhaps including a loader which assumes those files somewhere in the wwwroot or via CDN and the publishing depends on the build process?

@danielkaradachki
Copy link
Contributor

danielkaradachki commented Apr 27, 2017

Thank you for clarifying.

I do not think that assuming a specific path is a good option for a library. Given that loading the required data will be a single line of code with the generated locales, I think that we should leave this to the developers.

@tsvetomir
Copy link
Member

The pre-built locales have been added in v1.1.0 of the @progress/kendo-angular-intl package.
See Load Pre-Built Data for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants