Skip to content

Commit

Permalink
Fix: Locale keys (#1321)
Browse files Browse the repository at this point in the history
  • Loading branch information
sharonsheah authored Jan 8, 2024
1 parent 5efad06 commit aea1e3d
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions packages/checkout/widgets-lib/src/views/error/ErrorView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,19 @@ export function ErrorView({
floatHeader
testId="error-view"
>
<SimpleTextBody heading={t('views.ERROR_VIEW.errorText.heading')}>
{t('views.ERROR_VIEW.errorText.body', { returnObjects: true })[0]}
<SimpleTextBody heading={t('views.ERROR_VIEW.heading')}>
{t('views.ERROR_VIEW.body', { returnObjects: true })[0]}
{' '}
<Link
size="small"
rc={
<a href="https://support.immutable.com/en/" />
}
>
{t('views.ERROR_VIEW.errorText.body', { returnObjects: true })[1]}
{t('views.ERROR_VIEW.body', { returnObjects: true })[1]}
</Link>
{' '}
{t('views.ERROR_VIEW.errorText.body', { returnObjects: true })[2]}
{t('views.ERROR_VIEW.body', { returnObjects: true })[2]}
</SimpleTextBody>
</SimpleLayout>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export function BridgeWidget({
)}
{viewState.view.type === SharedViews.ERROR_VIEW && (
<ErrorView
actionText={t('views.ERROR_VIEW.errorText.actionText')}
actionText={t('views.ERROR_VIEW.actionText')}
onActionClick={goBackToWalletNetworkSelector}
onCloseClick={() => sendBridgeWidgetCloseEvent(eventTarget)}
errorEventAction={() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export function BridgeForm(props: BridgeFormProps) {
tokenSymbol={estimates?.token?.symbol ?? ''}
fees={[
{
label: t('views.drawers.feesBreakdown.fees.gas.label'),
label: t('drawers.feesBreakdown.fees.gas.label'),
fiatAmount: gasFiatAmount,
amount: gasFee,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ export function ReadyToConnect({ targetChainId, allowedChains }: ReadyToConnectP
});
handleConnectViewUpdate(provider);
} catch (err: any) {
// eslint-disable-next-line no-console
console.error(err);
setLoading(false);
setFooterButtonTextKey(`${textView()}.footer.buttonText2`);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function SwitchNetworkEth() {
const { viewDispatch } = useContext(ViewContext);
const { connectDispatch, connectState } = useContext(ConnectContext);
const { checkout, provider, sendCloseEvent } = connectState;
const [buttonTextKey, setButtonTextKey] = useState('views.SWITCH_NETWORK.eth.button.text');
const [buttonTextKey, setButtonTextKey] = useState(t('views.SWITCH_NETWORK.eth.button.text'));

const { page, track } = useAnalytics();

Expand Down Expand Up @@ -63,7 +63,7 @@ export function SwitchNetworkEth() {
},
});
} catch (err: any) {
setButtonTextKey('views.SWITCH_NETWORK.eth.button.retryText');
setButtonTextKey(t('views.SWITCH_NETWORK.eth.button.retryText'));
}
}, [provider, checkout, track]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function SwitchNetworkZkEVM() {
const { viewDispatch } = useContext(ViewContext);
const { connectDispatch, connectState } = useContext(ConnectContext);
const { checkout, provider, sendCloseEvent } = connectState;
const [buttonTextKey, setButtonTextKey] = useState('views.SWITCH_NETWORK.zkEVM.button.text');
const [buttonTextKey, setButtonTextKey] = useState(t('views.SWITCH_NETWORK.zkEVM.button.text'));
const { page, track } = useAnalytics();

useEffect(() => {
Expand Down Expand Up @@ -59,7 +59,7 @@ export function SwitchNetworkZkEVM() {
},
});
} catch (err: any) {
setButtonTextKey('views.SWITCH_NETWORK.zkEVM.button.retryText');
setButtonTextKey(t('views.SWITCH_NETWORK.zkEVM.button.retryText'));
}
}, [provider, checkout]);

Expand Down

0 comments on commit aea1e3d

Please sign in to comment.