diff --git a/README.md b/README.md index dc4cb5a..832f4ba 100644 --- a/README.md +++ b/README.md @@ -49,22 +49,68 @@ will Just Work™. ## Installation -TODO: depends on [this feature](https://github.com/jenseng/i18nliner-js/issues/12) ... until then you need some glue code. +### 1. get i18n-js and i18nliner + +Get i18n-js and i18nliner installed [per these instructions](https://github.com/jenseng/i18nliner-js#installation). + +### 2. add react-i18nliner ```bash -npm install i18nliner react-i18nliner --save +npm install react-i18nliner --save ``` And make sure your `.i18nrc` file has: ```json { - "plugins": { - "react-i18nliner": true - } + "plugins": [ + "react-i18nliner" + ] } ``` -TODO: figure out registering w/ runtime extension +This will ensure that when you export strings for translation, all of your +new `translate="yes"` stuff will get picked up. + +### 3. preprocess your all your js files with react-i18nliner + +TODO: webpack / browserify / broccoli / etc + +### 4. add the react-i18nliner runtime extensions to i18n-js + +Assuming you have a cjs-style app, do something like this: + +```js +var I18n = require("./path/to/cjs'd/i18n"); +require("i18nliner/dist/lib/extensions/i18n_js")["default"](I18n); +require("react-i18nliner/extensions/i18n_js")(I18n); +``` + +If you're using AMD/`