From dc00c4ce9149acd56ea0aa44abef78f281868c36 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 18 Nov 2016 23:32:42 +0100 Subject: [PATCH 01/32] TabBar & Settings -> Views i18n enabled --- js/package.json | 1 + js/src/i18n/en/index.js | 21 +++++++++ js/src/i18n/en/settings.js | 52 +++++++++++++++++++++++ js/src/i18n/i18n.js | 31 ++++++++++++++ js/src/i18n/index.js | 22 ++++++++++ js/src/index.js | 3 ++ js/src/views/Application/TabBar/tabBar.js | 27 +++--------- js/src/views/Settings/Views/defaults.js | 28 +++--------- js/src/views/Settings/Views/views.js | 13 +++--- 9 files changed, 151 insertions(+), 47 deletions(-) create mode 100644 js/src/i18n/en/index.js create mode 100644 js/src/i18n/en/settings.js create mode 100644 js/src/i18n/i18n.js create mode 100644 js/src/i18n/index.js diff --git a/js/package.json b/js/package.json index 9a45fbf1877..b0f483b7195 100644 --- a/js/package.json +++ b/js/package.json @@ -149,6 +149,7 @@ "react-chartjs-2": "^1.5.0", "react-dom": "~15.3.2", "react-dropzone": "^3.7.3", + "react-i18nify": "^1.6.3", "react-redux": "^4.4.5", "react-router": "^2.6.1", "react-router-redux": "^4.0.5", diff --git a/js/src/i18n/en/index.js b/js/src/i18n/en/index.js new file mode 100644 index 00000000000..d8c0f9b4b20 --- /dev/null +++ b/js/src/i18n/en/index.js @@ -0,0 +1,21 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import settings from './settings'; + +export default { + settings +}; diff --git a/js/src/i18n/en/settings.js b/js/src/i18n/en/settings.js new file mode 100644 index 00000000000..4c0f544ebf6 --- /dev/null +++ b/js/src/i18n/en/settings.js @@ -0,0 +1,52 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default { + views: { + overview_0: 'Manage the available application views, using only the parts of the application that is applicable to you.', + overview_1: 'Are you an end-user? The defaults are setups for both beginner and advanced users alike.', + overview_2: 'Are you a developer? Add some features to manage contracts are interact with application deployments.', + overview_3: 'Are you a miner or run a large-scale node? Add the features to give you all the information needed to watch the node operation.', + accounts: { + label: 'Accounts', + description: 'A list of all the accounts associated to and imported into this Parity instance. Send transactions, receive incoming values, manage your balances and fund your accounts.' + }, + addresses: { + label: 'Addressbook', + description: 'A list of all contacts and address book entries that is managed by this Parity instance. Watch accounts and have the details available at the click of a button when transacting.' + }, + apps: { + label: 'Applications', + description: 'Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.' + }, + contracts: { + label: 'Contracts', + description: 'Watch and interact with specific contracts that have been deployed on the network. This is a more technically-focused environment, specifically for advanced users that understand the inner working of certain contracts.' + }, + status: { + label: 'Status', + description: 'See how the Parity node is performing in terms of connections to the network, logs from the actual running instance and details of mining (if enabled and configured).' + }, + signer: { + label: 'Signer', + description: 'The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by distributed applications.' + }, + settings: { + label: 'Settings', + description: 'This view. Allows you to customize the application in term of options, operation and look and feel.' + } + } +}; diff --git a/js/src/i18n/i18n.js b/js/src/i18n/i18n.js new file mode 100644 index 00000000000..34ada8a4197 --- /dev/null +++ b/js/src/i18n/i18n.js @@ -0,0 +1,31 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import { I18n } from 'react-i18nify'; + +import en from './en'; + +export function initLocales (locale = 'en') { + I18n.setTranslations({ + en + }); + + setLocale(locale); +} + +export function setLocale (locale) { + I18n.setLocale(locale); +} diff --git a/js/src/i18n/index.js b/js/src/i18n/index.js new file mode 100644 index 00000000000..aa6c258c91f --- /dev/null +++ b/js/src/i18n/index.js @@ -0,0 +1,22 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import { initLocales, setLocale } from './i18n'; + +export { + initLocales, + setLocale +}; diff --git a/js/src/index.js b/js/src/index.js index fda78584239..f361aa18200 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -29,6 +29,9 @@ import qs from 'querystring'; import SecureApi from './secureApi'; import ContractInstances from './contracts'; +import { initLocales } from './i18n'; + +initLocales('en'); import { initStore } from './redux'; import { ContextProvider, muiTheme } from './ui'; diff --git a/js/src/views/Application/TabBar/tabBar.js b/js/src/views/Application/TabBar/tabBar.js index 01ca4df0d51..069f9e104c7 100644 --- a/js/src/views/Application/TabBar/tabBar.js +++ b/js/src/views/Application/TabBar/tabBar.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; @@ -89,7 +90,7 @@ class TabBar extends Component { .filter((id) => settings.views[id].fixed || settings.views[id].active) .map((id) => { const view = settings.views[id]; - let label = this.renderLabel(view.label); + let label = this.renderLabel(id); let body = null; if (id === 'accounts') { @@ -97,9 +98,7 @@ class TabBar extends Component { ); } else if (id === 'signer') { - label = this.renderSignerLabel(label); - } else if (id === 'status') { - label = this.renderStatusLabel(label); + label = this.renderSignerLabel(id); } return ( @@ -124,16 +123,16 @@ class TabBar extends Component { ); } - renderLabel = (name, bubble) => { + renderLabel = (id, bubble) => { return (
- { name } + { bubble }
); } - renderSignerLabel = (label) => { + renderSignerLabel = (id) => { const { pending } = this.props; let bubble = null; @@ -146,19 +145,7 @@ class TabBar extends Component { ); } - return this.renderLabel(label, bubble); - } - - renderStatusLabel = (label) => { - // const { isTest, netChain } = this.props; - // const bubble = ( - // - // ); - - return this.renderLabel(label, null); + return this.renderLabel(id, bubble); } onActivate = (activeRoute) => { diff --git a/js/src/views/Settings/Views/defaults.js b/js/src/views/Settings/Views/defaults.js index dce593d2b8f..9c7971ce514 100644 --- a/js/src/views/Settings/Views/defaults.js +++ b/js/src/views/Settings/Views/defaults.js @@ -28,66 +28,52 @@ const defaultViews = { active: true, fixed: true, icon: , - label: 'Accounts', route: '/accounts', - value: 'account', - description: 'A list of all the accounts associated to and imported into this Parity instance. Send transactions, receive incoming values, manage your balances and fund your accounts.' + value: 'account' }, addresses: { active: true, icon: , - label: 'Addressbook', route: '/addresses', - value: 'address', - description: 'A list of all contacts and address book entries that is managed by this Parity instance. Watch accounts and have the details available at the click of a button when transacting.' + value: 'address' }, apps: { active: true, icon: , - label: 'Applications', route: '/apps', - value: 'app', - description: 'Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.' + value: 'app' }, contracts: { active: false, icon: , - label: 'Contracts', route: '/contracts', - value: 'contract', - description: 'Watch and interact with specific contracts that have been deployed on the network. This is a more technically-focused environment, specifically for advanced users that understand the inner working of certain contracts.' + value: 'contract' }, status: { active: false, icon: , - label: 'Status', route: '/status', - value: 'status', - description: 'See how the Parity node is performing in terms of connections to the network, logs from the actual running instance and details of mining (if enabled and configured).' + value: 'status' }, signer: { active: true, fixed: true, icon: , - label: 'Signer', route: '/signer', - value: 'signer', - description: 'The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by distributed applications.' + value: 'signer' }, settings: { active: true, fixed: true, icon: , - label: 'Settings', route: '/settings', - value: 'settings', - description: 'This view. Allows you to customize the application in term of options, operation and look and feel.' + value: 'settings' } }; diff --git a/js/src/views/Settings/Views/views.js b/js/src/views/Settings/Views/views.js index a485876c88a..1124489fc62 100644 --- a/js/src/views/Settings/Views/views.js +++ b/js/src/views/Settings/Views/views.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Checkbox } from 'material-ui'; @@ -38,10 +39,10 @@ class Views extends Component {
-
Manage the available application views, using only the parts of the application that is applicable to you.
-
Are you an end-user? The defaults are setups for both beginner and advanced users alike.
-
Are you a developer? Add some features to manage contracts are interact with application deployments.
-
Are you a miner or run a large-scale node? Add the features to give you all the information needed to watch the node operation.
+
+
+
+
{ this.renderViews() } @@ -63,7 +64,7 @@ class Views extends Component { { view.icon }
- { view.label } +
); @@ -77,7 +78,7 @@ class Views extends Component { checked={ view.active } value={ view.active } />
- { view.description } +
); From 02d23bd561e3d1fe54deeb0a4f3d0496e18ffe98 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 19 Nov 2016 00:49:40 +0100 Subject: [PATCH 02/32] Proxy i18n --- js/src/i18n/en/settings.js | 23 +++++++++++++++++++ js/src/views/Settings/Proxy/proxy.js | 34 ++++++++++++++++++++++++---- js/src/views/Settings/settings.js | 13 +++++++++-- 3 files changed, 64 insertions(+), 6 deletions(-) diff --git a/js/src/i18n/en/settings.js b/js/src/i18n/en/settings.js index 4c0f544ebf6..786b6b22561 100644 --- a/js/src/i18n/en/settings.js +++ b/js/src/i18n/en/settings.js @@ -15,11 +15,34 @@ // along with Parity. If not, see . export default { + label: 'settings', + + tabs: { + background: 'background', + parity: 'parity', + proxy: 'proxy', + views: 'views' + }, + + proxy: { + overview_0: 'The proxy setup allows you to access Parity and all associated decentralized applications via memorable addresses.', + + details_0: 'Instead of accessing Parity via the IP address and port, you will be able to access it via the .parity subdomain, by visiting ', + details_1: '. To setup subdomain-based routing, you need to add the relevant proxy entries to your browser,', + details_2: 'To learn how to configure the proxy, instructions are provided for ', + details_windows: 'Windows', + details_3: ', ', + details_macos: 'macOS', + details_4: ' or ', + details_ubuntu: 'Ubuntu' + }, + views: { overview_0: 'Manage the available application views, using only the parts of the application that is applicable to you.', overview_1: 'Are you an end-user? The defaults are setups for both beginner and advanced users alike.', overview_2: 'Are you a developer? Add some features to manage contracts are interact with application deployments.', overview_3: 'Are you a miner or run a large-scale node? Add the features to give you all the information needed to watch the node operation.', + accounts: { label: 'Accounts', description: 'A list of all the accounts associated to and imported into this Parity instance. Send transactions, receive incoming values, manage your balances and fund your accounts.' diff --git a/js/src/views/Settings/Proxy/proxy.js b/js/src/views/Settings/Proxy/proxy.js index 69e415d1f74..fd611defa58 100644 --- a/js/src/views/Settings/Proxy/proxy.js +++ b/js/src/views/Settings/Proxy/proxy.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { Container, ContainerTitle } from '../../../ui'; @@ -35,13 +36,38 @@ export default class Proxy extends Component {
-
The proxy setup allows you to access Parity and all associated decentralized applications via memorable addresses.
+
-
Instead of accessing Parity via the IP address and port, you will be able to access it via the .parity subdomain, by visiting http://home.parity/. To setup subdomain-based routing, you need to add the relevant proxy entries to your browser,
- -
To learn how to configure the proxy, instructions are provided for Windows, Max OS X or Ubuntu.
+
+ + http://home.parity/ + +
+ +
+ + + + + + + + + + + + +
diff --git a/js/src/views/Settings/settings.js b/js/src/views/Settings/settings.js index 4b38b1ccf7c..423741aaa05 100644 --- a/js/src/views/Settings/settings.js +++ b/js/src/views/Settings/settings.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { Tab, Tabs } from 'material-ui'; import ActionSettingsEthernet from 'material-ui/svg-icons/action/settings-ethernet'; import ImageBlurOn from 'material-ui/svg-icons/image/blur-on'; @@ -40,13 +41,15 @@ export default class Settings extends Component { const isProxied = window.location.hostname.indexOf('.parity') !== -1; let proxy = null; + const title = ; + if (!isProxied) { proxy = this.renderTab(hash, 'proxy', ); } return (
- + { this.renderTab(hash, 'views', ) } { this.renderTab(hash, 'background', ) } @@ -62,13 +65,19 @@ export default class Settings extends Component { } renderTab (hash, section, icon) { + const label = ( +
+ +
+ ); + return ( { section }
} + label={ label } onActive={ this.onActivate(section) } /> ); } From 92d49ef3b6a484e712b273f13a21dcc5d9d278c1 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sat, 19 Nov 2016 01:20:16 +0100 Subject: [PATCH 03/32] Settings i18n --- js/src/i18n/en/settings.js | 40 ++++++++++++++-- .../views/Settings/Background/background.js | 12 +++-- js/src/views/Settings/Parity/parity.js | 47 +++++++++---------- js/src/views/Settings/Proxy/proxy.js | 3 +- js/src/views/Settings/Views/views.js | 4 +- js/src/views/Settings/settings.js | 2 +- 6 files changed, 71 insertions(+), 37 deletions(-) diff --git a/js/src/i18n/en/settings.js b/js/src/i18n/en/settings.js index 786b6b22561..d666fd83a05 100644 --- a/js/src/i18n/en/settings.js +++ b/js/src/i18n/en/settings.js @@ -17,14 +17,42 @@ export default { label: 'settings', - tabs: { - background: 'background', - parity: 'parity', - proxy: 'proxy', - views: 'views' + background: { + label: 'background', + + overview_0: 'The background pattern you can see right now is unique to your Parity installation. It will change every time you create a new Signer token. This is so that decentralized applications cannot pretend to be trustworthy.', + overview_1: 'Pick a pattern you like and memorize it. This Pattern will always be shown from now on, unless you clear your browser cache or use a new Signer token.', + + button_more: 'generate more' + }, + + parity: { + label: 'parity', + + overview_0: 'Control the Parity node settings and mode of operation via this interface.', + + languages: { + label: 'UI language', + hint: 'the language this interface is displayed with', + + language_en: 'English', + language_de: 'German' + }, + + modes: { + label: 'mode of operation', + hint: 'the syning mode for the Parity node', + + mode_active: 'Parity continuously syncs the chain', + mode_passive: 'Parity syncs initially, then sleeps and wakes regularly to resync', + mode_dark: 'Parity syncs only when the RPC is active', + mode_offline: 'Parity doesn\'t sync' + } }, proxy: { + label: 'proxy', + overview_0: 'The proxy setup allows you to access Parity and all associated decentralized applications via memorable addresses.', details_0: 'Instead of accessing Parity via the IP address and port, you will be able to access it via the .parity subdomain, by visiting ', @@ -38,6 +66,8 @@ export default { }, views: { + label: 'views', + overview_0: 'Manage the available application views, using only the parts of the application that is applicable to you.', overview_1: 'Are you an end-user? The defaults are setups for both beginner and advanced users alike.', overview_2: 'Are you a developer? Add some features to manage contracts are interact with application deployments.', diff --git a/js/src/views/Settings/Background/background.js b/js/src/views/Settings/Background/background.js index e34c5d348f3..95a55e34b57 100644 --- a/js/src/views/Settings/Background/background.js +++ b/js/src/views/Settings/Background/background.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import NavigationRefresh from 'material-ui/svg-icons/navigation/refresh'; @@ -54,17 +55,20 @@ class Background extends Component { } render () { + const title = ; + const labelMore = ; + return ( - +
-
The background pattern you can see right now is unique to your Parity installation. It will change every time you create a new Signer token. This is so that decentralized applications cannot pretend to be trustworthy.
-
Pick a pattern you like and memorize it. This Pattern will always be shown from now on, unless you clear your browser cache or use a new Signer token.
+
+
diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index abec8cc8ac3..b709e87ba9b 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -15,18 +15,14 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { Translate } from 'react-i18nify'; import { MenuItem } from 'material-ui'; import { Select, Container, ContainerTitle } from '../../../ui'; import layout from '../layout.css'; -const MODES = { - 'active': 'Parity continuously syncs the chain', - 'passive': 'Parity syncs initially, then sleeps and wakes regularly to resync', - 'dark': 'Parity syncs only when the RPC is active', - 'offline': 'Parity doesn\'t sync' -}; +const MODES = ['active', 'passive', 'dark', 'offline']; export default class Parity extends Component { static contextTypes = { @@ -42,12 +38,14 @@ export default class Parity extends Component { } render () { + const title = ; + return ( - +
-
Control the Parity node settings and mode of operation via this interface.
+
{ this.renderModes() } @@ -58,27 +56,26 @@ export default class Parity extends Component { } renderModes () { - const modes = Object - .keys(MODES) - .map((mode) => { - const description = MODES[mode]; - - return ( - - { description } - - ); - }); - + const modes = MODES.map((mode) => { + const label = ; + + return ( + + { label } + + ); + }); const { mode } = this.state; + const label = ; + const hint = ; return ( + { this.renderOptions() } + + ); + } + + renderOptions () { + return LOCALES.map((locale) => { + const label = ; + + return ( + + { label } + + ); + }); + } + + onChange = (event, index, locale) => { + this.setState({ locale }, () => { + setLocale(locale); + }); + } +} diff --git a/js/src/ui/Translate/index.js b/js/src/ui/Translate/index.js new file mode 100644 index 00000000000..ba797bbd1fe --- /dev/null +++ b/js/src/ui/Translate/index.js @@ -0,0 +1,17 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default from './translate'; diff --git a/js/src/i18n/translate.js b/js/src/ui/Translate/translate.js similarity index 100% rename from js/src/i18n/translate.js rename to js/src/ui/Translate/translate.js diff --git a/js/src/ui/index.js b/js/src/ui/index.js index d443d0dbc75..6264f3f349e 100644 --- a/js/src/ui/index.js +++ b/js/src/ui/index.js @@ -32,6 +32,7 @@ import Errors from './Errors'; import Form, { AddressSelect, FormWrap, TypedInput, Input, InputAddress, InputAddressSelect, InputChip, InputInline, Select, RadioButtons } from './Form'; import IdentityIcon from './IdentityIcon'; import IdentityName from './IdentityName'; +import LanguageSelector from './LanguageSelector'; import MethodDecoding from './MethodDecoding'; import Modal, { Busy as BusyStep, Completed as CompletedStep } from './Modal'; import muiTheme from './Theme'; @@ -40,6 +41,7 @@ import ParityBackground from './ParityBackground'; import SignerIcon from './SignerIcon'; import Tags from './Tags'; import Tooltips, { Tooltip } from './Tooltips'; +import Translate from './Translate'; import TxHash from './TxHash'; export { @@ -71,6 +73,7 @@ export { Select, IdentityIcon, IdentityName, + LanguageSelector, MethodDecoding, Modal, BusyStep, @@ -83,5 +86,6 @@ export { Tags, Tooltip, Tooltips, + Translate, TxHash }; From ec07cabc90d0564f233dab72fd13f2d2043a5b1d Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 11:55:01 +0100 Subject: [PATCH 08/32] Update location & proptypes --- js/src/ui/Actionbar/actionbar.js | 4 +++- js/src/ui/Form/Select/select.js | 8 +++++--- js/src/views/Application/TabBar/tabBar.js | 3 +-- js/src/views/Settings/Background/background.js | 3 +-- js/src/views/Settings/Parity/parity.js | 3 +-- js/src/views/Settings/Proxy/proxy.js | 3 +-- js/src/views/Settings/Views/views.js | 3 +-- js/src/views/Settings/settings.js | 3 +-- 8 files changed, 14 insertions(+), 16 deletions(-) diff --git a/js/src/ui/Actionbar/actionbar.js b/js/src/ui/Actionbar/actionbar.js index c3fbe6a1898..9e01e0b9902 100644 --- a/js/src/ui/Actionbar/actionbar.js +++ b/js/src/ui/Actionbar/actionbar.js @@ -17,11 +17,13 @@ import React, { Component, PropTypes } from 'react'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; +import { nodeOrString } from '../../util/proptypes'; + import styles from './actionbar.css'; export default class Actionbar extends Component { static propTypes = { - title: PropTypes.string, + title: nodeOrString(), buttons: PropTypes.array, children: PropTypes.node, className: PropTypes.string diff --git a/js/src/ui/Form/Select/select.js b/js/src/ui/Form/Select/select.js index cb879e3f7d3..fc9ccddb9f4 100644 --- a/js/src/ui/Form/Select/select.js +++ b/js/src/ui/Form/Select/select.js @@ -17,6 +17,8 @@ import React, { Component, PropTypes } from 'react'; import { SelectField } from 'material-ui'; +import { nodeOrString } from '../../../util/proptypes'; + // TODO: duplicated in Input const UNDERLINE_DISABLED = { borderColor: 'rgba(255, 255, 255, 0.298039)' // 'transparent' // 'rgba(255, 255, 255, 0.298039)' @@ -33,9 +35,9 @@ export default class Select extends Component { children: PropTypes.node, className: PropTypes.string, disabled: PropTypes.bool, - error: PropTypes.string, - hint: PropTypes.string, - label: PropTypes.string, + error: nodeOrString(), + hint: nodeOrString(), + label: nodeOrString(), onBlur: PropTypes.func, onChange: PropTypes.func, onKeyDown: PropTypes.func, diff --git a/js/src/views/Application/TabBar/tabBar.js b/js/src/views/Application/TabBar/tabBar.js index e8232f7fdcf..d3af986d4d5 100644 --- a/js/src/views/Application/TabBar/tabBar.js +++ b/js/src/views/Application/TabBar/tabBar.js @@ -20,8 +20,7 @@ import { bindActionCreators } from 'redux'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; import { Tabs, Tab } from 'material-ui/Tabs'; -import { Translate } from '../../../i18n'; -import { Badge, Tooltip } from '../../../ui'; +import { Badge, Tooltip, Translate } from '../../../ui'; import styles from './tabBar.css'; import imagesEthcoreBlock from '../../../../assets/images/parity-logo-white-no-text.svg'; diff --git a/js/src/views/Settings/Background/background.js b/js/src/views/Settings/Background/background.js index cd56a1e7b75..8e8fee6da83 100644 --- a/js/src/views/Settings/Background/background.js +++ b/js/src/views/Settings/Background/background.js @@ -19,8 +19,7 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import NavigationRefresh from 'material-ui/svg-icons/navigation/refresh'; -import { Translate } from '../../../i18n'; -import { Button, Container, ContainerTitle, ParityBackground } from '../../../ui'; +import { Button, Container, ContainerTitle, ParityBackground, Translate } from '../../../ui'; import { updateBackground } from '../actions'; diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index d4571059d20..eda70dd0178 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -17,8 +17,7 @@ import React, { Component, PropTypes } from 'react'; import { MenuItem } from 'material-ui'; -import { Translate } from '../../../i18n'; -import { Select, Container, ContainerTitle } from '../../../ui'; +import { Select, Container, ContainerTitle, Translate } from '../../../ui'; import layout from '../layout.css'; diff --git a/js/src/views/Settings/Proxy/proxy.js b/js/src/views/Settings/Proxy/proxy.js index dbddf3c27c3..fbd2090e231 100644 --- a/js/src/views/Settings/Proxy/proxy.js +++ b/js/src/views/Settings/Proxy/proxy.js @@ -16,8 +16,7 @@ import React, { Component, PropTypes } from 'react'; -import { Translate } from '../../../i18n'; -import { Container, ContainerTitle } from '../../../ui'; +import { Container, ContainerTitle, Translate } from '../../../ui'; import layout from '../layout.css'; import styles from './proxy.css'; diff --git a/js/src/views/Settings/Views/views.js b/js/src/views/Settings/Views/views.js index 90828f6cc5c..ad752758fdb 100644 --- a/js/src/views/Settings/Views/views.js +++ b/js/src/views/Settings/Views/views.js @@ -19,8 +19,7 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Checkbox } from 'material-ui'; -import { Translate } from '../../../i18n'; -import { Container, ContainerTitle } from '../../../ui'; +import { Container, ContainerTitle, Translate } from '../../../ui'; import { toggleView } from '../actions'; diff --git a/js/src/views/Settings/settings.js b/js/src/views/Settings/settings.js index a317e66e471..c119410475b 100644 --- a/js/src/views/Settings/settings.js +++ b/js/src/views/Settings/settings.js @@ -20,8 +20,7 @@ import ActionSettingsEthernet from 'material-ui/svg-icons/action/settings-ethern import ImageBlurOn from 'material-ui/svg-icons/image/blur-on'; import ImageRemoveRedEye from 'material-ui/svg-icons/image/remove-red-eye'; -import { Translate } from '../../i18n'; -import { Actionbar, Page } from '../../ui'; +import { Actionbar, Page, Translate } from '../../ui'; import imagesEthcoreBlock from '../../../assets/images/parity-logo-white-no-text.svg'; import styles from './settings.css'; From f0b5e748939cd8ace3da56b89ce481f1bfa4044a Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Mon, 21 Nov 2016 11:56:41 +0100 Subject: [PATCH 09/32] Add UI Language selector --- js/src/views/Settings/Parity/parity.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index eda70dd0178..5ff908b634c 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -17,7 +17,7 @@ import React, { Component, PropTypes } from 'react'; import { MenuItem } from 'material-ui'; -import { Select, Container, ContainerTitle, Translate } from '../../../ui'; +import { Select, Container, ContainerTitle, LanguageSelector, Translate } from '../../../ui'; import layout from '../layout.css'; @@ -47,6 +47,7 @@ export default class Parity extends Component {
+ { this.renderModes() }
From a0af3218d2e5e35eb3f8692022033d9904bc919c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 13:57:28 +0100 Subject: [PATCH 10/32] German settings pages --- js/src/i18n/de/index.js | 21 ++++++++ js/src/i18n/de/settings.js | 105 +++++++++++++++++++++++++++++++++++++ js/src/i18n/i18n.js | 3 +- 3 files changed, 128 insertions(+), 1 deletion(-) create mode 100644 js/src/i18n/de/index.js create mode 100644 js/src/i18n/de/settings.js diff --git a/js/src/i18n/de/index.js b/js/src/i18n/de/index.js new file mode 100644 index 00000000000..d8c0f9b4b20 --- /dev/null +++ b/js/src/i18n/de/index.js @@ -0,0 +1,21 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import settings from './settings'; + +export default { + settings +}; diff --git a/js/src/i18n/de/settings.js b/js/src/i18n/de/settings.js new file mode 100644 index 00000000000..3b4725c0b28 --- /dev/null +++ b/js/src/i18n/de/settings.js @@ -0,0 +1,105 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default { + label: 'Einstellungen', + + background: { + label: 'Hintergrund', + + overview_0: 'Dein Hintergrundmuster ist einzigartig und beruht auf deiner Parity Installation. Es ändert sich jedes Mal dann, wenn du einen neuen Signer token erstellst. Dies stellt sicher, dass dezentrale Applicationen keine Vertrauenswürdigkeit vortäuschen können.', + overview_1: 'Such dir ein Muster aus und merke es dir. Dieses Muster wird dir nun immer angezeigt, ausser du löschst deinen Browser Cache oder benutzt einen neuen Signer token.', + + button_more: 'weitere generieren' + }, + + parity: { + label: 'Parity', + + overview_0: 'Diese Einstellungen verändern das Verhalten deines Parity-Knotens.', + + languages: { + label: 'Anzeigesprache', + hint: 'die Sprache, in der dir diese Obefläche angezeigt wird', + + language_en: 'English', + language_de: 'Deutsch' + }, + + modes: { + label: 'Betriebsmodus', + hint: 'der Synchronisations-Modus deines Parity Knotens', + + mode_active: 'Parity synchronisiert kontinuierlich die Blockchain', + mode_passive: 'Parity synchronisiert zunächst, schläft dann und wacht regelmäßig zum Synchronisieren auf', + mode_dark: 'Parity synchronisiert nur, falls erforderlich - beim Aufruf einer fernen Prozedur (RPC)', + mode_offline: "Parity synchronisiert nicht" + } + }, + + proxy: { + label: 'Proxy', + + overview_0: 'Die Proxy-Einstellungen ermöglichen dir einfachen Zugriff auf die Parity-Oberfläche mit all ihren dezentralen Anwendungen über einprägsame Adressen.', + + details_0: 'Anstelle des Zugriffs über IP-Adresse und Port wirst du über die .parity Subdomain auf die Parity Oberfläche zugreifen können, indem du ', + details_1: 'besuchst. Dafür musst du folgenden Eintrag in den Proxy-Einstellungen deines Browsers hinzufügen:', + details_2: 'Hier findest du Anleitungen zum Anpassen der Proxy-Einstellungen in ', + details_windows: 'Windows', + details_3: ', ', + details_macos: 'macOS', + details_4: ' oder ', + details_ubuntu: 'Ubuntu' + }, + + views: { + label: 'Ansicht', + + overview_0: 'Hier kannst du einstellen, welche Teile der Parity-Oberfläche dir angezeigt werden sollen.', + overview_1: 'Bist du Endnutzer? Die Standardeinstellungen sind gleichermaßen für Einsteiger als auch fortgeschrittene Nutzer gedacht.', + overview_2: 'Bist du Entwickler? Füge z.B. den Verträge-Reiter zu deiner Ansicht hinzu.', + overview_3: 'Bist du Miner oder betreibst du einen großangelegten Knoten? Füge den Status-Reiter hinzu, um alle Information über den Betrieb deines Knotens im Blick zu halten.', + + accounts: { + label: 'Konten', + description: 'Eine Liste aller Konten, die mit dieser Instanz von Parity verbunden sind. Sende Transaktionen, empfange eingehende Beträge, verwalte deinen Kontostand oder lade dein Konto auf.' + }, + addresses: { + label: 'Adressbuch', + description: 'Eine Liste all deiner Kontakte und Adressbucheinträge, die von dieser Instanz von Parity verwaltet werden. Überwache Konten und gelange mit nur einem Klick zu Details deiner Transaktionen.' + }, + apps: { + label: 'Anwendungen', + description: 'Dezentrale Anwendungen, die mit dem Netzwerk interagieren. Füge Anwendungen hinzu oder verwalte und interagiere mit bestehenden Anwendungen.' + }, + contracts: { + label: 'Verträge', + description: 'Überwache und interagiere mit Verträgen, die im Netzwerk installiert wurden. Dies ist eine technisch fokussierte Umgebung, die auf fortgeschrittene Benutzer mit gutem Verständnis der Fuktionsweise von Verträgen zugeschnitten ist.' + }, + status: { + label: 'Status', + description: 'Schau dir an, wie sich dein Parity Knoten schlägt. Hier findest du z.B. die Anzahl der aktuellen Verbindungen zum Netzwerk, Logs deiner laufenden Instanz und Mining Details (sofern eingeschaltet and konfiguriert).' + }, + signer: { + label: 'Signer', + description: 'Dies ist der sichere Bereich zum Verwalten deiner Transaktionen. Hier kannst du Transaktionen, die von dir oder deinen Anwendungen angestoßen wurden, prüfen und dann genehmigen oder ablehnen.' + }, + settings: { + label: 'Einstellungen', + description: 'Die aktuelle Seite, die dir erlaubt, die Parity Oberfläche nach deinen Wünschen anzupassen.' + } + } +}; diff --git a/js/src/i18n/i18n.js b/js/src/i18n/i18n.js index dfbbf7d88df..86ff55e25cf 100644 --- a/js/src/i18n/i18n.js +++ b/js/src/i18n/i18n.js @@ -16,13 +16,14 @@ import { I18n } from 'react-i18nify'; +import de from './de'; import en from './en'; let currentLocale = null; export function initLocales (defaultLocale = 'en') { I18n.setTranslations({ - en + de, en }); setLocale(defaultLocale); From 5ff074d9fb3d3b2c8546401ef2c23fdcb32b2dd3 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 14:03:35 +0100 Subject: [PATCH 11/32] Add German language selection --- js/src/ui/LanguageSelector/languageSelector.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/src/ui/LanguageSelector/languageSelector.js b/js/src/ui/LanguageSelector/languageSelector.js index cd168e6d550..640179084c5 100644 --- a/js/src/ui/LanguageSelector/languageSelector.js +++ b/js/src/ui/LanguageSelector/languageSelector.js @@ -21,7 +21,9 @@ import Select from '../Form/Select'; import Translate from '../Translate'; import { getLocale, setLocale } from '../../i18n'; -const LOCALES = ['en']; +const LOCALES = [ + 'en', 'de' +]; export default class LanguageSelector extends Component { state = { From 713b649dfb275e220c05ebc9fe9d2f12fa61c634 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 14:22:45 +0100 Subject: [PATCH 12/32] Corrected umlaut encoding --- js/src/i18n/de/settings.js | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/js/src/i18n/de/settings.js b/js/src/i18n/de/settings.js index 3b4725c0b28..258f93a1d84 100644 --- a/js/src/i18n/de/settings.js +++ b/js/src/i18n/de/settings.js @@ -20,8 +20,8 @@ export default { background: { label: 'Hintergrund', - overview_0: 'Dein Hintergrundmuster ist einzigartig und beruht auf deiner Parity Installation. Es ändert sich jedes Mal dann, wenn du einen neuen Signer token erstellst. Dies stellt sicher, dass dezentrale Applicationen keine Vertrauenswürdigkeit vortäuschen können.', - overview_1: 'Such dir ein Muster aus und merke es dir. Dieses Muster wird dir nun immer angezeigt, ausser du löschst deinen Browser Cache oder benutzt einen neuen Signer token.', + overview_0: 'Dein Hintergrundmuster ist einzigartig und beruht auf deiner Parity Installation. Es ändert sich jedes Mal dann, wenn du einen neuen Signer token erstellst. Dies stellt sicher, dass dezentrale Applicationen keine Vertrauenswürdigkeit vortäuschen können.', + overview_1: 'Such dir ein Muster aus und merke es dir. Dieses Muster wird dir nun immer angezeigt, ausser du löschst deinen Browser Cache oder benutzt einen neuen Signer token.', button_more: 'weitere generieren' }, @@ -29,11 +29,11 @@ export default { parity: { label: 'Parity', - overview_0: 'Diese Einstellungen verändern das Verhalten deines Parity-Knotens.', + overview_0: 'Diese Einstellungen verändern das Verhalten deines Parity-Knotens.', languages: { label: 'Anzeigesprache', - hint: 'die Sprache, in der dir diese Obefläche angezeigt wird', + hint: 'die Sprache, in der dir diese Obefläche angezeigt wird', language_en: 'English', language_de: 'Deutsch' @@ -44,7 +44,7 @@ export default { hint: 'der Synchronisations-Modus deines Parity Knotens', mode_active: 'Parity synchronisiert kontinuierlich die Blockchain', - mode_passive: 'Parity synchronisiert zunächst, schläft dann und wacht regelmäßig zum Synchronisieren auf', + mode_passive: 'Parity synchronisiert zunächst, schläft dann und wacht regelmäßig zum Synchronisieren auf', mode_dark: 'Parity synchronisiert nur, falls erforderlich - beim Aufruf einer fernen Prozedur (RPC)', mode_offline: "Parity synchronisiert nicht" } @@ -53,10 +53,10 @@ export default { proxy: { label: 'Proxy', - overview_0: 'Die Proxy-Einstellungen ermöglichen dir einfachen Zugriff auf die Parity-Oberfläche mit all ihren dezentralen Anwendungen über einprägsame Adressen.', + overview_0: 'Die Proxy-Einstellungen ermöglichen dir einfachen Zugriff auf die Parity-Oberfläche mit all ihren dezentralen Anwendungen über einprägsame Adressen.', - details_0: 'Anstelle des Zugriffs über IP-Adresse und Port wirst du über die .parity Subdomain auf die Parity Oberfläche zugreifen können, indem du ', - details_1: 'besuchst. Dafür musst du folgenden Eintrag in den Proxy-Einstellungen deines Browsers hinzufügen:', + details_0: 'Anstelle des Zugriffs über IP-Adresse und Port wirst du über die .parity Subdomain auf die Parity Oberfläche zugreifen können, indem du ', + details_1: 'besuchst. Dafür musst du folgenden Eintrag in den Proxy-Einstellungen deines Browsers hinzufügen:', details_2: 'Hier findest du Anleitungen zum Anpassen der Proxy-Einstellungen in ', details_windows: 'Windows', details_3: ', ', @@ -68,38 +68,38 @@ export default { views: { label: 'Ansicht', - overview_0: 'Hier kannst du einstellen, welche Teile der Parity-Oberfläche dir angezeigt werden sollen.', - overview_1: 'Bist du Endnutzer? Die Standardeinstellungen sind gleichermaßen für Einsteiger als auch fortgeschrittene Nutzer gedacht.', - overview_2: 'Bist du Entwickler? Füge z.B. den Verträge-Reiter zu deiner Ansicht hinzu.', - overview_3: 'Bist du Miner oder betreibst du einen großangelegten Knoten? Füge den Status-Reiter hinzu, um alle Information über den Betrieb deines Knotens im Blick zu halten.', + overview_0: 'Hier kannst du einstellen, welche Teile der Parity-Oberfläche dir angezeigt werden sollen.', + overview_1: 'Bist du Endnutzer? Die Standardeinstellungen sind gleichermaßen für Einsteiger als auch fortgeschrittene Nutzer gedacht.', + overview_2: 'Bist du Entwickler? Füge z.B. den Verträge-Reiter zu deiner Ansicht hinzu.', + overview_3: 'Bist du Miner oder betreibst du einen großangelegten Knoten? Füge den Status-Reiter hinzu, um alle Information über den Betrieb deines Knotens im Blick zu halten.', accounts: { label: 'Konten', - description: 'Eine Liste aller Konten, die mit dieser Instanz von Parity verbunden sind. Sende Transaktionen, empfange eingehende Beträge, verwalte deinen Kontostand oder lade dein Konto auf.' + description: 'Eine Liste aller Konten, die mit dieser Instanz von Parity verbunden sind. Sende Transaktionen, empfange eingehende Beträge, verwalte deinen Kontostand oder lade dein Konto auf.' }, addresses: { label: 'Adressbuch', - description: 'Eine Liste all deiner Kontakte und Adressbucheinträge, die von dieser Instanz von Parity verwaltet werden. Überwache Konten und gelange mit nur einem Klick zu Details deiner Transaktionen.' + description: 'Eine Liste all deiner Kontakte und Adressbucheinträge, die von dieser Instanz von Parity verwaltet werden. Ãœberwache Konten und gelange mit nur einem Klick zu Details deiner Transaktionen.' }, apps: { label: 'Anwendungen', - description: 'Dezentrale Anwendungen, die mit dem Netzwerk interagieren. Füge Anwendungen hinzu oder verwalte und interagiere mit bestehenden Anwendungen.' + description: 'Dezentrale Anwendungen, die mit dem Netzwerk interagieren. Füge Anwendungen hinzu oder verwalte und interagiere mit bestehenden Anwendungen.' }, contracts: { - label: 'Verträge', - description: 'Überwache und interagiere mit Verträgen, die im Netzwerk installiert wurden. Dies ist eine technisch fokussierte Umgebung, die auf fortgeschrittene Benutzer mit gutem Verständnis der Fuktionsweise von Verträgen zugeschnitten ist.' + label: 'Verträge', + description: 'Ãœberwache und interagiere mit Verträgen, die im Netzwerk installiert wurden. Dies ist eine technisch fokussierte Umgebung, die auf fortgeschrittene Benutzer mit gutem Verständnis der Fuktionsweise von Verträgen zugeschnitten ist.' }, status: { label: 'Status', - description: 'Schau dir an, wie sich dein Parity Knoten schlägt. Hier findest du z.B. die Anzahl der aktuellen Verbindungen zum Netzwerk, Logs deiner laufenden Instanz und Mining Details (sofern eingeschaltet and konfiguriert).' + description: 'Schau dir an, wie sich dein Parity Knoten schlägt. Hier findest du z.B. die Anzahl der aktuellen Verbindungen zum Netzwerk, Logs deiner laufenden Instanz und Mining Details (sofern eingeschaltet and konfiguriert).' }, signer: { label: 'Signer', - description: 'Dies ist der sichere Bereich zum Verwalten deiner Transaktionen. Hier kannst du Transaktionen, die von dir oder deinen Anwendungen angestoßen wurden, prüfen und dann genehmigen oder ablehnen.' + description: 'Dies ist der sichere Bereich zum Verwalten deiner Transaktionen. Hier kannst du Transaktionen, die von dir oder deinen Anwendungen angestoßen wurden, prüfen und dann genehmigen oder ablehnen.' }, settings: { label: 'Einstellungen', - description: 'Die aktuelle Seite, die dir erlaubt, die Parity Oberfläche nach deinen Wünschen anzupassen.' + description: 'Die aktuelle Seite, die dir erlaubt, die Parity Oberfläche nach deinen Wünschen anzupassen.' } } }; From 714104172aae1e925a6a53b90411e5d094992ee5 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 14:26:55 +0100 Subject: [PATCH 13/32] Lint --- js/src/i18n/de/settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/src/i18n/de/settings.js b/js/src/i18n/de/settings.js index 258f93a1d84..96fa4984c89 100644 --- a/js/src/i18n/de/settings.js +++ b/js/src/i18n/de/settings.js @@ -46,7 +46,7 @@ export default { mode_active: 'Parity synchronisiert kontinuierlich die Blockchain', mode_passive: 'Parity synchronisiert zunächst, schläft dann und wacht regelmäßig zum Synchronisieren auf', mode_dark: 'Parity synchronisiert nur, falls erforderlich - beim Aufruf einer fernen Prozedur (RPC)', - mode_offline: "Parity synchronisiert nicht" + mode_offline: 'Parity synchronisiert nicht' } }, From 362406ee7955524e55947fcd4082e92218466c8b Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 22 Nov 2016 17:23:40 +0100 Subject: [PATCH 14/32] Re-apply pre-merge conflict changes --- js/src/views/Application/TabBar/tabBar.js | 36 +++++++---------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/js/src/views/Application/TabBar/tabBar.js b/js/src/views/Application/TabBar/tabBar.js index 62f02b43bc4..f8c73ce7135 100644 --- a/js/src/views/Application/TabBar/tabBar.js +++ b/js/src/views/Application/TabBar/tabBar.js @@ -20,7 +20,7 @@ import { bindActionCreators } from 'redux'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; import { Tab as MUITab } from 'material-ui/Tabs'; -import { Badge, Tooltip } from '../../../ui'; +import { Badge, Tooltip, Translate } from '../../../ui'; import styles from './tabBar.css'; import imagesEthcoreBlock from '../../../../assets/images/parity-logo-white-no-text.svg'; @@ -66,29 +66,25 @@ class Tab extends Component { } getLabel (view) { - const { label } = view; + const { id } = view; - if (view.id === 'signer') { - return this.renderSignerLabel(label); + if (id === 'signer') { + return this.renderSignerLabel(id); } - if (view.id === 'status') { - return this.renderStatusLabel(label); - } - - return this.renderLabel(label); + return this.renderLabel(id); } - renderLabel (name, bubble) { + renderLabel (id, bubble) { return (
- { name } + { bubble }
); } - renderSignerLabel (label) { + renderSignerLabel (id) { const { pendings } = this.props; if (pendings) { @@ -99,22 +95,10 @@ class Tab extends Component { value={ pendings } /> ); - return this.renderLabel(label, bubble); + return this.renderLabel(id, bubble); } - return this.renderLabel(label); - } - - renderStatusLabel (label) { - // const { isTest, netChain } = this.props; - // const bubble = ( - // - // ); - - return this.renderLabel(label, null); + return this.renderLabel(id); } handleClick = () => { From 3a49f32f54608f896862f174e99ae500903150c4 Mon Sep 17 00:00:00 2001 From: Jannis R Date: Tue, 22 Nov 2016 16:56:17 +0100 Subject: [PATCH 15/32] better German i18n --- js/src/i18n/de/settings.js | 40 +++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/js/src/i18n/de/settings.js b/js/src/i18n/de/settings.js index 96fa4984c89..b69306b4ac5 100644 --- a/js/src/i18n/de/settings.js +++ b/js/src/i18n/de/settings.js @@ -20,8 +20,8 @@ export default { background: { label: 'Hintergrund', - overview_0: 'Dein Hintergrundmuster ist einzigartig und beruht auf deiner Parity Installation. Es ändert sich jedes Mal dann, wenn du einen neuen Signer token erstellst. Dies stellt sicher, dass dezentrale Applicationen keine Vertrauenswürdigkeit vortäuschen können.', - overview_1: 'Such dir ein Muster aus und merke es dir. Dieses Muster wird dir nun immer angezeigt, ausser du löschst deinen Browser Cache oder benutzt einen neuen Signer token.', + overview_0: 'Dein Hintergrundmuster ist einzigartig und beruht auf deiner Parity-Installation. Es ändert sich immer dann, wenn du ein neues Signer-Token erstellst. So können dezentrale Applicationen keine Vertrauenswürdigkeit vortäuschen.', + overview_1: 'Such dir ein Muster aus und merke es dir. Dieses Muster wird dir von nun an immer angezeigt, es sei denn du löschst deinen Browser-Cache oder benutzt ein neues Signer-Token.', button_more: 'weitere generieren' }, @@ -33,7 +33,7 @@ export default { languages: { label: 'Anzeigesprache', - hint: 'die Sprache, in der dir diese Obefläche angezeigt wird', + hint: 'Die Sprache, in der dir diese Obefläche angezeigt wird', language_en: 'English', language_de: 'Deutsch' @@ -41,11 +41,11 @@ export default { modes: { label: 'Betriebsmodus', - hint: 'der Synchronisations-Modus deines Parity Knotens', + hint: 'Der Synchronisations-Modus deines Parity-Knotens', mode_active: 'Parity synchronisiert kontinuierlich die Blockchain', - mode_passive: 'Parity synchronisiert zunächst, schläft dann und wacht regelmäßig zum Synchronisieren auf', - mode_dark: 'Parity synchronisiert nur, falls erforderlich - beim Aufruf einer fernen Prozedur (RPC)', + mode_passive: 'Parity synchronisiert zu Beginn, schläft dann und wacht regelmäßig zum Synchronisieren auf', + mode_dark: 'Parity synchronisiert nur falls erforderlich, etwa wenn es aus der Ferne aufgerufen wird', mode_offline: 'Parity synchronisiert nicht' } }, @@ -53,9 +53,9 @@ export default { proxy: { label: 'Proxy', - overview_0: 'Die Proxy-Einstellungen ermöglichen dir einfachen Zugriff auf die Parity-Oberfläche mit all ihren dezentralen Anwendungen über einprägsame Adressen.', + overview_0: 'Die Proxy-Einstellungen ermöglichen dir einen einfachen Zugriff über einprägsame Adressen, auf die Oberfläche mit all ihren dezentralen Anwendungen.', - details_0: 'Anstelle des Zugriffs über IP-Adresse und Port wirst du über die .parity Subdomain auf die Parity Oberfläche zugreifen können, indem du ', + details_0: 'Anstelle des Zugriffs über IP-Adresse und Port wirst du über die .parity-Subdomain auf die Parity-Oberfläche zugreifen können, indem du ', details_1: 'besuchst. Dafür musst du folgenden Eintrag in den Proxy-Einstellungen deines Browsers hinzufügen:', details_2: 'Hier findest du Anleitungen zum Anpassen der Proxy-Einstellungen in ', details_windows: 'Windows', @@ -68,38 +68,38 @@ export default { views: { label: 'Ansicht', - overview_0: 'Hier kannst du einstellen, welche Teile der Parity-Oberfläche dir angezeigt werden sollen.', - overview_1: 'Bist du Endnutzer? Die Standardeinstellungen sind gleichermaßen für Einsteiger als auch fortgeschrittene Nutzer gedacht.', - overview_2: 'Bist du Entwickler? Füge z.B. den Verträge-Reiter zu deiner Ansicht hinzu.', - overview_3: 'Bist du Miner oder betreibst du einen großangelegten Knoten? Füge den Status-Reiter hinzu, um alle Information über den Betrieb deines Knotens im Blick zu halten.', + overview_0: 'Hier kannst du entscheiden, welche Teile der Parity-Oberfläche dir angezeigt werden sollen.', + overview_1: 'Benutzt du Parity ganz normal? Die Standardeinstellungen sind gleichermaßen für Einsteigende als auch für Fortgeschrittene gedacht.', + overview_2: 'Entwickelst du mit Parity? Füge zum Beispiel den Reiter "Contracts" zu deiner Ansicht hinzu.', + overview_3: 'Bist du Miner oder betreibst du einen großen Knoten? Füge den Reiter "Status" hinzu, um alle Information über den Betrieb deines Knotens im Blick zu halten.', accounts: { label: 'Konten', - description: 'Eine Liste aller Konten, die mit dieser Instanz von Parity verbunden sind. Sende Transaktionen, empfange eingehende Beträge, verwalte deinen Kontostand oder lade dein Konto auf.' + description: 'Eine Liste aller Konten, die mit dieser Parity-Installation verbunden sind. Sende Transaktionen, empfange eingehende Beträge, verwalte deine Kontostände oder lade deine Konten auf.' }, addresses: { label: 'Adressbuch', - description: 'Eine Liste all deiner Kontakte und Adressbucheinträge, die von dieser Instanz von Parity verwaltet werden. Überwache Konten und gelange mit nur einem Klick zu Details deiner Transaktionen.' + description: 'Eine Liste all deiner Kontakte und der Adressen, die von dieser Parity-Installation verwaltet werden. Überwache Konten und gelange mit nur einem Klick zu Details deiner Transaktionen.' }, apps: { label: 'Anwendungen', - description: 'Dezentrale Anwendungen, die mit dem Netzwerk interagieren. Füge Anwendungen hinzu oder verwalte und interagiere mit bestehenden Anwendungen.' + description: 'Dezentrale Anwendungen, die mit dem Netzwerk interagieren. Füge Anwendungen hinzu, entferne oder öffne Anwendungen.' }, contracts: { - label: 'Verträge', - description: 'Überwache und interagiere mit Verträgen, die im Netzwerk installiert wurden. Dies ist eine technisch fokussierte Umgebung, die auf fortgeschrittene Benutzer mit gutem Verständnis der Fuktionsweise von Verträgen zugeschnitten ist.' + label: 'Contracts', + description: 'Interagiere mit Smart Contracts im Netzwerk. Diese Umgebung ist auf Fortgeschrittene mit gutem Verständnis der Fuktionsweise von Smart Contracts zugeschnitten.' }, status: { label: 'Status', - description: 'Schau dir an, wie sich dein Parity Knoten schlägt. Hier findest du z.B. die Anzahl der aktuellen Verbindungen zum Netzwerk, Logs deiner laufenden Instanz und Mining Details (sofern eingeschaltet and konfiguriert).' + description: 'Schau dir an, wie sich dein Parity-Knoten schlägt. Hier findest du zum Beispiel die Anzahl der aktuellen Verbindungen zum Netzwerk, Logs deiner laufenden Instanz und (sofern konfiguriert) Details zum Mining.' }, signer: { label: 'Signer', - description: 'Dies ist der sichere Bereich zum Verwalten deiner Transaktionen. Hier kannst du Transaktionen, die von dir oder deinen Anwendungen angestoßen wurden, prüfen und dann genehmigen oder ablehnen.' + description: 'In diesem sicheren Bereich kannst du Transaktionen, die von dir oder von dezentralen Anwendungen erstellt wurden, prüfen und dann genehmigen oder ablehnen.' }, settings: { label: 'Einstellungen', - description: 'Die aktuelle Seite, die dir erlaubt, die Parity Oberfläche nach deinen Wünschen anzupassen.' + description: 'Diese Seite. Pass die Parity-Oberfläche nach deinen Wünschen an.' } } }; From f3e046de004162d100b6c3a1853182327e5fac5c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 23 Nov 2016 10:23:56 +0100 Subject: [PATCH 16/32] Language names in locale language --- js/src/i18n/de/index.js | 3 ++- js/src/i18n/de/settings.js | 5 +---- js/src/i18n/en/index.js | 3 ++- js/src/i18n/en/settings.js | 5 +---- js/src/i18n/languages.js | 22 +++++++++++++++++++ .../ui/LanguageSelector/languageSelector.js | 2 +- 6 files changed, 29 insertions(+), 11 deletions(-) create mode 100644 js/src/i18n/languages.js diff --git a/js/src/i18n/de/index.js b/js/src/i18n/de/index.js index d8c0f9b4b20..55eb6398fb6 100644 --- a/js/src/i18n/de/index.js +++ b/js/src/i18n/de/index.js @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +import languages from '../languages'; import settings from './settings'; export default { - settings + languages, settings }; diff --git a/js/src/i18n/de/settings.js b/js/src/i18n/de/settings.js index b69306b4ac5..e8446b7fa02 100644 --- a/js/src/i18n/de/settings.js +++ b/js/src/i18n/de/settings.js @@ -33,10 +33,7 @@ export default { languages: { label: 'Anzeigesprache', - hint: 'Die Sprache, in der dir diese Obefläche angezeigt wird', - - language_en: 'English', - language_de: 'Deutsch' + hint: 'Die Sprache, in der dir diese Obefläche angezeigt wird' }, modes: { diff --git a/js/src/i18n/en/index.js b/js/src/i18n/en/index.js index d8c0f9b4b20..55eb6398fb6 100644 --- a/js/src/i18n/en/index.js +++ b/js/src/i18n/en/index.js @@ -14,8 +14,9 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . +import languages from '../languages'; import settings from './settings'; export default { - settings + languages, settings }; diff --git a/js/src/i18n/en/settings.js b/js/src/i18n/en/settings.js index 275e924251f..da7934b5156 100644 --- a/js/src/i18n/en/settings.js +++ b/js/src/i18n/en/settings.js @@ -33,10 +33,7 @@ export default { languages: { label: 'UI language', - hint: 'the language this interface is displayed with', - - language_en: 'English', - language_de: 'German' + hint: 'the language this interface is displayed with' }, modes: { diff --git a/js/src/i18n/languages.js b/js/src/i18n/languages.js new file mode 100644 index 00000000000..9f86ef949e0 --- /dev/null +++ b/js/src/i18n/languages.js @@ -0,0 +1,22 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +export default { + af: 'Afrikaans', + de: 'Deutsch', + en: 'English', + fr: 'Français' +}; diff --git a/js/src/ui/LanguageSelector/languageSelector.js b/js/src/ui/LanguageSelector/languageSelector.js index 640179084c5..0d210ea0bf0 100644 --- a/js/src/ui/LanguageSelector/languageSelector.js +++ b/js/src/ui/LanguageSelector/languageSelector.js @@ -48,7 +48,7 @@ export default class LanguageSelector extends Component { renderOptions () { return LOCALES.map((locale) => { - const label = ; + const label = ; return ( Date: Thu, 24 Nov 2016 15:31:33 +0100 Subject: [PATCH 17/32] i8n -> index --- js/src/i18n/i18n.js | 39 --------------------------------------- js/src/i18n/index.js | 28 ++++++++++++++++++++++------ 2 files changed, 22 insertions(+), 45 deletions(-) delete mode 100644 js/src/i18n/i18n.js diff --git a/js/src/i18n/i18n.js b/js/src/i18n/i18n.js deleted file mode 100644 index 86ff55e25cf..00000000000 --- a/js/src/i18n/i18n.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2015, 2016 Ethcore (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import { I18n } from 'react-i18nify'; - -import de from './de'; -import en from './en'; - -let currentLocale = null; - -export function initLocales (defaultLocale = 'en') { - I18n.setTranslations({ - de, en - }); - - setLocale(defaultLocale); -} - -export function getLocale () { - return currentLocale; -} - -export function setLocale (locale) { - currentLocale = locale; - I18n.setLocale(locale); -} diff --git a/js/src/i18n/index.js b/js/src/i18n/index.js index 1f9d97e507e..86ff55e25cf 100644 --- a/js/src/i18n/index.js +++ b/js/src/i18n/index.js @@ -14,10 +14,26 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { initLocales, getLocale, setLocale } from './i18n'; +import { I18n } from 'react-i18nify'; -export { - initLocales, - getLocale, - setLocale -}; +import de from './de'; +import en from './en'; + +let currentLocale = null; + +export function initLocales (defaultLocale = 'en') { + I18n.setTranslations({ + de, en + }); + + setLocale(defaultLocale); +} + +export function getLocale () { + return currentLocale; +} + +export function setLocale (locale) { + currentLocale = locale; + I18n.setLocale(locale); +} From 1b6b77dd5b12dd491030dbee31c3e25b2c970ded Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 25 Nov 2016 17:36:33 +0100 Subject: [PATCH 18/32] Allow for development/production operation --- js/src/i18n/languages.js | 4 +--- js/src/ui/LanguageSelector/languageSelector.js | 12 +++++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/js/src/i18n/languages.js b/js/src/i18n/languages.js index 9f86ef949e0..f4950e40135 100644 --- a/js/src/i18n/languages.js +++ b/js/src/i18n/languages.js @@ -15,8 +15,6 @@ // along with Parity. If not, see . export default { - af: 'Afrikaans', de: 'Deutsch', - en: 'English', - fr: 'Français' + en: 'English' }; diff --git a/js/src/ui/LanguageSelector/languageSelector.js b/js/src/ui/LanguageSelector/languageSelector.js index 0d210ea0bf0..f9616ebad18 100644 --- a/js/src/ui/LanguageSelector/languageSelector.js +++ b/js/src/ui/LanguageSelector/languageSelector.js @@ -20,10 +20,12 @@ import { MenuItem } from 'material-ui'; import Select from '../Form/Select'; import Translate from '../Translate'; import { getLocale, setLocale } from '../../i18n'; +import languages from '../../i18n/languages'; -const LOCALES = [ - 'en', 'de' -]; +const isProduction = process.env.NODE_ENV === 'production'; + +const PRODUCTION_LOCALES = ['en']; +const LOCALES = isProduction ? PRODUCTION_LOCALES : Object.keys(languages); export default class LanguageSelector extends Component { state = { @@ -35,6 +37,10 @@ export default class LanguageSelector extends Component { const hint = ; const label = ; + if (isProduction) { + return null; + } + return ( { this.renderOptions() } @@ -53,8 +46,8 @@ export default class LanguageSelector extends Component { } renderOptions () { - return LOCALES.map((locale) => { - const label = ; + return this.store.locales.map((locale) => { + const label = ; return ( { - this.setState({ locale }, () => { - setLocale(locale); - }); + this.store.setLocale(locale); } } diff --git a/js/src/ui/Translate/translate.js b/js/src/ui/Translate/translate.js index 839f649e16a..317171157e5 100644 --- a/js/src/ui/Translate/translate.js +++ b/js/src/ui/Translate/translate.js @@ -15,16 +15,24 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; -import { Translate as I18NTranslate } from 'react-i18nify'; +import { FormattedMessage } from 'react-intl'; export default class Translate extends Component { static propTypes = { - value: PropTypes.string.isRequired + children: PropTypes.node, + id: PropTypes.string.isRequired, + default: PropTypes.string, + values: PropTypes.object } render () { return ( - + + { this.props.children } + ); } } diff --git a/js/src/views/Application/TabBar/tabBar.js b/js/src/views/Application/TabBar/tabBar.js index f8c73ce7135..557d01e1b41 100644 --- a/js/src/views/Application/TabBar/tabBar.js +++ b/js/src/views/Application/TabBar/tabBar.js @@ -78,7 +78,7 @@ class Tab extends Component { renderLabel (id, bubble) { return (
- + { bubble }
); diff --git a/js/src/views/Application/application.js b/js/src/views/Application/application.js index ca12992a29d..08ba17a3470 100644 --- a/js/src/views/Application/application.js +++ b/js/src/views/Application/application.js @@ -19,6 +19,8 @@ import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { observer } from 'mobx-react'; +import { LocaleStore } from '../../i18n'; + import Connection from '../Connection'; import ParityBar from '../ParityBar'; @@ -50,6 +52,7 @@ class Application extends Component { } store = new Store(this.context.api); + localeStore = LocaleStore.get(); render () { const [root] = (window.location.hash || '').replace('#/', '').split('/'); diff --git a/js/src/views/Settings/Background/background.js b/js/src/views/Settings/Background/background.js index da605731d92..566b04b9163 100644 --- a/js/src/views/Settings/Background/background.js +++ b/js/src/views/Settings/Background/background.js @@ -54,16 +54,16 @@ class Background extends Component { } render () { - const title = ; - const labelMore = ; + const title = ; + const labelMore = ; return (
-
-
+
+
diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index 353e90131b0..10bb840169f 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -37,14 +37,18 @@ export default class Parity extends Component { } render () { - const title = ; - return ( - + + } />
-
+
+ +
@@ -68,14 +72,21 @@ export default class Parity extends Component { ); }); + const { mode } = this.state; - const label = ; - const hint = ; return ( + defaultMessage='the language this interface is displayed with' /> } label={ - + defaultMessage='UI language' /> } value={ this.store.locale } onChange={ this.onChange }> @@ -52,7 +52,7 @@ export default class LanguageSelector extends Component { renderOptions () { return this.store.locales.map((locale) => { - const label = ; + const label = ; return ( . - -export default from './translate'; diff --git a/js/src/ui/Translate/translate.js b/js/src/ui/Translate/translate.js deleted file mode 100644 index 317171157e5..00000000000 --- a/js/src/ui/Translate/translate.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2015, 2016 Ethcore (UK) Ltd. -// This file is part of Parity. - -// Parity is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// Parity is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with Parity. If not, see . - -import React, { Component, PropTypes } from 'react'; -import { FormattedMessage } from 'react-intl'; - -export default class Translate extends Component { - static propTypes = { - children: PropTypes.node, - id: PropTypes.string.isRequired, - default: PropTypes.string, - values: PropTypes.object - } - - render () { - return ( - - { this.props.children } - - ); - } -} diff --git a/js/src/ui/index.js b/js/src/ui/index.js index 6264f3f349e..b0f519c0c90 100644 --- a/js/src/ui/index.js +++ b/js/src/ui/index.js @@ -41,7 +41,6 @@ import ParityBackground from './ParityBackground'; import SignerIcon from './SignerIcon'; import Tags from './Tags'; import Tooltips, { Tooltip } from './Tooltips'; -import Translate from './Translate'; import TxHash from './TxHash'; export { @@ -86,6 +85,5 @@ export { Tags, Tooltip, Tooltips, - Translate, TxHash }; diff --git a/js/src/views/Application/TabBar/tabBar.js b/js/src/views/Application/TabBar/tabBar.js index 557d01e1b41..8dd3d68dcb1 100644 --- a/js/src/views/Application/TabBar/tabBar.js +++ b/js/src/views/Application/TabBar/tabBar.js @@ -15,12 +15,13 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; import { Tab as MUITab } from 'material-ui/Tabs'; -import { Badge, Tooltip, Translate } from '../../../ui'; +import { Badge, Tooltip } from '../../../ui'; import styles from './tabBar.css'; import imagesEthcoreBlock from '../../../../assets/images/parity-logo-white-no-text.svg'; @@ -78,7 +79,7 @@ class Tab extends Component { renderLabel (id, bubble) { return (
- + { bubble }
); diff --git a/js/src/views/Settings/Background/background.js b/js/src/views/Settings/Background/background.js index edd7d2135af..bc857468813 100644 --- a/js/src/views/Settings/Background/background.js +++ b/js/src/views/Settings/Background/background.js @@ -15,11 +15,12 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import NavigationRefresh from 'material-ui/svg-icons/navigation/refresh'; -import { Button, Container, ContainerTitle, ParityBackground, Translate } from '../../../ui'; +import { Button, Container, ContainerTitle, ParityBackground } from '../../../ui'; import { updateBackground } from '../actions'; @@ -57,27 +58,27 @@ class Background extends Component { return ( + } />
- + defaultMessage='The background pattern you can see right now is unique to your Parity installation. It will change every time you create a new Signer token. This is so that decentralized applications cannot pretend to be trustworthy.' />
- + defaultMessage='Pick a pattern you like and memorize it. This Pattern will always be shown from now on, unless you clear your browser cache or use a new Signer token.' />
diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index 10bb840169f..b3c58c35232 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -15,9 +15,10 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { MenuItem } from 'material-ui'; -import { Select, Container, ContainerTitle, LanguageSelector, Translate } from '../../../ui'; +import { Select, Container, ContainerTitle, LanguageSelector } from '../../../ui'; import layout from '../layout.css'; @@ -40,14 +41,14 @@ export default class Parity extends Component { return ( + } />
- + defaultMessage='Control the Parity node settings and mode of operation via this interface.' />
@@ -61,7 +62,7 @@ export default class Parity extends Component { renderModes () { const modes = MODES.map((mode) => { - const label = ; + const label = ; return ( + defaultMessage='mode of operation' /> } hint={ - + defaultMessage='the syning mode for the Parity node' /> } value={ mode } onChange={ this.onChangeMode }> diff --git a/js/src/views/Settings/Proxy/proxy.js b/js/src/views/Settings/Proxy/proxy.js index 152a6a3d0cc..f6a08c4cb82 100644 --- a/js/src/views/Settings/Proxy/proxy.js +++ b/js/src/views/Settings/Proxy/proxy.js @@ -15,8 +15,9 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; -import { Container, ContainerTitle, Translate } from '../../../ui'; +import { Container, ContainerTitle } from '../../../ui'; import layout from '../layout.css'; import styles from './proxy.css'; @@ -33,22 +34,22 @@ export default class Proxy extends Component { return ( + } />
- + defaultMessage='The proxy setup allows you to access Parity and all associated decentralized applications via memorable addresses.' />
- http://home.parity/ } } /> @@ -57,13 +58,13 @@ export default class Proxy extends Component { { proxyurl }
- , - macOSLink: , - ubuntuLink: + windowsLink: , + macOSLink: , + ubuntuLink: } } />
diff --git a/js/src/views/Settings/Views/views.js b/js/src/views/Settings/Views/views.js index 83001cbc61e..9ea86ebd327 100644 --- a/js/src/views/Settings/Views/views.js +++ b/js/src/views/Settings/Views/views.js @@ -15,11 +15,12 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { connect } from 'react-redux'; import { bindActionCreators } from 'redux'; import { Checkbox } from 'material-ui'; -import { Container, ContainerTitle, Translate } from '../../../ui'; +import { Container, ContainerTitle } from '../../../ui'; import { toggleView } from '../actions'; @@ -36,29 +37,29 @@ class Views extends Component { return ( + } />
- + defaultMessage='Manage the available application views, using only the parts of the application that is applicable to you.' />
- + defaultMessage='Are you an end-user? The defaults are setups for both beginner and advanced users alike.' />
- + defaultMessage='Are you a developer? Add some features to manage contracts are interact with application deployments.' />
- + defaultMessage='Are you a miner or run a large-scale node? Add the features to give you all the information needed to watch the node operation.' />
@@ -86,7 +87,7 @@ class Views extends Component { { view.icon }
- +
} @@ -94,7 +95,7 @@ class Views extends Component { checked={ view.active } value={ view.active } />
- +
); diff --git a/js/src/views/Settings/settings.js b/js/src/views/Settings/settings.js index 7ba94754eec..c2442424654 100644 --- a/js/src/views/Settings/settings.js +++ b/js/src/views/Settings/settings.js @@ -15,12 +15,13 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { Tab, Tabs } from 'material-ui'; import ActionSettingsEthernet from 'material-ui/svg-icons/action/settings-ethernet'; import ImageBlurOn from 'material-ui/svg-icons/image/blur-on'; import ImageRemoveRedEye from 'material-ui/svg-icons/image/remove-red-eye'; -import { Actionbar, Page, Translate } from '../../ui'; +import { Actionbar, Page } from '../../ui'; import imagesEthcoreBlock from '../../../assets/images/parity-logo-white-no-text.svg'; import styles from './settings.css'; @@ -49,7 +50,7 @@ export default class Settings extends Component { + }> { this.renderTab(hash, 'views', ) } @@ -74,7 +75,7 @@ export default class Settings extends Component { icon={ icon } label={
- +
} onActive={ this.onActivate(section) } /> From d3c5d9fcbf9829187c3aff52642b4e6fff5b16d8 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 2 Dec 2016 11:55:02 +0100 Subject: [PATCH 23/32] Add flat to flatten --- js/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/js/package.json b/js/package.json index 474872f604a..6bc731d6728 100644 --- a/js/package.json +++ b/js/package.json @@ -134,6 +134,7 @@ "ethereumjs-tx": "~1.1.2", "eventemitter3": "~2.0.2", "file-saver": "~1.3.3", + "flat": "~2.0.1", "format-json": "~1.0.3", "format-number": "~2.0.1", "geopattern": "~1.2.3", From f16b34a9fda67c27760c1b15eaa185a69d7ac7fd Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 2 Dec 2016 12:10:18 +0100 Subject: [PATCH 24/32] Extract default messages via babel --- js/.babelrc | 5 ++++- js/package.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/js/.babelrc b/js/.babelrc index 2298d98c0d6..4c86a254b68 100644 --- a/js/.babelrc +++ b/js/.babelrc @@ -15,7 +15,10 @@ "plugins": ["transform-react-remove-prop-types"] }, "development": { - "plugins": ["react-hot-loader/babel"] + "plugins": [ + "react-hot-loader/babel", + ["react-intl", { "messagesDir": "./.build/i18n/" }] + ] } } } diff --git a/js/package.json b/js/package.json index 6bc731d6728..12e11759d6f 100644 --- a/js/package.json +++ b/js/package.json @@ -52,6 +52,7 @@ "babel-eslint": "~7.1.0", "babel-loader": "~6.2.3", "babel-plugin-lodash": "~3.2.2", + "babel-plugin-react-intl": "~2.2.0", "babel-plugin-transform-class-properties": "~6.19.0", "babel-plugin-transform-decorators-legacy": "~1.3.4", "babel-plugin-transform-react-remove-prop-types": "~0.2.9", From 9e4c404fcb3a66501b0bbf29f53b752ac01a9874 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 2 Dec 2016 12:32:04 +0100 Subject: [PATCH 25/32] Webpack to aggegrate i18n defaultMessage --- js/package.json | 1 + js/webpack/app.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/js/package.json b/js/package.json index 12e11759d6f..a74005afdd0 100644 --- a/js/package.json +++ b/js/package.json @@ -112,6 +112,7 @@ "react-addons-test-utils": "~15.3.2", "react-dom": "~15.3.2", "react-hot-loader": "~3.0.0-beta.6", + "react-intl-aggregate-webpack-plugin": "0.0.1", "rucksack-css": "~0.8.6", "sinon": "~1.17.4", "sinon-as-promised": "~4.0.2", diff --git a/js/webpack/app.js b/js/webpack/app.js index aff9b8aac8a..ca54c525b08 100644 --- a/js/webpack/app.js +++ b/js/webpack/app.js @@ -17,6 +17,7 @@ const webpack = require('webpack'); const path = require('path'); +const ReactIntlAggregatePlugin = require('react-intl-aggregate-webpack-plugin'); const WebpackErrorNotificationPlugin = require('webpack-error-notification'); const CopyWebpackPlugin = require('copy-webpack-plugin'); const HtmlWebpackPlugin = require('html-webpack-plugin'); @@ -148,7 +149,15 @@ module.exports = { })); if (!isProd) { + const DEST_I18N = path.join(__dirname, '..', DEST, 'i18n'); + plugins.push( + new ReactIntlAggregatePlugin({ + messagesPattern: DEST_I18N + '/src/**/*.json', + aggregateOutputDir: DEST_I18N + '/i18n/', + aggregateFilename: 'en' + }), + new webpack.optimize.CommonsChunkPlugin({ filename: 'commons.[hash].js', name: 'commons', From 52ddf4b1b715336ddc25edf5eac249d518b77b2e Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 13:11:44 +0100 Subject: [PATCH 26/32] Re-add react-intl after merge --- js/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/js/package.json b/js/package.json index 04543746ad3..c8122aac3ce 100644 --- a/js/package.json +++ b/js/package.json @@ -153,6 +153,7 @@ "react-copy-to-clipboard": "4.2.3", "react-dom": "15.4.1", "react-dropzone": "3.7.3", + "react-intl": "2.1.5", "react-redux": "4.4.6", "react-router": "3.0.0", "react-router-redux": "4.0.7", From f5d5713522a33166e93459223ead2eac4360e6d3 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 13:18:29 +0100 Subject: [PATCH 27/32] Update proptype references (merge) --- js/src/ui/Actionbar/actionbar.js | 4 ++-- js/src/ui/Form/Select/select.js | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/js/src/ui/Actionbar/actionbar.js b/js/src/ui/Actionbar/actionbar.js index 9e01e0b9902..f744f5c5737 100644 --- a/js/src/ui/Actionbar/actionbar.js +++ b/js/src/ui/Actionbar/actionbar.js @@ -17,13 +17,13 @@ import React, { Component, PropTypes } from 'react'; import { Toolbar, ToolbarGroup } from 'material-ui/Toolbar'; -import { nodeOrString } from '../../util/proptypes'; +import { nodeOrStringProptype } from '~/util/proptypes'; import styles from './actionbar.css'; export default class Actionbar extends Component { static propTypes = { - title: nodeOrString(), + title: nodeOrStringProptype(), buttons: PropTypes.array, children: PropTypes.node, className: PropTypes.string diff --git a/js/src/ui/Form/Select/select.js b/js/src/ui/Form/Select/select.js index fc9ccddb9f4..b966f483c0a 100644 --- a/js/src/ui/Form/Select/select.js +++ b/js/src/ui/Form/Select/select.js @@ -17,7 +17,7 @@ import React, { Component, PropTypes } from 'react'; import { SelectField } from 'material-ui'; -import { nodeOrString } from '../../../util/proptypes'; +import { nodeOrStringProptype } from '~/util/proptypes'; // TODO: duplicated in Input const UNDERLINE_DISABLED = { @@ -35,9 +35,9 @@ export default class Select extends Component { children: PropTypes.node, className: PropTypes.string, disabled: PropTypes.bool, - error: nodeOrString(), - hint: nodeOrString(), - label: nodeOrString(), + error: nodeOrStringProptype(), + hint: nodeOrStringProptype(), + label: nodeOrStringProptype(), onBlur: PropTypes.func, onChange: PropTypes.func, onKeyDown: PropTypes.func, From 9a2d74a128a6e8a99a760ac4c523f5597181bc6c Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 7 Dec 2016 14:32:45 +0100 Subject: [PATCH 28/32] Strip down external dictionary --- js/src/i18n/en/settings.js | 36 +++----- js/src/views/Settings/Parity/parity.js | 31 +++++-- js/src/views/Settings/Views/views.js | 123 +++++++++++++++++++------ 3 files changed, 134 insertions(+), 56 deletions(-) diff --git a/js/src/i18n/en/settings.js b/js/src/i18n/en/settings.js index b01eb2dd662..a0e7c7f1f6f 100644 --- a/js/src/i18n/en/settings.js +++ b/js/src/i18n/en/settings.js @@ -22,14 +22,7 @@ export default { }, parity: { - label: 'parity', - - modes: { - mode_active: 'Parity continuously syncs the chain', - mode_passive: 'Parity syncs initially, then sleeps and wakes regularly to resync', - mode_dark: 'Parity syncs only when the RPC is active', - mode_offline: "Parity doesn't sync" - } + label: 'parity' }, proxy: { @@ -40,32 +33,31 @@ export default { label: 'views', accounts: { - label: 'Accounts', - description: 'A list of all the accounts associated to and imported into this Parity instance. Send transactions, receive incoming values, manage your balances and fund your accounts.' + label: 'Accounts' }, + addresses: { - label: 'Addressbook', - description: 'A list of all contacts and address book entries that is managed by this Parity instance. Watch accounts and have the details available at the click of a button when transacting.' + label: 'Addressbook' }, + apps: { - label: 'Applications', - description: 'Distributed applications that interact with the underlying network. Add applications, manage you application portfolio and interact with application from around the network.' + label: 'Applications' }, + contracts: { - label: 'Contracts', - description: 'Watch and interact with specific contracts that have been deployed on the network. This is a more technically-focused environment, specifically for advanced users that understand the inner working of certain contracts.' + label: 'Contracts' }, + status: { - label: 'Status', - description: 'See how the Parity node is performing in terms of connections to the network, logs from the actual running instance and details of mining (if enabled and configured).' + label: 'Status' }, + signer: { - label: 'Signer', - description: 'The secure transaction management area of the application where you can approve any outgoing transactions made from the application as well as those placed into the queue by distributed applications.' + label: 'Signer' }, + settings: { - label: 'Settings', - description: 'This view. Allows you to customize the application in term of options, operation and look and feel.' + label: 'Settings' } } }; diff --git a/js/src/views/Settings/Parity/parity.js b/js/src/views/Settings/Parity/parity.js index 31c0af95390..29fab8bfbf7 100644 --- a/js/src/views/Settings/Parity/parity.js +++ b/js/src/views/Settings/Parity/parity.js @@ -22,8 +22,6 @@ import { Select, Container, LanguageSelector } from '~/ui'; import layout from '../layout.css'; -const MODES = ['active', 'passive', 'dark', 'offline']; - export default class Parity extends Component { static contextTypes = { api: PropTypes.object.isRequired @@ -60,9 +58,9 @@ export default class Parity extends Component { } renderModes () { - const modes = MODES.map((mode) => { - const label = ; + const { mode } = this.state; + const renderItem = (mode, label) => { return ( ); - }); - - const { mode } = this.state; + }; return ( ); } diff --git a/js/src/views/Settings/Views/views.js b/js/src/views/Settings/Views/views.js index 99fa98b0ac0..12523968772 100644 --- a/js/src/views/Settings/Views/views.js +++ b/js/src/views/Settings/Views/views.js @@ -62,7 +62,69 @@ class Views extends Component {
- { this.renderViews() } + { + this.renderView('accounts', + , + + ) + } + { + this.renderView('addresses', + , + + ) + } + { + this.renderView('apps', + , + + ) + } + { + this.renderView('contracts', + , + + ) + } + { + this.renderView('status', + , + + ) + } + { + this.renderView('signer', + , + + ) + } + { + this.renderView('settings', + , + + ) + }
@@ -70,35 +132,44 @@ class Views extends Component { } renderViews () { - const { settings, toggleView } = this.props; + const { settings } = this.props; return Object.keys(settings.views).map((id) => { - const toggle = () => toggleView(id); - const view = settings.views[id]; - - return ( -
- -
- { view.icon } -
-
- -
+ const description = ; + const label = ; + + this.renderView(id, label, description); + }); + } + + renderView = (id, label, description) => { + const { settings, toggleView } = this.props; + + const toggle = () => toggleView(id); + const view = settings.views[id]; + + return ( +
+ +
+ { view.icon }
- } - onCheck={ toggle } - checked={ view.active } - value={ view.active } /> -
- -
+
+ { label } +
+
+ } + onCheck={ toggle } + checked={ view.active } + value={ view.active } /> +
+ { description }
- ); - }); +
+ ); } } From d5e1522489dabe564ec1a9b0c210069725b6c1a1 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Fri, 9 Dec 2016 11:39:22 +0100 Subject: [PATCH 29/32] i18n for dapps --- js/src/views/Dapps/AddDapps/AddDapps.js | 51 +++++++++++++++++++++---- js/src/views/Dapps/dapps.js | 25 ++++++++++-- 2 files changed, 64 insertions(+), 12 deletions(-) diff --git a/js/src/views/Dapps/AddDapps/AddDapps.js b/js/src/views/Dapps/AddDapps/AddDapps.js index 71d03dc50bc..d3876998af0 100644 --- a/js/src/views/Dapps/AddDapps/AddDapps.js +++ b/js/src/views/Dapps/AddDapps/AddDapps.js @@ -15,6 +15,7 @@ // along with Parity. If not, see . import React, { Component, PropTypes } from 'react'; +import { FormattedMessage } from 'react-intl'; import { observer } from 'mobx-react'; import DoneIcon from 'material-ui/svg-icons/action/done'; import { List, ListItem } from 'material-ui/List'; @@ -39,22 +40,56 @@ export default class AddDapps extends Component { return ( + } actions={ [