Skip to content

Openverse is a search engine for openly-licensed media. This monorepo includes all application code.

Correctly set locale `language` property (#5036)

Olga Bulated5c1aac8724
diff --git a/frontend/nuxt.config.ts b/frontend/nuxt.config.ts
index 4e3516453..50060fd31 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 386078ef3..23a0c04f3 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 */