We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f3bdc54 commit c6f88afCopy full SHA for c6f88af
src/lib/utils/metadata.ts
@@ -3,6 +3,7 @@ import { getTranslations } from "next-intl/server"
3
4
import { DEFAULT_OG_IMAGE, SITE_URL } from "@/lib/constants"
5
6
+import { isLocaleValidISO639_1 } from "./translations"
7
import { getFullUrl } from "./url"
8
9
import { routing } from "@/i18n/routing"
@@ -71,10 +72,9 @@ export const getMetadata = async ({
71
72
languages: {
73
"x-default": xDefault,
74
...Object.fromEntries(
- routing.locales.map((locale) => [
75
- locale,
76
- getFullUrl(locale, slugString),
77
- ])
+ routing.locales
+ .filter(isLocaleValidISO639_1)
+ .map((locale) => [locale, getFullUrl(locale, slugString)])
78
),
79
},
80
0 commit comments