miniprogram-i18n icon indicating copy to clipboard operation
miniprogram-i18n copied to clipboard

小程序国际化方案 / The internationalizational (i18n) library for wechat miniprogram

Results 11 miniprogram-i18n issues
Sort by recently updated
recently updated
newest added

Intl is not defined? - 微信开放社区 https://developers.weixin.qq.com/community/develop/doc/00044a6a7782b8f211df8d36e5e400

我是参照官方示例,编译wxss和i18n文件,但是打包`i18n/locales.js`的路径不是在小程序的根目录下,即不在 `dist/i18n`,而是在分包 `dist/card/i18n`下,导致我运行分包内的页面时抛出以下异常。 ``` [i18n] ensure run initI18n() in app.js before using I18n library ``` 之后需要在初始化的时候,强制调用`initI18n`,并传入实际的`i18n`路径,例如: ``` JavaScript import { initI18n } from '@miniprogram-i18n/core'; // 因i18n文件夹在分包内,不在根目录下,需要手动指定编译后的位置。 initI18n('./i18n/locales.js', ''); ``` 这里有两个建议,一个是官方文档可以给出一些指引,告诉用户,默认是寻找根目录下的`i18n`路径,否则需要调用初始化方法,并指定实际的`i18n`文件夹路径。...

如上字符会被解析成 \x22miniprogram-i18n\x22

{“user”:{"name":"jack"}}这样的语言json文件不支持读取吗 t('user')['name'] or t('user.name')

gulp 监听了语言包文件的修改,但是并不会生成新的 locale.js locale.wxs 文件

![image](https://user-images.githubusercontent.com/8489343/110433679-beb2f080-80eb-11eb-8dee-3b730d7a8ee2.png) 如图所示,当遇到这个英文上角标的时候,构建会直接报错失败,具体失败如下: ![image](https://user-images.githubusercontent.com/8489343/110433763-dbe7bf00-80eb-11eb-9e37-4047d72b4473.png)

> pages/index/miniprogram-i18n/core" is not defined 1. 是云开发模版搭建的故不是 `src` 目录。 2. 默认没有package.json,自行`npm init` 创建了。 3. 安装了开发依赖和依赖。 4. 构建NPM耗时几十毫秒,但是并为生成 `miniprogram_npm` 的目录

![image](https://user-images.githubusercontent.com/27394381/75321286-637cda00-58ab-11ea-8418-abdd82b74bfb.png) {{ i18n.t('nested', { test: 0 }, $_locale) }} {{ i18n.t('nested', { test: 1 }, $_locale) }} 输出 0 == > test