Package Exports
- vue-i18n
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (vue-i18n) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
vue-i18n-next
Internationalization plugin for Vue.js
Silver Sponsors
Bronze Sponsors
Status: Alpha 
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 Features
Composable API
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>
Component
You can use datetime format on the component, like <i18n-n>
component.
See the below examples:
π Examples
See the examples
directory.
The examples are offered that use the following two API styles:
- composable
- Examples with using new vue-i18n API optimized for Vue 3
- legacy
- Examples with using vue-i18n API that almost compatible with vue-i18n v8.x
β Known issues
π₯ Breaking changes compared to vue-i18n v8.x
APIs
- The return value of
$t
andt
methods is string only. object and array values ββare no longer returned.- As an alternative way, you can use
$tm
/tm
- As an alternative way, you can use
- The return value of
$tc
andtc
methods is string only. object and array values ββare no longer returned.- As an alternative way, you can use
$tm
/tm
- As an alternative way, you can use
VueI18n
class cannot used withnew
. It can only be used via the$i18n
property of Vue instance.- In vue-i18n-next, by replacing
new VueI18n
withcreateI18n
, you can use existingVueI18n
options as they are. - See the
examples/legacy
directory.
- In vue-i18n-next, by replacing
VueI18n.prototype.getChoiceIndex
- -> Legacy API style:
pluralizationRules
option ofcreateI18n
factory function (likenew VueI18n(...)
) - -> Compsable API style:
pluralRules
option ofcreateI18nComposer
factory function
- -> Legacy API style:
warnHtmlInMessage
option:- Composable API:
warnHtmlMessage
boolean property, defaulttrue
. - Legacy API:
warnHtmlInMessage
property. - For development mode, warning is default.
- For production mode, HTML message detect is not check due to performance.
- Composable API:
- Legacy API
sync
option:- default: change to
false
fromtrue
- default: change to
v-t
directivepreserve
modifier deprecated, keep Element content- Legacy API
preserveDirectiveContent
option, and property deprecated
VueI18n.version
->import { VERSION } from 'vue-i18n'
VueI18n.availabilities
->import { availabilities } from 'vue-i18n'
- See the details here
Components
<i18n>
component- Rename to
<i18n-t>
component - Remove
Boolean
type fromtag
prop - if
tag
prop is not specified, return the Fragment - Remove the below props:
place
propplaces
proppath
prop (Rename tokeypath
prop)
- Rename to
<i18n-n>
component- Remove
Boolean
type fromtag
prop - if
tag
prop is not specified, return the Fragment
- Remove
β‘ Improvements
- See the vue-i18n issues that labeld with
Status: Ready
π¨ Missing features
- Custom formatting
- Tooling
@intlify/devtools
vue-cli-plugin-i18n
@intlify/eslint-plugin-vue-i18n
πΏ Installation
npm
npm install --save vue-i18n@next
yarn
yarn add vue-i18n@next
β TODOs
- Intlify message format compiler
- vue-i18n message format
- sourcemap
- HTML format handling
- more unit (fuzzing) tests
- performance tests (benchmark)
- Intlify core runtime
- translate function
- datetime function
- number function
- warnHtmlMessage
- improve translate
args
typing - improve locale messages typing:
LocaleMessages
/LocaleMessage
/LocaleMessageDictiory
- postTranslation context option
- Composable API: I18n Composer
- properties
- locale
- fallbackLocale
- inheritLocale
- availableLocales
- messages
- modifiers
- pluralRules
- missingWarn
- fallbackWarn
- fallbackRoot
- fallbackFormat
- dateTimeFormats
- numberFormats
- warnHtmlMessage
- methods
- t
- getLocaleMessages
- setLocaleMessages
- mergeLocaleMessages
- d
- getDateTimeFormat
- setDateTimeFormat
- mergeDateTimeFormat
- n
- getNumberFormat
- setNumberFormat
- mergeNumberFormat
- getPostTranslationHandler
- setPostTranslationHandler
- getMissingHandler
- setMissingHandler
- tm
- properties
- Legacy API: compatible supporting
- VueI18n
- locale
- fallbackLocale
- sync
- availableLocales
- messages
- pluralizationRules
- dateTimeFormats
- numberFormats
- formatter
- missing
- silentTranslationWarn
- silentFallbackWarn
- formatFallbackMessages
- preserveDirectiveContent
- warnHtmlInMessage
- postTranslation
- componentInstanceCreatedListener
- t
- tc
- te
- getLocaleMessage
- setLocaleMessage
- mergeLocaleMessage
- d
- getDateTimeFormat
- setDateTimeFormat
- mergeDateTimeFormat
- n
- getNumberFormat
- setNumberFormat
- mergeNumberFormat
- getChoiceIndex
- tm
- Inejctted in Vue Prototype API
- $i18n
- $t
- $tc
- $te
- $d
- $n
- $tm
- Component options
- messages
- pluralRule
- dateTimeFormats
- numberFormats
- sharedMessages
- plugin install & mixin
- version
- IntlAvailability availabilities
- VueI18n
- Components
- Translation
<i18n-t>
- NumberFormat
<i18n-n>
- DatetimeFormat
<i18n-d>
- Translation
- Directive
-
v-t
-
- Tool Chains
- intlify devtools
- vue-i18n-extensions
- vue-i18n-loader
- rollup-plugin-vue-i18n
- vite-plugin-vue-i18n
- vue-cli-plugin-i18n
- eslint-plugin-vue-i18n
- Others
- documentation
- fallback localization (bubble up)
- SSR
- General tasks
- error handlings