DCloud_heavensoft
DCloud_heavensoft
  • 发布:2019-04-24 03:25
  • 更新:2023-12-28 14:37
  • 阅读:57751

uni-app国际化/多语言指南

分类:uni-app
2 关注 分享
4***@qq.com 2***@qq.com

要回复文章请先登录注册

8***@qq.com

8***@qq.com

回复 1***@163.com :
请问下,怎么解决的~
2020-07-14 11:58
蒋雨洋

蒋雨洋

回复 1***@163.com :
怎么解决的 我也出现了这个问题
2020-07-09 16:03
1***@163.com

1***@163.com

回复 DCloud_heavensoft :
已经找到解决方案了,真机运行的包,不是小程序,谢谢哈
2020-07-01 21:26
DCloud_heavensoft

DCloud_heavensoft (作者)

回复 1***@163.com :
你说的移动端是app还是小程序,可能使用了dom、window等仅浏览器支持的api
2020-07-01 20:57
1***@163.com

1***@163.com

pc端国际化没问题,但是在移动端运行的时候就报错了,报错代码如下:
[Vue warn]: Error in render: "TypeError: undefined is not an object (evaluating 'i18n._t')"
20:42:19.424 (found at pages/index/index.vue:1)
20:42:19.441 TypeError: undefined is not an object (evaluating 'i18n._t')
20:42:19.474 cid unmatched at view.umd.min.js:1
20:42:19.491 TypeError: Invalid attempt to destructure non-iterable instance.
20:42:19.524 In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1
20:42:19.541 cid unmatched at view.umd.min.js:1
20:42:19.574 TypeError: Invalid attempt to destructure non-iterable instance.
20:42:19.591 In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1
20:42:19.609 cid unmatched at view.umd.min.js:1
20:42:19.631 TypeError: Invalid attempt to destructure non-iterable instance.
20:42:19.657 In order to be iterable, non-array objects must have a [Symbol.iterator]() method. at view.umd.min.js:1
20:42:20.382 [Vue warn]: Error in render: "TypeError: undefined is not an object (evaluating 'i18n._t')"
20:42:20.431 (found at pages/index/index.vue:1)
20:42:20.454 TypeError: undefined is not an object (evaluating 'i18n._t')


请问有解决方案吗?
2020-07-01 20:47
AlertZMK

AlertZMK

内置组件uni-ui还没实现国际化吧?
2020-06-17 10:27
b***@benzii.com

b***@benzii.com

回复 b***@benzii.com :
补充:我最终发现是用了midButton,循环调用uni.setTabBarItem的次数包括了midButton在内。。抱歉
2020-05-23 15:50
b***@benzii.com

b***@benzii.com

"底部tabbar,用uni.setTabBarItem的api动态设置文字;"
-----------
在App.vue中调用这个api,需要延时调用,否则无效;另外iOS经常遇到应用卡死,自动退出,注释这部分代码正常。
2020-05-23 15:37
叫本王宝宝

叫本王宝宝

应用启动后,在第一个展示的tabbar item 页面中对tabbar 的文字使用uni.setTabBarItem进行了修改,有明显的文字变化的过程,有办法改进嘛,或者能否在 tabbar 还没显示的时候,调用 uni.setTabBarItem?
2020-04-09 14:01
DCloud_App_Array

DCloud_App_Array

回复 damdmen :
可以先用5+ API弹出actionsheet,不显示取消按钮,示例如下:
```
plus.nativeUI.actionSheet({title:"Title text",buttons:[{title:"选项1"},{title:"选项2"}]},function(e){
console.log("User pressed: "+e.index);
});
```
详细规范参考:https://www.html5plus.org/doc/zh_cn/nativeui.html#plus.nativeUI.actionSheet
uni接口后续会补充支持国际化。
2020-04-01 20:03