You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useLocaleHead composable should return the current language which can be added to the <html lang='…'>. However the value is present only if useLocaleHead is called with addSeoAttributes: true, see /src/runtime/routing/compatibles/head.ts#L52.
Yes, the lang attribute is probably related to SEO, but in my opinion that relation is not as strong as its relation to the locale and basic functionality of useLocaleHead. You can also notice that the useLocaleHead composable is returning an empty state if it is called as useLocaleHead({}), which might look more like a bug than words “language is related to the SEO”. Maybe the function may return lang attribute by default, but probably not right now as it might be considered as a breaking change.
I am thinking about new addLangAttribute which sets metaObject.htmlAttrs.lang regardless of addSeoAttributes value. The current behavior should be probably untouched until some major version changes (which might be quite long because the current version is 8.0.0, but it may not be a serious problem).
Additional information
Would you be willing to help implement this feature?
Could this feature be implemented as a module?
Final checks
Read the contribution guide (The contribution guideline of nuxt-modules/i18n is compliant with Nuxt too).
Describe the feature
useLocaleHead
composable should return the current language which can be added to the<html lang='…'>
. However the value is present only ifuseLocaleHead
is called withaddSeoAttributes: true
, see /src/runtime/routing/compatibles/head.ts#L52.Yes, the
lang
attribute is probably related to SEO, but in my opinion that relation is not as strong as its relation to the locale and basic functionality ofuseLocaleHead
. You can also notice that theuseLocaleHead
composable is returning an empty state if it is called asuseLocaleHead({})
, which might look more like a bug than words “language is related to the SEO”. Maybe the function may return lang attribute by default, but probably not right now as it might be considered as a breaking change.I am thinking about new
addLangAttribute
which setsmetaObject.htmlAttrs.lang
regardless ofaddSeoAttributes
value. The current behavior should be probably untouched until some major version changes (which might be quite long because the current version is 8.0.0, but it may not be a serious problem).Additional information
Final checks
The text was updated successfully, but these errors were encountered: