diff --git a/utils/getLanguage.ts b/utils/getLanguage.ts index b0de77bd..6b853c3b 100644 --- a/utils/getLanguage.ts +++ b/utils/getLanguage.ts @@ -52,7 +52,13 @@ interface Language { */ function linkLocale(locale: string) { let linkedLocale: string - switch (locale) { + try { + // @ts-ignore + linkedLocale = Intl.getCanonicalLocales(locale)[0] + } catch (error) { + console.log(`${error.toString()}\n`) + } + switch (linkedLocale) { case 'zh-TW': case 'zh-HK': case 'zh-MO':