fix: add `lang` attr to `<html>`

zio/stable
Daniel Roe 2022-11-29 21:13:43 +00:00
parent 608aad56dd
commit 661e53f639
No known key found for this signature in database
GPG Key ID: 22D5008E4F5D9B55
1 changed files with 4 additions and 0 deletions

View File

@ -4,7 +4,11 @@ const isDev = process.dev
const isPreview = window.location.hostname.includes('deploy-preview') const isPreview = window.location.hostname.includes('deploy-preview')
export function usePageHeader() { export function usePageHeader() {
const i18n = useI18n()
useHead({ useHead({
htmlAttrs: {
lang: () => i18n.locale.value,
},
titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${isDev ? ' (dev)' : isPreview ? ' (preview)' : ''}`, titleTemplate: title => `${title ? `${title} | ` : ''}${APP_NAME}${isDev ? ' (dev)' : isPreview ? ' (preview)' : ''}`,
bodyAttrs: { bodyAttrs: {
class: 'overflow-x-hidden', class: 'overflow-x-hidden',