Frenchkiss.js Versions Save

The blazing fast lightweight internationalization (i18n) module for javascript

v0.4.0

4 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/koala-interactive/frenchkiss.js/compare/v0.3.0...v0.4.0

v0.3.0

1 year ago

What's Changed

New Contributors

Full Changelog: https://github.com/koala-interactive/frenchkiss.js/compare/v0.2.0...v0.3.0

v0.2.0

5 years ago

⚡️ Fixed performance regression using nested keys

✨ Add params and locale to onMissingKey parameters.

It's now possible to use nested key in translations table.

frenchkiss.onMissingKey((key, params, locale) => {
  // Send error to your server
  sendReport(`Missing the key "${key}" in ${locale} language.`);

  // Returns the text you want
  return `An error happened (${key})`;
});

v0.1.0

5 years ago

⚡️ Faster table resolution performance

A small optimization allowing to get 10% performance boost on table resolution.

✨ Introduce nested key support

It's now possible to use nested key in translations table.

frenchkiss.set('en', {
  fruits: {
    apple: 'An apple',
    banana: 'A banana',
  }
});

frenckiss.t('fruits.apple'); // => 'An apple'

v0.0.8

5 years ago

🐛 Fixed plural expression checks prioritization

In plural expression, direct checks will always be executed before plural categories. Therefore, in the following example, the =0 will always have a higher priority than the one.

There {N,plural,one{is one cat} =0{is no cat} other{are {N} cats}} here.

Source: ceeb4289

✨ Introduce onMissingVariable feature

It's now possible to detect if a specific translation is called with missing properties and how to handle it. This function is called only on interpolation variables as there are some intended use with SELECT/PLURAL expressions.

Source: #8

frenchkiss.set('en', {
  hello: 'Hello {name} !',
});

frenchkiss.t('hello'); // => 'Hello  !' // Default it returns an empty string.

// -- Handle it now ---

frenchkiss.onMissingVariable((variable, key, language) => {
  // Send error to your server
  sendReport(`Missing the variable "${variable}" in ${language}->${key}.`);

  // Returns the text you want
  return `[missing:${variable}]`;
});

frenchkiss.t('hello'); // => 'Hello [missing:name] !'

Note: this functions is not cached and could be called multiple times.

v0.0.7

5 years ago

Fixed a problem with the interpolation defaulting to an empty string when "0" was given as parameter.

v0.0.6

5 years ago