fix: set default locale for lang attribute
| | |
| | | </div> |
| | | ) |
| | | |
| | | const lang = componentData.frontmatter?.lang ?? cfg.locale.split("-")[0] |
| | | |
| | | const lang = componentData.frontmatter?.lang ?? cfg.locale?.split("-")[0] ?? "en" |
| | | const doc = ( |
| | | <html lang={lang}> |
| | | <Head {...componentData} /> |
| | |
| | | "uk-UA": uk, |
| | | } as const |
| | | |
| | | export const i18n = (locale: ValidLocale): Translation => TRANSLATIONS[locale ?? "en-US"] |
| | | export const defaultTranslation = "en-US" |
| | | export const i18n = (locale: ValidLocale): Translation => TRANSLATIONS[locale ?? defaultTranslation] |
| | | export type ValidLocale = keyof typeof TRANSLATIONS |