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

thisyahlen/fix: translation on refresh bug #8778

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
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