Commit ca336af4 authored by Steven's avatar Steven

chore: update locale checks

parent 7ec5d07c
...@@ -24,17 +24,22 @@ const LocaleSelect: FC<Props> = (props: Props) => { ...@@ -24,17 +24,22 @@ const LocaleSelect: FC<Props> = (props: Props) => {
onChange={(_, value) => handleSelectChange(value as Locale)} onChange={(_, value) => handleSelectChange(value as Locale)}
> >
{availableLocales.map((locale) => { {availableLocales.map((locale) => {
const languageName = new Intl.DisplayNames([locale], { type: "language" }).of(locale); try {
if (languageName === undefined) { const languageName = new Intl.DisplayNames([locale], { type: "language" }).of(locale);
return ( if (languageName) {
<Option key={locale} value={locale}> return (
{locale} <Option key={locale} value={locale}>
</Option> {languageName.charAt(0).toUpperCase() + languageName.slice(1)}
); </Option>
);
}
} catch (error) {
// do nth
} }
return ( return (
<Option key={locale} value={locale}> <Option key={locale} value={locale}>
{languageName.charAt(0).toUpperCase() + languageName.slice(1)} {locale}
</Option> </Option>
); );
})} })}
......
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