- Home
- Forum
- JavaScript - EJ 2
- How to get Spanish locale in Angular 2
How to get Spanish locale in Angular 2
Hi.
I would like translate all components to Spanish. I'm trying whith setCulture('es') or setCulture('es-ES') but does not work. And when I call those functions, datepicker does not work, this is the error (without setCulture works fine, but show all data in US culture):
ERROR TypeError: Cannot convert undefined or null to object
at Function.keys ()
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.getCultureValues (calendar.js:250)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.contentHdr (calendar.js:277)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.content (calendar.js:238)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.render (calendar.js:129)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/datepicker/datepicker.js.DatePicker.show (datepicker.js:505)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/datepicker/datepicker.js.DatePicker.dateIconHandler (datepicker.js:228)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
Thank you.
I would like translate all components to Spanish. I'm trying whith setCulture('es') or setCulture('es-ES') but does not work. And when I call those functions, datepicker does not work, this is the error (without setCulture works fine, but show all data in US culture):
ERROR TypeError: Cannot convert undefined or null to object
at Function.keys (
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.getCultureValues (calendar.js:250)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.contentHdr (calendar.js:277)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.content (calendar.js:238)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/calendar/calendar.js.Calendar.render (calendar.js:129)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/datepicker/datepicker.js.DatePicker.show (datepicker.js:505)
at DatePickerComponent.webpackJsonp.../../../../@syncfusion/ej2-calendars/dist/es6/datepicker/datepicker.js.DatePicker.dateIconHandler (datepicker.js:228)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:425)
at Object.onInvokeTask (core.es5.js:3881)
at ZoneDelegate.webpackJsonp.../../../../zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:424)
Thank you.
SIGN IN To post a reply.
4 Replies
LL
Luis Lora
December 12, 2017 05:25 AM UTC
I read in this thread there is only support for en-US
https://www.syncfusion.com/forums/134779/internationalization-setting
Where can I find all strings to translate?
Thank you
https://www.syncfusion.com/forums/134779/internationalization-setting
Where can I find all strings to translate?
Thank you
BC
Berly Christopher
Syncfusion Team
December 12, 2017 01:40 PM UTC
Hi Luis,
Thanks for contacting Syncfusion support.
We have looked into your query “I'm trying whith setCulture('es') or setCulture('es-ES') but does not work” and suspect that this issue may be caused due to “es-ES” locale scripts are not loaded correctly in your application. So, we suggest you to ensure all locale scripts are referred and loaded correctly in your application.
For your convenience, we have prepared the sample based on your requirement. Please get the sample from the below location.
Sample Link: http://www.syncfusion.com/downloads/support/forum/134994/ze/ej2-angular-setCulture-master-1883649679
To know more about Globalization in DatePicker component please refer the below UG Documentation link.
UG Link: http://ej2.syncfusion.com/15.4.17/documentation/datepicker/globalization.html?lang=typescript
Regards,
Berly B.C
LL
Luis Lora
December 12, 2017 04:47 PM UTC
Hi Berly.
Thank you very much. That was the key:
I didn't load scripts. Now works fine :)
Regards.
Thank you very much. That was the key:
loadCldr(
require('../../node_modules/cldr-data/supplemental/numberingSystems.json'),
require('../../node_modules/cldr-data/main/es/ca-gregorian.json'),
require('../../node_modules/cldr-data/main/es/currencies.json'),
require('../../node_modules/cldr-data/main/es/numbers.json'),
require('../../node_modules/cldr-data/main/es/timeZoneNames.json')
);
I didn't load scripts. Now works fine :)
Regards.
BC
Berly Christopher
Syncfusion Team
December 13, 2017 10:21 AM UTC
Hi Luis,
Thanks for the update.
We are glad to hear that the reported issue is resolved at your end. Please, let us know if you need any further assistance. We will be happy to help you.
Regards,
Berly B.C
SIGN IN To post a reply.
- 4 Replies
- 2 Participants
-
LL Luis Lora
- Dec 11, 2017 01:29 PM UTC
- Dec 13, 2017 10:21 AM UTC