Releases: koala-interactive/frenchkiss.js
v0.4.0
What's Changed
- Clean and improve README.md by @LucBarbier-tech in #40
New Contributors
- @LucBarbier-tech made their first contribution in #40
Full Changelog: v0.3.0...v0.4.0
v0.3.0
What's Changed
- 🐛 Fixes typescript missing optional parameter by @vthibault in #21
- Update README.md by @eduardoltorres in #22
- Bump google-closure-library from 20190121.0.0 to 20200830.0.0 in /benchmark by @dependabot in #24
- Add pound character support by @zoontek in #27
- 💚 Introduce Github Action by @vthibault in #31
New Contributors
- @eduardoltorres made their first contribution in #22
- @dependabot made their first contribution in #24
- @zoontek made their first contribution in #27
Full Changelog: v0.2.0...v0.3.0
Version 0.2.0
⚡️ 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})`;
});
Version 0.1.0
⚡️ 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'
Version 0.0.8
🐛 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: ceeb428
✨ 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.
Version 0.0.7
Fixed a problem with the interpolation defaulting to an empty string when "0" was given as parameter.
🎉 Initial release
v0.0.6 🚀 Introduce version 0.0.6