Releases: dkfbasel/vuex-i18n
Fix missing typescript link in package.json
Add basic typescript info
This release adds very basic typescript information to the plugin. A new version is in the works, which will be written completely in typescript.
Add translateIn filter
This release adds a new filter translateIn to translate a message in a specific language:
{{ 'message' | translateIn('en') }}
Thanks to @zhangqiangoffice for the corresponding pull request #91 which was adapted for this.
Fix plugin build
This release fixes an issue with the previous build. Due to babel directory constraints, the previous build would not transpile the code correctly.
See #104 for details.
Improve regex matcher to also allow for single character variable substitutions
Small improvements and some restructuring
This release contains a restructured directory with better specification of the build directory, an initial documentation in vuepress, an example for a todo mvc and the slides of a recent talk regarding vue-i18n and vuex-i18n at a vue-meetup in Switzerland.
Improvements:
New method $i18n.locales, i18n.locales
As per request #66 we added a method to fetch all current locales. An example is given in the test repository.
Please keep in mind that this is a method that will be invoked on every render cycle. To make use of vue's caching system I would recommend to create a getter method or computed property like this.
locales() {
return Object.keys(this.$store.state.i18n.translations);
}
Hotfix: Fix problem with module initialization
This is a hotfix for version 1.10.
Module initialization was change in 1.10.0 to include the option preserveState. This would not correctly initialize the module as intended for the plugin.
Version 1.10.4 fixes this and allows you to specify preserveState via configuration parameter if actually necessary for server side rendering.
Allow specification pluralization via arrays
Thanks to the pull request #41 from @galchenkov it is now possible to specifies pluralizations via arrays instead of using ::: as delimiter.
$i18n.add('en', {'comments': [
'{count} comment',
'{count} comments',
]});
$i18n.add('ru', {'comments': [
'{count} комментарий',
'{count} комментария',
'{count} комментариев',
]});
$i18n.set('en');
$t('comments', {count: 5}, 5); // 5 comments
$i18n.set('ru');
$t('comments', {count: 5}, 5); // 5 комментариев
Add defaultValue to onTranslationNotFoundMethod
As indicated in the title