Skip to content

Commit

Permalink
Now on npm
Browse files Browse the repository at this point in the history
  • Loading branch information
adamduncan committed May 27, 2020
1 parent 01dc34a commit 0eb98d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ What's in the box? A contextually-aware `i18n` filter, with smarts and dynamic s

## Install

Soon to be available on npm. (As soon as they decide the package name isn't a spam grab)
Available on [npm](https://www.npmjs.com/package/eleventy-plugin-i18n).

```
npm install eleventy-plugin-i18n --save
Expand Down Expand Up @@ -94,7 +94,7 @@ Type: `Object` | Default: `{}`

Schema: `{ [key]: { [locale]: 'String' } }`

This object contains our dictionary of translations for each respective language. It _can_ be declared inline within the plugin options (as above), but it might be nicer to lift it out into its own JS module to keep things tidy:
This object contains our dictionary of translations for each respective language. It _can_ be declared inline within the plugin options (as above), but it might be nicer to lift it out into its own JS module to keep things tidy as it grows:

```js
// .eleventy.js
Expand Down Expand Up @@ -123,7 +123,7 @@ module.exports = {

You might choose to break translations out into their own individual `en-GB.js` and `es-ES.js` data files, then import and merge them into a single `translations` object for the plugin. As long as our `translation` schema is the same when you're done, we're good to go! (See [API: `key`](#key))

_Note:_ These data files could also be JSON, but we've opted for JS files to offer more flexibility around quotation marks and comments.
_Note:_ These [global data files](https://www.11ty.dev/docs/data-global/) could also be JSON, but we've opted for JS to offer more flexibility around quotation marks and comments.

#### `fallbackLocales`

Expand All @@ -139,7 +139,7 @@ fallbackLocales: {
}
```

👀 `eleventy-plugin-i18n` will warn you in the Node console when the intended translation or fallback values can't be found for a given language based on your `translations`.
👀 `eleventy-plugin-i18n` will warn you in the Node console when the intended translation or fallback values can't be found for a given language based on your `translations` data.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eleventy-plugin-i18n",
"version": "0.1.0-alpha.0",
"version": "0.1.0",
"description": "Eleventy plugin to assist with dictionary translations",
"main": ".eleventy.js",
"scripts": {
Expand Down

0 comments on commit 0eb98d6

Please sign in to comment.