Skip to content

Commit

Permalink
shontzu/WALL-823/inaccurate-jurisdictions-displayed-when-language-is-…
Browse files Browse the repository at this point in the history
…non-English (#8919)

* fix: fixed defaulted switch case caused by translated arg

* fix: add-back code that is accidentally removed

* Update account-type-modal.tsx

* refactor: switch statement expects a constant expression

* Update account-type-modal.tsx

* refactor: set swapfree as default in switchcase
  • Loading branch information
shontzu-deriv committed Jun 22, 2023
1 parent 197682c commit 6c0eb46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,19 +109,21 @@ const MT5AccountTypeModal = () => {
const is_swapfree_available = useHasSwapFreeAccount();

const set_account_type = () => {
switch (account_type_card) {
case 'Derived':
const localizedAccountType = localize(account_type_card);

switch (localizedAccountType) {
case localize('Derived'):
setAccountType({ category: 'real', type: 'synthetic' });
break;
case 'Swap-Free':
setAccountType({ category: 'real', type: 'all' });
case localize('Financial'):
setAccountType({ category: 'real', type: 'financial' });
break;
case 'Financial':
default:
setAccountType({ category: 'real', type: 'financial' });
setAccountType({ category: 'real', type: 'all' });
break;
}
};

return (
<div>
<React.Suspense fallback={<UILoader />}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const JurisdictionModal = ({
const modal_title = show_eu_related_content
? localize('Choose a jurisdiction for your Deriv MT5 CFDs account')
: localize('Choose a jurisdiction for your Deriv MT5 {{account_type}} account', {
account_type: getMT5Title(account_type.type),
account_type: localize(getMT5Title(account_type.type)),
});

return (
Expand Down

1 comment on commit 6c0eb46

@vercel
Copy link

@vercel vercel bot commented on 6c0eb46 Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

deriv-app – ./

deriv-app.vercel.app
binary.sx
deriv-app-git-master.binary.sx
deriv-app.binary.sx

Please sign in to comment.