Allow removal of English as the default language (#3056)
This commit is contained in:
parent
4b04a83fbd
commit
4106b9de3f
1 changed files with 7 additions and 12 deletions
|
@ -296,13 +296,11 @@ export const LocalizationTab = ({ save, realm }: LocalizationTabProps) => {
|
|||
</SelectGroup>,
|
||||
<Divider key="divider" />,
|
||||
<SelectGroup label={t("supportedLocales")} key="group2">
|
||||
{watchSupportedLocales
|
||||
.filter((item) => item !== realm.defaultLocale)
|
||||
.map((locale) => (
|
||||
<SelectOption key={locale} value={locale}>
|
||||
{localeToDisplayName(locale)}
|
||||
</SelectOption>
|
||||
))}
|
||||
{watchSupportedLocales.map((locale) => (
|
||||
<SelectOption key={locale} value={locale}>
|
||||
{localeToDisplayName(locale)}
|
||||
</SelectOption>
|
||||
))}
|
||||
</SelectGroup>,
|
||||
];
|
||||
|
||||
|
@ -397,17 +395,14 @@ export const LocalizationTab = ({ save, realm }: LocalizationTabProps) => {
|
|||
const option = v as string;
|
||||
if (value.includes(option)) {
|
||||
onChange(
|
||||
value.filter(
|
||||
(item: string) =>
|
||||
item !== option || option === DEFAULT_LOCALE
|
||||
)
|
||||
value.filter((item: string) => item !== option)
|
||||
);
|
||||
} else {
|
||||
onChange([...value, option]);
|
||||
}
|
||||
}}
|
||||
onClear={() => {
|
||||
onChange([DEFAULT_LOCALE]);
|
||||
onChange([]);
|
||||
}}
|
||||
selections={value}
|
||||
variant={SelectVariant.typeaheadMulti}
|
||||
|
|
Loading…
Reference in a new issue