$t, $i18n, v-t directive and others) are also available even though they are not listed here. Below are only the ones that are added by @nuxtjs/i18n.string | Location)string, default: current locale)stringReturns localized path for passed in route. If locale is not specified, uses current locale.
See also Basic usage - nuxt-link.
string)stringReturns path of the current route for specified locale.
See also Basic usage - nuxt-link.
See type definition for Location.
Route, default: current route)stringReturns base name of current (if argument not provided) or passed in route. Base name is name of the route without locale suffix and other metadata added by @nuxtjs/i18n.
RawLocation)string, default: current locale)Route | undefinedReturns localized route for passed in route parameters. If locale is not specified, uses current locale.
See also Basic usage - nuxt-link.
RawLocation)string, default: current locale)Location | undefinedReturns localized location for passed in route parameters. If locale is not specified, uses current locale.
See also Basic usage - nuxt-link.
NuxtI18nHeadOptions)MetaInfoThe options object accepts these optional properties:
addDirAttribute (type: boolean) - Adds a dir attribute to the HTML element. Default: falseaddSeoAttributes (type: boolean | SeoAttributesOptions) - Adds various SEO attributes. Default: falseSee also SEO.
$i18n on Vue instance and Vuex Store but as i18n on Nuxt context.app.string | undefinedReturns locale code from stored locale cookie.
string)undefinedUpdates stored locale cookie with specified locale code. Consider using setLocale instead if you want to switch locale.
string)Promise<undefined>Switches locale of the app to specified locale code. If useCookie option is enabled, locale cookie will be updated with new value. If prefixes are enabled (strategy other than no_prefix), will navigate to new locale's route.
string | undefinedReturns browser locale code filtered against the ones defined in options.
Promise<undefined>Switches to the pending locale that would have been set on navigate, but was prevented by the option skipSettingLocaleOnNavigate. See more information in Wait for page transition.
Promise<undefined>Returns a promise that will be resolved once the pending locale is set.
DirectionsDefault direction as specified in options.
stringDefault locale as specified in options.
Array<string>List of locale codes of registered locales.
Array<string | LocaleObject>List of locales as defined in options.
LocaleObjectObject of the current locale properties.
booleanWhether differentDomains option is enabled.
FunctionSee callbacks
FunctionSee callbacks
The following APIs are exposed both on context and context.app.
VueI18nSee also Nuxt context.
Can be accessed from asyncData and wherever context is available.
Example use:
export default Vue.extend({
  asyncData({ i18n }) {
    const locale = i18n.locale
    return {
      locale
    }
  }
})
See more info about those in Extension of Vue section.
VueI18nCan be accessed in store's actions and mutations as this.$i18n.
Example use:
export const actions = {
  nuxtServerInit({ commit }) {
    commit('LOCALE', this.$i18n.locale)
  }
}
See more info about those in Extension of Vue section.