Skip to content

Commit

Permalink
Release 0.2.30
Browse files Browse the repository at this point in the history
  • Loading branch information
seeden committed Jan 3, 2016
1 parent 2adb55c commit 067cacf
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ Star this project on [GitHub][github-url].
[coveralls-url]: https://coveralls.io/r/CherrySoftware/translate-maker?branch=master
[github-url]: https://github.com/CherrySoftware/translate-maker

[combinations-hash]: https://github.com/CherrySoftware/translate-maker#combination-external-variables-and-references


# Installation

Expand Down Expand Up @@ -707,7 +709,39 @@ There is no support for pairs as value.

# Differences from the ICU MessageFormat syntax

There is only one difference. External variables have $ prefix.
There is only one difference. External variables have $ prefix. If you want to use full compatible ICU standard you can do that. Set option named mode to ICU. FYI: [combinations][combinations-hash] will stop to work because it is not compatible with ICU standard.

```js
import Translate, { Mode } from 'translate-maker';

const t = new Translate({
mode: Mode.ICU,
});

t.set({
following: `{user.name} {user.followers, plural, offset: 1
zero {follows nobody}
one {follows {follower.name}}
{follows {follower.name} and # others}
}`
});

const user = {
name: 'Zlatko',
followers: 3,
};

const follower = {
name: 'Livia'
};

const result = t.get('following', {
user: user,
follower: follower
});

console.log('result'); // => Zlatko follows Livia and 2 others
```


# Running Tests
Expand Down
6 changes: 3 additions & 3 deletions dist/Translate.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ var _adaptersMemory = require('./adapters/Memory');

var _adaptersMemory2 = _interopRequireDefault(_adaptersMemory);

var _cacheMemory = require('./cache/Memory');
var _cachesMemory = require('./caches/Memory');

var _cacheMemory2 = _interopRequireDefault(_cacheMemory);
var _cachesMemory2 = _interopRequireDefault(_cachesMemory);

var _events = require('events');

Expand All @@ -59,7 +59,7 @@ var defaultOptions = {
locales: null, // available locales
namespace: null, // current namespace
fallbacks: {},
cache: new _cacheMemory2['default']({}),
cache: new _cachesMemory2['default']({}),
adapter: new _adaptersMemory2['default']({}),
defaultAdapter: _adaptersMemory2['default'],
dotNotation: true,
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": "translate-maker",
"version": "0.2.29",
"version": "0.2.30",
"description": "Universal translation library",
"main": "dist/index.js",
"keywords": [
Expand Down

0 comments on commit 067cacf

Please sign in to comment.