Skip to content

Commit

Permalink
fix: complete and check missing translations
Browse files Browse the repository at this point in the history
  • Loading branch information
mikasackermn committed Dec 31, 2023
1 parent e122f3b commit e4815ca
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
type="primary"
fullWidth
size="large">
Confirm
{i18n.t('Confirm')}
</Button>
</ConfirmButton>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ export const ConnectedIcon = styled('div', {
export const SuffixContainer = styled('div', {
display: 'flex',
justifyContent: 'flex-end',
width: '$40',
minWidth: '$40',
button: {
padding: 0,
},
});

export const NotificationsBadgeContainer = styled('div', {
Expand Down
5 changes: 3 additions & 2 deletions widget/embedded/src/components/Quote/QuoteSummary.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { PriceImpactWarningLevel, Step } from '@rango-dev/ui';

import { i18n } from '@lingui/core';
import { TokenAmount } from '@rango-dev/ui';
import React from 'react';

Expand All @@ -21,7 +22,7 @@ export function QuoteSummary(props: PropTypes) {
<Container>
<TokenAmount
direction="horizontal"
label="Swap input"
label={i18n.t('Swap input')}
type="input"
tooltipContainer={getContainer()}
price={{
Expand All @@ -39,8 +40,8 @@ export function QuoteSummary(props: PropTypes) {
<div className={separatorStyles()} />
<TokenAmount
direction="horizontal"
label="Estimated output"
tooltipContainer={getContainer()}
label={i18n.t('Estimated output')}
type="output"
price={{
value: to.price.value,
Expand Down
10 changes: 5 additions & 5 deletions widget/embedded/src/components/SwapsGroup/SwapsGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export function SwapsGroup(props: PropTypes) {

const loadingGroups = [
{
title: 'Today',
title: i18n.t('Today'),
swaps,
},
{
title: 'This month',
title: i18n.t('Last month'),
swaps,
},
];
Expand All @@ -36,7 +36,7 @@ export function SwapsGroup(props: PropTypes) {
variant="label"
size="medium"
className={groupStyles()}>
{i18n.t(group.title)}
{group.title}
</Typography>
</Time>
<Divider size={4} />
Expand Down Expand Up @@ -69,7 +69,7 @@ export function SwapsGroup(props: PropTypes) {
variant="label"
size="medium"
className={groupStyles()}>
{i18n.t(group.title)}
{group.title}
</Typography>
</Time>
<Divider size={4} />
Expand All @@ -85,8 +85,8 @@ export function SwapsGroup(props: PropTypes) {
creationTime={swap.creationTime}
status={swap.status}
onClick={onSwapClick}
onlyShowTime={group.title === 'Today'}
tooltipContainer={getContainer()}
onlyShowTime={group.title === i18n.t('Today')}
swapTokenData={{
from: {
token: {
Expand Down
7 changes: 5 additions & 2 deletions widget/embedded/src/pages/LiquiditySourcePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
const supportedUniqueSwappersGroups: Array<UniqueSwappersGroupType> =
getUniqueSwappersGroups(swappers, disabledLiquiditySources);

const types = { Exchanges: i18n.t('Exchanges'), Bridges: i18n.t('Bridges') };
const validTypes: Array<LiquiditySourceType> = [];
if (sourceType === 'Exchanges') {
validTypes.push('DEX');
Expand Down Expand Up @@ -103,7 +104,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
suffix: (
<LiquiditySourceSuffix>
<Button variant="ghost" size="xsmall" onClick={toggleAllSources}>
{i18n.t(hasSelectAll ? 'Deselect all' : 'Select all')}
{hasSelectAll ? i18n.t('Deselect all') : i18n.t('Select all')}
</Button>
</LiquiditySourceSuffix>
),
Expand All @@ -115,7 +116,9 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
fullWidth
color="light"
variant="contained"
placeholder={i18n.t('Search {sourceType}', { sourceType })}
placeholder={i18n.t('Search {sourceType}', {
sourceType: types[sourceType],
})}
onChange={searchHandler}
/>
{fetchStatus === 'loading' && <LoadingLiquiditySourceList />}
Expand Down
6 changes: 3 additions & 3 deletions widget/embedded/src/pages/SelectBlockchainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { i18n } from '@lingui/core';
import {
Divider,
getCountCategories,
SelectableCategoryList
SelectableCategoryList,
} from '@rango-dev/ui';
import React, { useState } from 'react';

Expand All @@ -27,7 +27,7 @@ export function SelectBlockchainPage(props: PropTypes) {
const fetchStatus = useAppStore().fetchStatus;

const blockchains = useAppStore().blockchains({
type: type
type,
});

const countActiveCategories = getCountCategories(blockchains);
Expand All @@ -37,7 +37,7 @@ export function SelectBlockchainPage(props: PropTypes) {
return (
<Layout
header={{
title: i18n.t(`Select Blockchain`)
title: i18n.t(`Select Blockchain`),
}}>
<Divider size={12} />

Expand Down
6 changes: 5 additions & 1 deletion widget/embedded/src/pages/SelectSwapItemsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,15 @@ export function SelectSwapItemsPage(props: PropTypes) {
setToToken({ token, meta: { blockchains, tokens } });
}
};
const types = {
source: i18n.t('Source'),
destination: i18n.t('Destination'),
};

return (
<Layout
header={{
title: i18n.t('Swap {type}', { type }),
title: i18n.t('Swap {type}', { type: types[type] }),
}}>
<BlockchainsSection
blockchains={blockchains}
Expand Down
14 changes: 11 additions & 3 deletions widget/embedded/src/utils/date.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { GroupBy } from '../components/SwapsGroup/SwapsGroup.types';
import type { PendingSwap } from 'rango-types';

import { i18n } from '@lingui/core';
import dayjs from 'dayjs';

export const groupSwapsByDate: GroupBy = (swaps) => {
Expand All @@ -14,7 +15,7 @@ export const groupSwapsByDate: GroupBy = (swaps) => {
[
'today',
{
title: 'Today',
title: i18n.t('Today'),
swaps: [],
},
],
Expand All @@ -28,14 +29,21 @@ export const groupSwapsByDate: GroupBy = (swaps) => {
[
'month',
{
title: 'This month',
title: i18n.t('Last month'),
swaps: [],
},
],
[
'year',
{
title: 'This year',
title: i18n.t('Last year'),
swaps: [],
},
],
[
'history',
{
title: i18n.t('History'),
swaps: [],
},
],
Expand Down

0 comments on commit e4815ca

Please sign in to comment.