Skip to content

Babel 6 + ordinal filter

Compare
Choose a tag to compare
@seeden seeden released this 18 Jan 20:15
· 64 commits to master since this release

Added Babel 6
Added ordinal filter
You can use:

import Translate from 'translate-maker';

const t = new Translate();
t.set({
  takeRight: `Take the {$position, ordinal,
    one {#st}
    two {#nd}
    few {#rd}
        {#th}
  } right`
});

const result = t.get('followers', {
  position: 2
});
console.log(result); // => Take the 2nd right