禁用 Kendo Angular UI 中的本地化

发布于 2025-01-18 07:15:53 字数 304 浏览 0 评论 0原文

我们一直在支持使用Angular 7开发的应用程序的本地化。我们几乎没有使用Kendo Angular UI网格的组件。

我们想始终将英语用于Kendo Angular UI组件。例如,Kendo Grid内部的日期格式试图加载某些地方并引发错误“错误:Nolocale:缺少'语言'的语言环境信息”。

我想通过禁用Kendo Angular UI组件的本地化来解决此错误。我知道我们可以包含Locale软件包来解决此错误,但是到目前为止,我们不想增加软件包的大小。

有没有办法禁用Kendo Angular UI组件的本地化?

谢谢你!

We have been supporting localization for our app developed using Angular 7. We have few components which use Kendo Angular UI grid.

We would like to always use English for the Kendo Angular UI components. E.g. date format inside Kendo grid tries to load some locales and throws error "Error: NoLocale: Missing locale info for 'language'".

I want to fix this error by disabling the localization for Kendo Angular UI components. I know we can include locale packages to fix this error but we don't want to increase the package size as of now.

Is there a way to disable the localization for Kendo Angular UI components?

Thank you!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

能否归途做我良人 2025-01-25 07:15:53

我可以在 app.module.ts 的构造函数中设置 Kendo Angular Controls 的默认区域设置:

constructor(public intlService: IntlService) 
{
   (<CldrIntlService>this.intlService).localeId = "en-US";
}

因此,我不是禁用本地化,而是使用这种方式覆盖应用程序中专门为 Kendo 组件设置的区域设置。

I could set the default locale for Kendo Angular Controls in my app.module.ts's constructor:

constructor(public intlService: IntlService) 
{
   (<CldrIntlService>this.intlService).localeId = "en-US";
}

So rather than disabling localization, using this way I am overriding the locale set in my app specifically for Kendo components.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文