ej.culture error in production mode

Hi,

I want to get the month labels translated to different languages (for example to spanish) in my gantt, so I import them in my app.module.ts:

import "syncfusion-ej-global/i18n/ej.culture.es-ES.min.js";

In my component.html I define the locale property:

[locale]="lang"

And in component.ts I assign "es-ES" language to lang:

this.lang = "es-ES";

In development mode (ng serve --open), it works great, but if I build it in production mode (ng build --prod), when executing I get this error.

Uncaught ReferenceError: ej is not defined at Object.t+P1 (main.71ff5dc.js:1) at p (runtime.6afe301.js:1) at Object.zUnb (main.71ff5dc.js:1) at p (runtime.6afe301.js:1) at Object.3 (main.71ff5dc.js:1) at p (runtime.6afe301.js:1) at n (runtime.6afe301.js:1) at Array.e [as push] (runtime.6afe301.js:1) at main.71ff5dc.js:1

Any idea why?

Thanks.

3 Replies

JR John Rajaram Syncfusion Team October 10, 2018 11:06 AM UTC

Hi Oscar, 
Thank you for contacting Syncfusion support. 
We have checked for the reported issues with our Gantt sample in Angular production mode. But we are unable to reproduce the reported issue. We have also enabled the localization support and prepared the sample for your reference. We request you to revert us by modifying the sample based on your application along with the replication procedure. This would be helpful for us to serve you better. 
Please find the sample link below 
Regards, 
John R 



OB oscar bartolome October 11, 2018 12:58 PM UTC

Hi,

I've tried importing the culture file in component.ts file (where the gantt is) instead of importing it in app.module.ts file and now it works.

Thanks


JR John Rajaram Syncfusion Team October 12, 2018 09:28 AM UTC

Hi Oscar, 
We are glad that your issue has been resolved. Please let us know if you require any other assistance. 
Regards, 
John R 


Loader.
Up arrow icon