Extension of Vue
The APIs listed are available in the Options API. They are kept for Nuxt2 to migration from
@nuxtjs/i18n. we will be deprecated in the future.getRouteBaseName()
- Arguments:
- route (type:
Route, default: current route)
- route (type:
- Returns:
string
Returns 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.
switchLocalePath()
- Arguments:
- locale: (type:
Locale)
- locale: (type:
- Returns:
string
Returns path of the current route for specified locale.
See also Link localizing
localePath()
- Arguments:
- route (type:
string|Location) - locale (type:
Locale, default: current locale)
- route (type:
- Returns:
string
Returns localized path for passed in route. If locale is not specified, uses current locale.
See also Link localizing
localeRoute()
- Arguments:
- route (type:
string|Location) - locale (type:
Locale, default: current locale)
- route (type:
- Returns:
Route|undefined
Returns localized route for passed in route parameters. If locale is not specified, uses current locale.
See also Link localizing
localeHead()
localeHead is renamed from $nuxtI18nHead provided in @nuxtjs/i18n v7.x.- Arguments:
- options: (type:
I18nHeadOptions)
- options: (type:
- Returns:
I18nHeadMetaInfo
The options object accepts these optional properties:
addDirAttribute(type:boolean) - Adds adirattribute to the HTML element. Default:falseaddSeoAttributes(type:boolean | SeoAttributesOptions) - Adds various SEO attributes. Default:false
See also SEO