Vue.js T9N plugin
Advantages
- No need to write keys to text in data set
- The directive can be defined once for component and works for all child tags
- Ability to write section specific translations
- Translation data set can be represented as relational model
- Regexp support
Demo
Getting started
; Vue; { this; this; };
Dataset example:
'1 день' en: '1 day' ua: '1 день' /^ дня$/ en: '$1 days' ua: '$1 дні' /^ дней$/ en: '$1 days' ua: '$1 днів' 'плагин' en: "plugin" ua: 'плагін''sectionid' // section name in lowercase
Component's template:
{{days}} дней
плагин 1 день
Function translation (in some cases)
{{$t('плагин')}}
The deep
modifier is required to do translations inside slots