Hi Alex! Yes I just meant to share this with you. It's usually a breeze when following your upgrade guides but for this one I had to scratch my head quite a bit.
Support Forum
What I mean is that if I follow the upgrade guide:
LocaleManager.extendLocale has been deprecated. LocaleManager.applyLocale should be used instead.
Old Code:
LocaleManager.extendLocale('Es', {
desc : 'Spanish', locale : {
locale : {
/* localization */
}
}
});
New code:
LocaleManager.applyLocale({
localeName : 'Es',
localeDesc : 'Spanish',
localeCode : 'es',
/* localization */
});
My code was:
LocaleManager.extendLocale('En', myLocale);
So I tried to adapt what the guide said and came up with this:
LocaleManager.applyLocale({
localeName : 'En',
localeDesc : 'English (US)',
localeCode : 'en-US',
myLocale
});
But that didn't work. This did not either:
LocaleManager.applyLocale({
localeName : 'En',
myLocale
});
This did the trick:
LocaleManager.applyLocale('En', myLocale);
Thanks for clarifying, I see the problem now!
I've opened a ticket to fix this right away https://github.com/bryntum/support/issues/7941
Thanks for your time!
All the best,
Alex
Hi Jerther,
I have checked the ticket and issue. The new code
mentioned in the upgrade guide https://bryntum.com/products/gantt/docs/guide/Gantt/upgrades/5.3.0 works. The issue was with your code. You were using:
LocaleManager.applyLocale({
localeName : 'En',
localeDesc : 'English (US)',
localeCode : 'en-US',
myLocale
});
The above code resulted in the nameOfConfig
parameter in applyLocale
method to:
nameOrConfig ={
localeName : 'En',
localeDesc : 'English (US)',
localeCode : 'en-US',
myLocale : myLocale
}
But our implementation expects the nameOrConfig parameter
in applyLocale
to be in the following manner:
nameOrConfig ={
localeName : 'En',
localeDesc : 'English (US)',
localeCode : 'en-US',
locale : myLocale
}
More specifically it expects locale key in the config object that in your case was missing. Changing the your code to below worked:
LocaleManager.applyLocale({
localeName : 'En',
localeDesc : 'English (US)',
localeCode : 'en-US',
locale: myLocale
});
And similarly this will also works:
LocaleManager.applyLocale({
localeName : 'En',
locale : myLocale
});
Regards,
Ghous