Commit 3394bc73 authored by Moody Salem's avatar Moody Salem

fix the locale parsing of full locale string

parent 32b56ba0
...@@ -10,7 +10,7 @@ import useParsedQueryString from './useParsedQueryString' ...@@ -10,7 +10,7 @@ import useParsedQueryString from './useParsedQueryString'
function parseLocale(maybeSupportedLocale: string): SupportedLocale | undefined { function parseLocale(maybeSupportedLocale: string): SupportedLocale | undefined {
const lowerMaybeSupportedLocale = maybeSupportedLocale.toLowerCase() const lowerMaybeSupportedLocale = maybeSupportedLocale.toLowerCase()
return SUPPORTED_LOCALES.find( return SUPPORTED_LOCALES.find(
(locale) => locale === lowerMaybeSupportedLocale || locale.slice(0, 2) === lowerMaybeSupportedLocale (locale) => locale.toLowerCase() === lowerMaybeSupportedLocale || locale.slice(0, 2) === lowerMaybeSupportedLocale
) )
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment