Skip to content

Commit

Permalink
fix: translation on refresh bug (#8778)
Browse files Browse the repository at this point in the history
  • Loading branch information
thisyahlen-deriv committed Jun 1, 2023
1 parent d4c8d87 commit 1da4c97
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { usePlatformAccounts } from '@deriv/hooks';
import { useStore, observer } from '@deriv/stores';

const DemoAccountCard = observer(() => {
const { client, traders_hub } = useStore();
const { client, traders_hub, common } = useStore();
const { accounts, loginid, resetVirtualBalance, default_currency } = client;
const { selected_account_type } = traders_hub;
const { demo: platform_demo_account } = usePlatformAccounts();
Expand All @@ -17,6 +17,8 @@ const DemoAccountCard = observer(() => {
return loginid && (accounts[loginid]?.balance || 0) !== 10000;
};

const { current_language } = common;

return (
<CurrencySwitcherContainer
className='demo-account-card'
Expand All @@ -28,7 +30,12 @@ const DemoAccountCard = observer(() => {
}
actions={
canResetBalance() && (
<Button secondary onClick={resetVirtualBalance} className='currency-switcher__button'>
<Button
key={`currency-switcher__button--key-${current_language}`}
secondary
onClick={resetVirtualBalance}
className='currency-switcher__button'
>
{localize('Reset Balance')}
</Button>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import TotalAssetsLoader from 'Components/pre-loader/total-assets-loader';
import { useTotalAccountBalance, useCFDAccounts, usePlatformAccounts } from '@deriv/hooks';

const AssetSummary = observer(() => {
const { traders_hub, client } = useStore();
const { traders_hub, client, common } = useStore();
const { selected_account_type, is_eu_user, no_CR_account, no_MF_account } = traders_hub;
const { is_logging_in, is_switching, default_currency } = client;
const { current_language } = common;
const { real: platform_real_accounts, demo: platform_demo_account } = usePlatformAccounts();
const { real: cfd_real_accounts, demo: cfd_demo_accounts } = useCFDAccounts();
const platform_real_balance = useTotalAccountBalance(platform_real_accounts);
Expand Down Expand Up @@ -41,7 +42,7 @@ const AssetSummary = observer(() => {
{has_active_related_deriv_account || selected_account_type === 'demo' ? (
<React.Fragment>
{!isMobile() ? (
<Text align='right' size='xs' line_height='s'>
<Text align='right' key={`asset-summary--key-${current_language}`} size='xs' line_height='s'>
{localize('Total assets')}
</Text>
) : null}
Expand Down

0 comments on commit 1da4c97

Please sign in to comment.