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.
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: {...}
})
}
- From the file which I have my <ScheduleComponent /> (Not app.tsx), i've imported and executed this method
import { loadL10n } from './locale';
loadL10n();
- And finally, I've added the locale="es" prop to my <ScheduleComponent />.
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.
Thanks in advance