加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

angularjs – 如何翻译Angular-UI-Bootstrap datepicker?

发布时间:2020-12-17 10:22:50 所属栏目:安全 来源:网络整理
导读:datepicker( Angle-UI-BootStrap)的文档报告: Everything is formatted using the 07001 and thus is also localized. 检查date filter的文档可以访问AngularJs的i18n and i10n概念.但是,提供的两种方法不能在我的应用程序中使用.这两种方法是: Pre-bundle
datepicker( Angle-UI-BootStrap)的文档报告:

Everything is formatted using the 07001 and thus is also
localized.

检查date filter的文档可以访问AngularJs的i18n and i10n概念.但是,提供的两种方法不能在我的应用程序中使用.这两种方法是:

  1. Pre-bundled rule sets
  2. Including locale js script in index.html page

在我的应用程序中,我在登录后检查客户端的语言.所以我的index.html页面已经创建并配置好了.

没有其他方法来翻译datepicker?动态方式……比如更改$scope的值,改变执行组件转换的接口的值?

这是一个plunker,展示了在index.html中引入pt-BR翻译的方法.

更新:
我在issue of the Angle-UI-Bootstrap中问了这个问题,这是我从@bekos收到的回复:

@ThCC The real problem is that you cannot change your $locale during
runtime,or at least I don’t know of a way to do this. Even if you
solve the problem with the datepicker,you will still have problem in
every other filter that is locale dependent,like currency. I think it
is better to ask a more general question in the AngularJS issues.

如果有人有另一个解决方案,总是欢迎.如果我得到解决方案,我会回到这里.

有人说[真正的问题是你不能在运行时更改你的$locale].事实上你可以.你可以看到一个工作的plunker here.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读