- Home
- Forum
- React - EJ 2
- Globalization documentation from Schedule component is insufficient
Globalization documentation from Schedule component is insufficient
Hi all!
So, what I'm trying to do is to translate all texts in my schedule component to spanish, so i've looked into the documentation and try to replicate in my app, step by step, but there are something that I'm missing becouse i'm getting this error:
TypeError: can't convert undefined to object
So, these are the steps i've followed:
- Install the cldr-data package:
npm install cldr-data --save - Create custom JSON files to store cldr translations.
- Create custom file where store the cldr and L18n initializations.
- From the file which I have my <ScheduleComponent /> (Not app.tsx), i've imported and executed this method
- And finally, I've added the locale="es" prop to my <ScheduleComponent />.
import { loadCldr, L10n } from '@syncfusion/ej2-base';
import * as numbers from './numbers.json';
import * as gregorian from './ca-gregorian.json';
import * as timeZoneNames from './timeZoneNames.json';
export const loadL10n = () => {
loadCldr(gregorian, numbers, timeZoneNames);
L10n.load({
es: {...}
})
}
import { loadL10n } from './locale';
loadL10n();
The unique thing I see that I haven't follow as the documentation is the system-plugin-json package installation and usage, becouse I've created my custom JSON files so i'm not importing them as the documentation.
I've followed too this StackBlitz demo, but it doesn't work for me either. Also, currently I have installed @syncfusion/[email protected]
and
@syncfusion/[email protected]
Thanks in advance
SIGN IN To post a reply.
3 Replies
1 reply marked as answer
VD
Vinitha Devi Murugan
Syncfusion Team
August 11, 2021 12:00 PM UTC
Hi Sergio,
Greetings from Syncfusion Support.
We have validated your reported problem “TypeError: can't convert undefined to object and tried to replicate it at our end by preparing sample with your shared UG steps with latest version. But unfortunately, we are unable to replicate it. Globalization working fine at our end. We suspect that in your sample culture files not loaded from proper location which may cause reported issue. We have shared the working sample for your reference.
Sample: https://www.syncfusion.com/downloads/support/forum/167995/ze/Scheduler-globalization-sample606807267
Kindly try the above sample, If you still face the problem at your end, please replicate the issue in above sample or share code snippets and culture files used at your end which would help us to provide the solution at earliest.
Regards,
Vinitha
Marked as answer
SE
Sergio
August 11, 2021 02:01 PM UTC
Hi Vinitha!
So this works perfectly, thanks a lot :)
I think my problem was, as you said, to load manually the culture and location files, but i'm using now the official packages and works as expected.
NR
Nevitha Ravi
Syncfusion Team
August 12, 2021 04:05 AM UTC
Hi Sergio,
You are most welcome..! please get back to us if you need any further assistance.
Regards,
Nevitha
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
- Marked answer
-
SE Sergio
- Aug 10, 2021 03:30 PM UTC
- Aug 12, 2021 04:05 AM UTC