Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suisin/chore: remove mongolian language #16513

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
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import React from 'react';
import classNames from 'classnames';
import { matchStringByChar, getPosition, getSearchNotFoundOption } from '@deriv/shared';
import { matchStringByChar, getPosition } from '@deriv/shared';
import Icon from '../icon';
import Input from '../input';
import DropdownList, { TItem } from '../dropdown-list';
import { useBlockScroll } from '../../hooks/use-blockscroll';
import { getEnglishCharacters } from '../../../utils/helper';
import { localize } from '@deriv/translations';

type TAutocompleteProps = {
autoComplete: string;
Expand Down Expand Up @@ -36,6 +37,10 @@ type TAutocompleteProps = {
data_testid: string;
readOnly?: boolean;
};
/**
* Returns default value for the text to render when there are no matching results.
*/
export const getSearchNotFoundOption = () => localize('No results found');

const KEY_CODE = {
ENTER: 13,
Expand Down
3 changes: 1 addition & 2 deletions packages/core/src/Stores/client-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,9 +451,8 @@ export default class ClientStore extends BaseStore {
const should_update_preferred_language =
language !== this.account_settings?.preferred_language &&
this.preferred_language !== this.account_settings?.preferred_language;

window.history.replaceState({}, document.title, urlForLanguage(language));
if (should_update_preferred_language) {
window.history.replaceState({}, document.title, urlForLanguage(language));
this.setPreferredLanguage(language);
await WS.setSettings({
set_settings: 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const languages = {
IT: 'Italiano',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
PL: 'Polish',
PT: 'Português',
SW: 'Kiswahili',
Expand Down
14 changes: 13 additions & 1 deletion packages/shared/src/utils/config/adapters.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIDVNotApplicableOption } from '../constants/default-options';
import { localize } from '@deriv/translations';
import { FormikValues } from 'formik';

/**
Expand All @@ -21,3 +21,15 @@ export const formatIDVFormValues = (idv_form_value: FormikValues, country_code:
};
return idv_submit_data;
};

/**
* Returns an object that allows user to skip IDV
*/

export const getIDVNotApplicableOption = (is_for_real_account_signup_modal?: boolean) => ({
id: 'none',
text: is_for_real_account_signup_modal
? localize('I want to do this later')
: localize("I don't have any of these"),
value: 'none',
});
19 changes: 1 addition & 18 deletions packages/shared/src/utils/constants/default-options.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
import { localize } from '@deriv/translations';
import { isProduction } from '../config/config';
/**
* Returns an object that allows user to skip IDV
*/

export const getIDVNotApplicableOption = (is_for_real_account_signup_modal?: boolean) => ({
id: 'none',
text: is_for_real_account_signup_modal
? localize('I want to do this later')
: localize("I don't have any of these"),
value: 'none',
});

/**
* Returns default value for the text to render when there are no matching results.
*/
export const getSearchNotFoundOption = () => localize('No results found');

suisin-deriv marked this conversation as resolved.
Show resolved Hide resolved
/**
* Returns List of unsupported languages based on the environment.
*/
export const UNSUPPORTED_LANGUAGES = isProduction() ? ['ID'] : [];
export const UNSUPPORTED_LANGUAGES = isProduction() ? ['ID', 'MN'] : ['MN'];
5 changes: 2 additions & 3 deletions packages/translations/src/i18next/i18next.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { str as crc32 } from 'crc-32';
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import { isProduction } from '../../../shared/src/utils/config/config';
import { UNSUPPORTED_LANGUAGES } from '../../../shared/src/utils/constants/default-options';
import withI18n from '../components';

const LANGUAGE_KEY = 'i18n_language';
Expand All @@ -18,7 +19,6 @@ const ALL_LANGUAGES = Object.freeze({
IT: 'Italiano',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
PL: 'Polish',
PT: 'Português',
SW: 'Kiswahili',
Expand All @@ -40,7 +40,6 @@ export const getAllowedLanguages = () => {
DE: 'Deutsch',
KM: 'ខ្មែរ',
KO: '한국어',
MN: 'Монгол',
suisin-deriv marked this conversation as resolved.
Show resolved Hide resolved
PT: 'Português',
PL: 'Polish',
SW: 'Kiswahili',
Expand All @@ -54,7 +53,7 @@ export const getAllowedLanguages = () => {
ZH_CN: '简体中文',
ZH_TW: '繁體中文',
};
const exclude_languages = ['ACH'];
const exclude_languages = ['ACH', ...UNSUPPORTED_LANGUAGES];
// TODO Change language_list to const when languages are available in prod.
type Key = keyof typeof ALL_LANGUAGES;
let language_list = Object.keys(getAllLanguages())
Expand Down
Loading