diff --git a/README.md b/README.md index 1b883d0..b9d95a3 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ ██║ ██║ ██║███████╗██║ ██║╚██████╗ ██║ ██║ ██║ ╚████║███████╗██║██║ ╚████║███████╗ ╚═╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═══╝╚══════╝╚═╝╚═╝ ╚═══╝╚══════╝ - KEEP YOUR TRANSLATIONS IN LINE - WITH PREACT! + keep your translations in line - with preact! ``` preact-i18nline brings [I18nline](https://github.com/download/i18nline) @@ -133,12 +133,12 @@ within a translated element. ## Installation ```sh -npm install -S i18n-js i18nline preact-i18nline +npm install -S i18nline preact-i18nline ``` ## Configuration -In your `package.json`, create an object named `"i18nline"` and +In your `package.json`, create an object named `"i18n"` and specify your project's global configuration settings there. Or, if you prefer, you can create a `.i18nrc` options file in the root of your project. @@ -206,37 +206,63 @@ you use ember-cli, sprockets, grunt concat, etc., it's relatively painless to add a little glue code that runs preprocess on each source file. -### 4. add the preact-i18nline runtime extensions to i18n-js +## Add the preact-i18nline runtime extensions to i18n -Assuming you have a cjs-style app, do something like this: +Both i18nline and preact-i18nline add some extensions to i18n.js to +help with the runtime processing of the translations. You can require +I18n via preact-i18nline to get a `I18n` object that has all extensions +applied already: ```js -var I18n = require("./path/to/cjs'd/i18n"); -require("i18nline/dist/lib/extensions/i18n_js")(I18n); -require("preact-i18nline/dist/extensions/i18n_js")(I18n); +var I18n = require("preact-i18nline/i18n"); ``` -If you're using AMD/`