Giter VIP home page Giter VIP logo

Comments (6)

yesmeck avatar yesmeck commented on June 19, 2024 1

这里写的 babel-plugin-intl https://github.com/ant-tool/atool-l10n/blob/bbb9d793d375bc3edfebaaa642135a4fa8a2d29d/src/plugins/summary.js#L28

from intl-example.

jaredleechn avatar jaredleechn commented on June 19, 2024
$ npm run trans

文档没有更新~

from intl-example.

yvanwangl avatar yvanwangl commented on June 19, 2024

我的开发使用的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.

jaredleechn avatar jaredleechn commented on June 19, 2024

summary: no local files find, run webpack with babel-plugin-intl first

需要跑 build 或者 start 运行 webpack,将 babel-plugin-intl 扫描到的待翻译资源收集到 i18n-messages

可以开两个终端,一个一直跑 start,一个跑翻译

from intl-example.

yesmeck avatar yesmeck commented on June 19, 2024

babel-plugin-intl 还是 babel-plugin-react-intl

from intl-example.

jaredleechn avatar jaredleechn commented on June 19, 2024

babel-plugin-react-intl

https://github.com/ant-design/intl-example/blob/master/package.json#L22

from intl-example.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.