diff --git a/docs/src/util.ts b/docs/src/util.ts index 53752077e..0ec91bce0 100644 --- a/docs/src/util.ts +++ b/docs/src/util.ts @@ -1,4 +1,4 @@ export function getLanguageFromURL(pathname: string) { - const langCodeMatch = pathname.match(/\/([a-z]{2})\//); + const langCodeMatch = pathname.match(/\/([a-z]{2}-?[A-Z]{0,2})\//); return langCodeMatch ? langCodeMatch[1] : 'en'; }