From b16857c606d605c43c1c2be40aaadf84526b9673 Mon Sep 17 00:00:00 2001 From: meriadec Date: Thu, 1 Mar 2018 16:45:21 +0100 Subject: [PATCH] Split translations into namespaces. I pray it will works well. --- src/components/AccountPage.js | 10 +-- src/components/DashboardPage/AccountsOrder.js | 10 +-- src/components/DashboardPage/index.js | 12 +-- src/components/GlobalSearch.js | 2 +- src/components/IsUnlocked.js | 2 +- src/components/SelectAccount/index.js | 2 +- src/components/SettingsPage/Display.js | 8 +- src/components/SettingsPage/Profile.js | 6 +- src/components/SettingsPage/index.js | 16 ++-- src/components/SideBar/index.js | 14 ++-- src/components/TopBar.js | 4 +- src/components/TransactionsList/index.js | 10 +-- src/components/UpdateNotifier.js | 6 +- .../modals/AddAccount/ImportAccounts.js | 2 +- src/components/modals/AddAccount/index.js | 8 +- src/components/modals/Receive.js | 2 +- src/components/modals/Send.js | 10 +-- src/renderer/i18n.js | 16 ++++ static/i18n/en/accountPage.yml | 3 + static/i18n/en/accountsOrder.yml | 3 + static/i18n/en/addAccount.yml | 3 + static/i18n/en/common.yml | 11 +++ static/i18n/en/dashboard.yml | 6 ++ static/i18n/en/device.yml | 2 + static/i18n/en/language.yml | 2 + static/i18n/en/receive.yml | 1 + static/i18n/en/send.yml | 5 ++ static/i18n/en/settings.yml | 15 ++++ static/i18n/en/sidebar.yml | 2 + static/i18n/en/time.yml | 4 + static/i18n/en/transactionsList.yml | 6 ++ static/i18n/en/translation.yml | 84 ------------------- static/i18n/en/update.yml | 2 + 33 files changed, 143 insertions(+), 146 deletions(-) create mode 100644 static/i18n/en/accountPage.yml create mode 100644 static/i18n/en/accountsOrder.yml create mode 100644 static/i18n/en/addAccount.yml create mode 100644 static/i18n/en/common.yml create mode 100644 static/i18n/en/dashboard.yml create mode 100644 static/i18n/en/device.yml create mode 100644 static/i18n/en/language.yml create mode 100644 static/i18n/en/receive.yml create mode 100644 static/i18n/en/send.yml create mode 100644 static/i18n/en/settings.yml create mode 100644 static/i18n/en/sidebar.yml create mode 100644 static/i18n/en/time.yml create mode 100644 static/i18n/en/transactionsList.yml delete mode 100644 static/i18n/en/translation.yml create mode 100644 static/i18n/en/update.yml diff --git a/src/components/AccountPage.js b/src/components/AccountPage.js index 91822a36..2f94a9e3 100644 --- a/src/components/AccountPage.js +++ b/src/components/AccountPage.js @@ -59,7 +59,7 @@ class AccountPage extends PureComponent { - {t('send.title')} + {t('send:title')} diff --git a/src/components/SettingsPage/index.js b/src/components/SettingsPage/index.js index 44bd987a..c71fd562 100644 --- a/src/components/SettingsPage/index.js +++ b/src/components/SettingsPage/index.js @@ -66,49 +66,49 @@ class SettingsPage extends PureComponent { return ( - {t('settings.title')} + {t('settings:title')} , }, { key: 'money', isDisabled: true, - title: t('settings.tabs.money'), + title: t('settings:tabs.money'), render: () =>
{'Monnaie'}
, }, { key: 'material', isDisabled: true, - title: t('settings.tabs.material'), + title: t('settings:tabs.material'), render: () =>
{'Matériel'}
, }, { key: 'app', isDisabled: true, - title: t('settings.tabs.app'), + title: t('settings:tabs.app'), render: () =>
{'App (beta)'}
, }, { key: 'tools', isDisabled: true, - title: t('settings.tabs.tools'), + title: t('settings:tabs.tools'), render: () =>
{'Outils'}
, }, { key: 'blockchain', isDisabled: true, - title: t('settings.tabs.blockchain'), + title: t('settings:tabs.blockchain'), render: () =>
{'Blockchain'}
, }, { key: 'profile', - title: t('settings.tabs.profile'), + title: t('settings:tabs.profile'), render: () => , }, ]} diff --git a/src/components/SideBar/index.js b/src/components/SideBar/index.js index 9d6af555..ffbafb06 100644 --- a/src/components/SideBar/index.js +++ b/src/components/SideBar/index.js @@ -73,26 +73,26 @@ class SideBar extends PureComponent { - {t('sidebar.menu')} + {t('sidebar:menu')} } linkTo="/"> - {t('dashboard.title')} + {t('dashboard:title')} } modal={MODAL_SEND}> - {t('send.title')} + {t('send:title')} } modal={MODAL_RECEIVE}> - {t('receive.title')} + {t('receive:title')} } linkTo="/settings"> - {t('settings.title')} + {t('settings:title')} - {t('sidebar.accounts')} - t('addAccount.title')} offset={[0, 1]}> + {t('sidebar:accounts')} + t('addAccount:title')} offset={[0, 1]}> openModal(MODAL_ADD_ACCOUNT)}> diff --git a/src/components/TopBar.js b/src/components/TopBar.js index db0024cb..5bb3bced 100644 --- a/src/components/TopBar.js +++ b/src/components/TopBar.js @@ -168,14 +168,14 @@ class TopBar extends PureComponent { items={[ { key: 'profile', - label: t('mainDropdown.editProfile'), + label: t('common:editProfile'), icon: , }, ...(hasPassword ? [ { key: 'lock', - label: t('mainDropdown.lockApplication'), + label: t('common:lockApplication'), icon: , onClick: this.handleLock, }, diff --git a/src/components/TransactionsList/index.js b/src/components/TransactionsList/index.js index a3a5bef7..b3e98b59 100644 --- a/src/components/TransactionsList/index.js +++ b/src/components/TransactionsList/index.js @@ -126,7 +126,7 @@ const Transaction = ({ }} > - {tx.balance > 0 ? t('transactionsList.from') : t('transactionsList.to')} + {tx.balance > 0 ? t('transactionsList:from') : t('transactionsList:to')} { return ( - {t('transactionsList.date')} + {t('transactionsList:date')} {withAccounts && ( - {t('transactionsList.account')} + {t('transactionsList:account')} )} - {t('transactionsList.address')} + {t('transactionsList:address')} - {t('transactionsList.amount')} + {t('transactionsList:amount')} diff --git a/src/components/UpdateNotifier.js b/src/components/UpdateNotifier.js index fbce9be9..ae3fda7c 100644 --- a/src/components/UpdateNotifier.js +++ b/src/components/UpdateNotifier.js @@ -57,12 +57,12 @@ class UpdateNotifier extends PureComponent { case 'downloaded': return ( - {t('update.newVersionReady')} + {t('update:newVersionReady')} sendEvent('msg', 'updater.quitAndInstall')} + onClick={() => sendEvent('msg', 'updater:quitAndInstall')} > - {t('update.relaunch')} + {t('update:relaunch')} ) diff --git a/src/components/modals/AddAccount/ImportAccounts.js b/src/components/modals/AddAccount/ImportAccounts.js index ccc893c1..706727bb 100644 --- a/src/components/modals/AddAccount/ImportAccounts.js +++ b/src/components/modals/AddAccount/ImportAccounts.js @@ -27,7 +27,7 @@ class ImportAccounts extends PureComponent { accountsSelected: [], accountsName: this.props.accounts.reduce((result, value, index) => { result[value.id] = { - placeholder: this.props.t(`addAccount.import.placeholder`, { + placeholder: this.props.t(`addAccount:placeholder`, { index: index + 1, }), } diff --git a/src/components/modals/AddAccount/index.js b/src/components/modals/AddAccount/index.js index 025e73f0..251752cb 100644 --- a/src/components/modals/AddAccount/index.js +++ b/src/components/modals/AddAccount/index.js @@ -45,9 +45,9 @@ const Steps = { - +