Skip to content

Commit

Permalink
[DDW-621] Improve currency Japanese translations (#2497)
Browse files Browse the repository at this point in the history
* [DDW-621] Add the JP key to the currencies

* [DDW-621] CHANGELOG

* [DDW-621] Add code field for jaJP

* [DDW-621] Implement Raw and Localized currencies

* [DDW-621] Update UI for Localized currency

* [DDW-621] Remove temporary JA values

* [DDW-621] English as fallback values

* [DDW-621] Japanese values and adjustments

* [DDW-621] Simplify code

* [DDW-621] Simplify code

* [DDW-621] Fixes CHANGELOG

* [DDW-621] Fix CHANGELOG

Co-authored-by: Nikola Glumac <niglumac@gmail.com>
  • Loading branch information
thedanheller and nikolaglumac committed Apr 13, 2021
1 parent fff4faf commit 6dfd02d
Show file tree
Hide file tree
Showing 18 changed files with 809 additions and 342 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Changelog

## 4.0.5

### Features

- Added Japanese translation to the external currencies list ([PR 2497](https://github.com/input-output-hk/daedalus/pull/2497))

### Fixes

- Fixed stake pool list cutting off items ([PR 2517](https://github.com/input-output-hk/daedalus/pull/2517))
Expand Down
2 changes: 1 addition & 1 deletion source/renderer/app/actions/wallets-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class WalletsActions {
setCertificateTemplate: Action<{ selectedTemplate: string }> = new Action();
finishCertificate: Action<any> = new Action();
finishRewardsCsv: Action<any> = new Action();
setCurrencySelected: Action<{ currencySymbol: string }> = new Action();
setCurrencySelected: Action<{ currencyCode: string }> = new Action();
toggleCurrencyIsActive: Action<any> = new Action();

/* ---------- Transfer Funds ---------- */
Expand Down
5 changes: 2 additions & 3 deletions source/renderer/app/api/wallets/types.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import BigNumber from 'bignumber.js';
import { WalletUnits } from '../../domains/Wallet';
import type { ExportedByronWallet } from '../../types/walletExportTypes';
import type { Currency } from '../../types/currencyTypes';
import type { Currency, LocalizedCurrency } from '../../types/currencyTypes';
import type { AssetItems } from '../assets/types';

export type Block = {
Expand Down Expand Up @@ -316,6 +316,5 @@ export type CreateHardwareWalletRequest = {
};

export type GetCurrencyListResponse = Array<Currency>;

export type GetCurrencyRateRequest = Currency;
export type GetCurrencyRateRequest = LocalizedCurrency;
export type GetCurrencyRateResponse = number;
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Link } from 'react-polymorph/lib/components/Link';
import NormalSwitch from '../../widgets/forms/NormalSwitch';
import styles from './WalletsSettings.scss';
import { currencyConfig } from '../../../config/currencyConfig';
import type { Currency } from '../../../types/currencyTypes';
import type { LocalizedCurrency } from '../../../types/currencyTypes';

const messages = defineMessages({
currencyTitleLabel: {
Expand Down Expand Up @@ -46,7 +46,7 @@ const messages = defineMessages({
});

type Props = {
currencySelected: ?Currency,
currencySelected: ?LocalizedCurrency,
currencyList: Array<any>,
currencyIsActive: boolean,
onSelectCurrency: Function,
Expand All @@ -71,12 +71,10 @@ export default class WalletSettings extends Component<Props> {
onOpenExternalLink,
} = this.props;

const currencyOptions = map(currencyList, ({ symbol, name }) => {
return {
label: `${symbol.toUpperCase()} - ${name}`,
value: symbol,
};
});
const currencyOptions = map(currencyList, ({ code, name }) => ({
label: `${code.toUpperCase()} - ${name}`,
value: code,
}));

return (
<div className={styles.component}>
Expand Down Expand Up @@ -104,7 +102,7 @@ export default class WalletSettings extends Component<Props> {
</div>
<Select
label={intl.formatMessage(messages.currencySelectLabel)}
value={currencySelected ? currencySelected.symbol : null}
value={currencySelected ? currencySelected.code : null}
options={currencyOptions}
onChange={onSelectCurrency}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ export default class WalletSendAssetsConfirmationDialog extends Component<
</div>
<div className={styles.adaAmount}>
{amount}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand All @@ -513,7 +513,7 @@ export default class WalletSendAssetsConfirmationDialog extends Component<
</div>
<div className={styles.fees}>
+{transactionFee}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand All @@ -526,7 +526,7 @@ export default class WalletSendAssetsConfirmationDialog extends Component<
</div>
<div className={styles.totalAmount}>
{totalAmount}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand All @@ -539,7 +539,7 @@ export default class WalletSendAssetsConfirmationDialog extends Component<
</div>
<div className={styles.fees}>
+{transactionFee}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ export default class WalletSendConfirmationDialog extends Component<
</div>
<div className={styles.amount}>
{amount}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand All @@ -344,7 +344,7 @@ export default class WalletSendConfirmationDialog extends Component<
</div>
<div className={styles.fees}>
+{transactionFee}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
&nbsp;{currencyUnit}
</span>
</div>
Expand All @@ -357,9 +357,7 @@ export default class WalletSendConfirmationDialog extends Component<
</div>
<div className={styles.totalAmount}>
{totalAmount}
<span className={styles.currencySymbol}>
&nbsp;{currencyUnit}
</span>
<span className={styles.currencyCode}>&nbsp;{currencyUnit}</span>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export default class WalletSummaryCurrency extends Component<Props> {
decimalDigits
);
const currencyWalletAmountSymbol = currencySelected
? currencySelected.symbol.toUpperCase()
? currencySelected.code.toUpperCase()
: '';
const fetchedTimeAgo = moment(currencyLastFetched)
.locale(intl.locale)
Expand All @@ -99,7 +99,7 @@ export default class WalletSummaryCurrency extends Component<Props> {
</div>
<div className={styles.currencyWalletAmount}>
{currencyWalletAmount}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
{currencyWalletAmountSymbol}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default class WalletSummaryHeader extends Component<Props> {
<div className={walletNameStyles}>{wallet.name}</div>
<div className={walletAmountStyles}>
{walletAmount}
<span className={styles.currencySymbol}>
<span className={styles.currencyCode}>
{intl.formatMessage(globalMessages.unitAda)}
</span>
</div>
Expand Down

0 comments on commit 6dfd02d

Please sign in to comment.