Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -875,7 +875,6 @@ const CONST = {
NEWDOT_MULTI_SCAN: 'newDotMultiScan',
PLAID_COMPANY_CARDS: 'plaidCompanyCards',
TRACK_FLOWS: 'trackFlows',
STATIC_AI_TRANSLATIONS: 'staticAITranslations',
EUR_BILLING: 'eurBilling',
MANUAL_DISTANCE: 'manualDistance',
},
Expand Down
10 changes: 3 additions & 7 deletions src/pages/settings/Preferences/LanguagePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@ import ScreenWrapper from '@components/ScreenWrapper';
import SelectionList from '@components/SelectionList';
import RadioListItem from '@components/SelectionList/RadioListItem';
import useLocalize from '@hooks/useLocalize';
import usePermissions from '@hooks/usePermissions';
import Navigation from '@libs/Navigation/Navigation';
import {setLocaleAndNavigate} from '@userActions/App';
import type {ListItem} from '@src/components/SelectionList/types';
import CONST from '@src/CONST';
import {isFullySupportedLocale, LOCALE_TO_LANGUAGE_STRING, SORTED_LOCALES} from '@src/CONST/LOCALES';
import {LOCALE_TO_LANGUAGE_STRING, SORTED_LOCALES} from '@src/CONST/LOCALES';
import type Locale from '@src/types/onyx/Locale';

type LanguageEntry = ListItem & {
Expand All @@ -20,17 +18,15 @@ type LanguageEntry = ListItem & {
function LanguagePage() {
const {translate, preferredLocale} = useLocalize();
const isOptionSelected = useRef(false);
const {isBetaEnabled} = usePermissions();

const locales = useMemo(() => {
const sortedLocales = isBetaEnabled(CONST.BETAS.STATIC_AI_TRANSLATIONS) ? SORTED_LOCALES : SORTED_LOCALES.filter((locale) => isFullySupportedLocale(locale));
return sortedLocales.map((locale) => ({
return SORTED_LOCALES.map((locale) => ({
value: locale,
text: LOCALE_TO_LANGUAGE_STRING[locale],
keyForList: locale,
isSelected: preferredLocale === locale,
}));
}, [isBetaEnabled, preferredLocale]);
}, [preferredLocale]);

const updateLanguage = (selectedLanguage: LanguageEntry) => {
if (isOptionSelected.current) {
Expand Down