Comments (6)
这里写的 babel-plugin-intl
https://github.com/ant-tool/atool-l10n/blob/bbb9d793d375bc3edfebaaa642135a4fa8a2d29d/src/plugins/summary.js#L28
from intl-example.
$ npm run trans
文档没有更新~
from intl-example.
我的开发使用的dva,
然后本地配置了l10n.config.js文件,按照文档进行的配置。
package.json配置如下:
{
"name": "antd-intl-example",
"private": true,
"version": "1.0.0",
"entry": {
"en-US": "./src/entry/en-US.js",
"zh-Hans-CN": "./src/entry/zh-Hans-CN.js",
"index": "./src/entry/index.jsx"
},
"dependencies": {
"antd": "1.0.x",
"atool-build": "0.7.x",
"babel-plugin-antd": "0.4.x",
"react": "15.x",
"react-dom": "15.x",
"react-intl": "^2.0.0"
},
"devDependencies": {
"atool-l10n": "^0.1.0",
"babel-cli": "^6.4.0",
"babel-eslint": "^6.0.0",
"babel-plugin-react-intl": "^2.0.0",
"babel-preset-es2015": "~6.6.0",
"babel-preset-react": "~6.5.0",
"babel-preset-stage-0": "~6.5.0",
"dora": "0.3.x",
"dora-plugin-hmr": "0.5.x",
"dora-plugin-livereload": "0.3.x",
"dora-plugin-proxy": "0.6.x",
"dora-plugin-webpack": "0.6.x",
"eslint": "^2.7.0",
"eslint-config-airbnb": "6.x",
"eslint-plugin-react": "4.x",
"glob": "~7.0.3",
"mkdirp": "~0.5.1",
"pre-commit": "1.x",
"rimraf": "^2.5.0"
},
"pre-commit": [
"lint"
],
"scripts": {
"start": "npm run dev",
"dev": "dora -p 8001 --plugins webpack,proxy,hmr,livereload",
"lint": "eslint --ext .js,.jsx src",
"build": "atool-build -o ./dist/${npm_package_name}/${npm_package_version}/",
"trans": "atool-l10n"
}
}
安装atool-l10n之后运行,npm run trans,打出如下log:
$ npm run trans
@ trans E:\stariboss\agent-web\src\main\webapp
atool-l10n
atool-l10n: summary, fetchLocal, metaToResult, youdao, reduce, save
summary: i18n-messages/**/*.json
summary: no local files find, run webpack with babel-plugin-intl first
fetchLocal: no local files need to be processed
metaToResult: no element need to be processed
youdao: no element need to be processed
reduce: no element need to be processed
save task: dest is locales
请问该如何解决呢?感谢
from intl-example.
summary: no local files find, run webpack with babel-plugin-intl first
需要跑 build 或者 start 运行 webpack,将 babel-plugin-intl 扫描到的待翻译资源收集到 i18n-messages
下
可以开两个终端,一个一直跑 start,一个跑翻译
from intl-example.
是 babel-plugin-intl
还是 babel-plugin-react-intl
?
from intl-example.
babel-plugin-react-intl
https://github.com/ant-design/intl-example/blob/master/package.json#L22
from intl-example.
Related Issues (16)
- 优化 HOT 5
- npm run dev 报错 HOT 1
- Can you please provide documentation in English? HOT 3
- 对于 Table 的 dataSource columns,或从服务端拿到的数据一般怎么处理 HOT 2
- 请问能够明确一下自动生成翻译资源文件的方法吗? HOT 2
- Error: Callback must be a function HOT 3
- 翻译语言文件过大 HOT 1
- ant-design的Modal组件无法访问到react-intl的<IntlProvider> / ant-design Modal component does not work with react-intl <IntlProvider> component HOT 2
- notification problem
- 考虑 index.vm 支持 HOT 1
- Action required: Greenkeeper could not be activated 🚨
- question: server rendering HOT 2
- window下执行 npm run build:i18n-messages报错 HOT 7
- import LocaleProvider HOT 2
- 无法自动生产 i18n-messages ,是需要和 atool-build 配合使用才可以吗? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from intl-example.