From 00d51ff82bbe6178457d1dae0dd87fdb76331207 Mon Sep 17 00:00:00 2001 From: Olga Bulat Date: Tue, 8 Oct 2024 15:56:53 +0300 Subject: [PATCH] Correctly set locale `language` property --- frontend/nuxt.config.ts | 1 + frontend/src/locales/scripts/get-validated-locales.js | 10 ++-------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts index 4e351645339..50060fd3123 100644 --- a/frontend/nuxt.config.ts +++ b/frontend/nuxt.config.ts @@ -102,6 +102,7 @@ export default defineNuxtConfig({ dir: "ltr", file: "en.json", language: "en", // used for SEO purposes (html lang attribute) + isCatchallLocale: true, // the catchall locale for `en` locales /* Custom fields */ diff --git a/frontend/src/locales/scripts/get-validated-locales.js b/frontend/src/locales/scripts/get-validated-locales.js index 386078ef356..23a0c04f343 100644 --- a/frontend/src/locales/scripts/get-validated-locales.js +++ b/frontend/src/locales/scripts/get-validated-locales.js @@ -29,14 +29,8 @@ const getValidatedLocales = async () => { code: locale.slug, dir: locale.textDirection || "ltr", file: `${locale.slug}.json`, - // Check for a language in all three versions of the ISO 639 spec, - // defaulting to the v1 two-character codes before checking for the - // three-character codes in the v2 and v3 specs. - language: - locale.langCodeIso_639_1 ?? - locale.langCodeIso_639_2 ?? - locale.langCodeIso_639_3 ?? - undefined, + // Used for the html lang attribute. + language: locale.slug, /* Custom fields */