Internationalization plugin for Vue.js
$ npm install vue-i18n
Internationalization plugin for Vue.js
The current codebase has most of the existing features on Vue I18n v8.x and is usable.
Since the library is still unstable and because we want feedback on bugs and missing features, it will probably go through a few breaking changes.
If you use stable Vue I18n version, see this repository
New style API for Vue 3. See the following docs:
<i18n-t> Component (formerly called <i18n> component)You can use pluralization on the component. See the blow examples:
<i18n-d> ComponentYou can use datetime format on the component, like <i18n-n> component.
See the below examples:
See the examples directory.
The examples are offered that use the following two API styles:
$t and t methods is string only. object and array values are no longer returned.$tc and tc methods is string only. object and array values are no longer returned.VueI18n class cannot used with new. It can only be used via the $i18n property of Vue instance.
new VueI18n with createI18n, you can use existing VueI18n options as they are.examples/legacy directory.VueI18n.prototype.getChoiceIndex
pluralizationRules option of createI18n factory function (like new VueI18n(...))pluralRules option of createI18nComposer factory functionwarnHtmlInMessage option:
warnHtmlMessage boolean option, default true.VueI18n.version -> import { VERSION } from 'vue-i18n'VueI18n.availabilities -> import { availabilities } from 'vue-i18n'<i18n> component
<i18n-t> componentplace propplaces proppath prop (Rename to keypath prop)Status: Readyv-t directivepreserveDirectiveContent option (depend on v-t)@intlify/devtoolsvue-cli-plugin-i18n@intlify/rollup-plugin-vue-i18n@intlify/vue-i18n-extensions@intlify/eslint-plugin-vue-i18nnpm install --save vue-i18n@next
yarn add vue-i18n@next
args typingLocaleMessages / LocaleMessage / LocaleMessageDictiory<i18n-t><i18n-n><i18n-d>v-t© 2010 - cnpmjs.org x YWFE | Home | YWFE