From a29ab0976be9db9a98a535f67b396949495765e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Wed, 8 Nov 2017 10:23:11 +0100 Subject: [PATCH 1/5] Make the addresses heading on the aliases settings view translatable --- src/components/views/room_settings/AliasSettings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/room_settings/AliasSettings.js b/src/components/views/room_settings/AliasSettings.js index cb897c9daf..f1c5c0000c 100644 --- a/src/components/views/room_settings/AliasSettings.js +++ b/src/components/views/room_settings/AliasSettings.js @@ -253,7 +253,7 @@ module.exports = React.createClass({ return (
-

Addresses

+

{ _t('Addresses') }

{ _t('The main address for this room is') }: { canonical_alias_section }
From 1e7fc953b353cfce8c3a35cb0db9ec4f281e1de9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Wed, 8 Nov 2017 11:56:30 +0100 Subject: [PATCH 2/5] Ooops, also add the string to the default language file. --- src/i18n/strings/en_EN.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 4746a11921..83793291c9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -420,6 +420,7 @@ "not specified": "not specified", "not set": "not set", "Remote addresses for this room:": "Remote addresses for this room:", + "Addresses": "Addresses", "The main address for this room is": "The main address for this room is", "Local addresses for this room:": "Local addresses for this room:", "This room has no local addresses": "This room has no local addresses", From 681f43913acc1a51b34ca63b1d188381b134be9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Fri, 10 Nov 2017 11:26:53 +0100 Subject: [PATCH 3/5] Make the disabled PowerSelector element showing custom value translatable. Fixes #5547 --- src/components/views/elements/PowerSelector.js | 12 ++++++------ src/i18n/strings/en_EN.json | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/views/elements/PowerSelector.js b/src/components/views/elements/PowerSelector.js index a0aaa12ff1..8e60a7066d 100644 --- a/src/components/views/elements/PowerSelector.js +++ b/src/components/views/elements/PowerSelector.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import * as Roles from '../../../Roles'; -import { _t } from '../../../languageHandler'; +import { _t, _tJsx } from '../../../languageHandler'; let LEVEL_ROLE_MAP = {}; const reverseRoles = {}; @@ -85,13 +85,11 @@ module.exports = React.createClass({ render: function() { let customPicker; if (this.state.custom) { - let input; if (this.props.disabled) { - input = { this.props.value }; + customPicker = { _tJsx('Custom of ', [//], [(sub) => { this.props.value }]) }; } else { - input = ; + customPicker = ; } - customPicker = of { input }; } let selectValue; @@ -102,7 +100,9 @@ module.exports = React.createClass({ } let select; if (this.props.disabled) { - select = { selectValue }; + if (!this.state.custom) { + select = { selectValue }; + } } else { // Each level must have a definition in LEVEL_ROLE_MAP const levels = [0, 50, 100]; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 83793291c9..cfc28e3432 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -581,6 +581,7 @@ "%(items)s and %(count)s others|other": "%(items)s and %(count)s others", "%(items)s and %(count)s others|one": "%(items)s and one other", "%(items)s and %(lastItem)s": "%(items)s and %(lastItem)s", + "Custom of ": "Custom of ", "Custom level": "Custom level", "Room directory": "Room directory", "Start chat": "Start chat", From 184b29daf8131fef071af210231ad3755ed61292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Sat, 18 Nov 2017 16:58:36 +0100 Subject: [PATCH 4/5] Revert "Make the disabled PowerSelector element showing custom value translatable. Fixes #5547" This reverts commit 681f43913acc1a51b34ca63b1d188381b134be9c. --- src/components/views/elements/PowerSelector.js | 12 ++++++------ src/i18n/strings/en_EN.json | 1 - 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/components/views/elements/PowerSelector.js b/src/components/views/elements/PowerSelector.js index 8e60a7066d..a0aaa12ff1 100644 --- a/src/components/views/elements/PowerSelector.js +++ b/src/components/views/elements/PowerSelector.js @@ -18,7 +18,7 @@ limitations under the License. import React from 'react'; import * as Roles from '../../../Roles'; -import { _t, _tJsx } from '../../../languageHandler'; +import { _t } from '../../../languageHandler'; let LEVEL_ROLE_MAP = {}; const reverseRoles = {}; @@ -85,11 +85,13 @@ module.exports = React.createClass({ render: function() { let customPicker; if (this.state.custom) { + let input; if (this.props.disabled) { - customPicker = { _tJsx('Custom of ', [//], [(sub) => { this.props.value }]) }; + input = { this.props.value }; } else { - customPicker = ; + input = ; } + customPicker = of { input }; } let selectValue; @@ -100,9 +102,7 @@ module.exports = React.createClass({ } let select; if (this.props.disabled) { - if (!this.state.custom) { - select = { selectValue }; - } + select = { selectValue }; } else { // Each level must have a definition in LEVEL_ROLE_MAP const levels = [0, 50, 100]; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index cfc28e3432..83793291c9 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -581,7 +581,6 @@ "%(items)s and %(count)s others|other": "%(items)s and %(count)s others", "%(items)s and %(count)s others|one": "%(items)s and one other", "%(items)s and %(lastItem)s": "%(items)s and %(lastItem)s", - "Custom of ": "Custom of ", "Custom level": "Custom level", "Room directory": "Room directory", "Start chat": "Start chat", From 093f110199be87eff89046d2e480a4fa3a2a13f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20V=C3=A1gner?= Date: Sat, 18 Nov 2017 17:48:57 +0100 Subject: [PATCH 5/5] Make the toggle button on the memberEventListSummary translatable --- src/components/views/elements/MemberEventListSummary.js | 2 +- src/i18n/strings/en_EN.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/views/elements/MemberEventListSummary.js b/src/components/views/elements/MemberEventListSummary.js index de6f801a21..c0bb6bcae1 100644 --- a/src/components/views/elements/MemberEventListSummary.js +++ b/src/components/views/elements/MemberEventListSummary.js @@ -478,7 +478,7 @@ module.exports = React.createClass({ } const toggleButton = (
- { expanded ? 'collapse' : 'expand' } + { expanded ? _t('collapse') : _t('expand') }
); diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 83793291c9..2039d09368 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -581,6 +581,8 @@ "%(items)s and %(count)s others|other": "%(items)s and %(count)s others", "%(items)s and %(count)s others|one": "%(items)s and one other", "%(items)s and %(lastItem)s": "%(items)s and %(lastItem)s", + "collapse": "collapse", + "expand": "expand", "Custom level": "Custom level", "Room directory": "Room directory", "Start chat": "Start chat",