From 7e21e00c99e888a48193b99a4b66aa5e94ebb904 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 30 May 2017 16:27:48 +0100 Subject: [PATCH] Translate src/components/structures --- .../structures/CompatibilityPage.js | 35 +++++++++++++------ src/components/structures/RightPanel.js | 4 +-- src/components/structures/RoomDirectory.js | 6 ++-- src/components/structures/SearchBox.js | 4 +-- src/i18n/strings/en_EN.json | 8 ++++- 5 files changed, 39 insertions(+), 18 deletions(-) diff --git a/src/components/structures/CompatibilityPage.js b/src/components/structures/CompatibilityPage.js index bae33803aa..88b01cb2bb 100644 --- a/src/components/structures/CompatibilityPage.js +++ b/src/components/structures/CompatibilityPage.js @@ -17,6 +17,7 @@ limitations under the License. 'use strict'; var React = require('react'); +import { _t, _tJsx } from 'matrix-react-sdk/lib/languageHandler'; module.exports = React.createClass({ displayName: 'CompatibilityPage', @@ -39,23 +40,37 @@ module.exports = React.createClass({ return (
-

Sorry, your browser is not able to run Riot.

+

{ _tJsx("Sorry, your browser is not able to run Riot.", /(.*?)<\/b>/, (sub) => {sub}) }

- Riot uses many advanced browser features, some of which are not - available or experimental in your current browser. + { _t("Riot uses many advanced browser features, some of which are not available or experimental in your current browser.") }

- Please install Chrome or Firefox for - the best experience. Safari and Opera work too. + { _tJsx('Please install Chrome or Firefox for the best experience.', + [ + /(.*?)<\/a>/, + /(.*?)<\/a>/, + ], + [ + (sub) => {sub}, + (sub) => {sub}, + ] + )} + { _tJsx('Safari and Opera work too.', + [ + /(.*?)<\/a>/, + /(.*?)<\/a>/, + ], + [ + (sub) => {sub}, + (sub) => {sub}, + ] + )}

- With your current browser, the look and feel of the application may - be completely incorrect, and some or all features may not function. - If you want to try it anyway you can continue, but you are on your own - in terms of any issues you may encounter! + { _t("With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!") }

diff --git a/src/components/structures/RightPanel.js b/src/components/structures/RightPanel.js index c7f5394bf1..b4b82cfaef 100644 --- a/src/components/structures/RightPanel.js +++ b/src/components/structures/RightPanel.js @@ -93,7 +93,7 @@ module.exports = React.createClass({ var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog"); Modal.createDialog(NeedToRegisterDialog, { title: _t('Please Register'), - description: _t('Guest users can\'t invite users. Please register to invite') + '.' + description: _t('Guest users can\'t invite users. Please register to invite.') }); return; } @@ -218,7 +218,7 @@ module.exports = React.createClass({ { notificationsHighlight } -
+
; diff --git a/src/components/structures/RoomDirectory.js b/src/components/structures/RoomDirectory.js index e935084742..257fdbd5cd 100644 --- a/src/components/structures/RoomDirectory.js +++ b/src/components/structures/RoomDirectory.js @@ -213,11 +213,11 @@ module.exports = React.createClass({ var Loader = sdk.getComponent("elements.Spinner"); var modal = Modal.createDialog(Loader); - var step = _t('remove %(name)s from the directory', {name: name}) + '.'; + var step = _t('remove %(name)s from the directory.', {name: name}); MatrixClientPeg.get().setRoomDirectoryVisibility(room.room_id, 'private').then(() => { if (!alias) return; - step = _t('delete the alias') + '.'; + step = _t('delete the alias.'); return MatrixClientPeg.get().deleteAlias(alias); }).done(() => { modal.close(); @@ -356,7 +356,7 @@ module.exports = React.createClass({ var NeedToRegisterDialog = sdk.getComponent("dialogs.NeedToRegisterDialog"); Modal.createDialog(NeedToRegisterDialog, { title: _t('Failed to join the room'), - description: _t('This room is inaccessible to guests. You may be able to join if you register') + '.' + description: _t('This room is inaccessible to guests. You may be able to join if you register.') }); return; } diff --git a/src/components/structures/SearchBox.js b/src/components/structures/SearchBox.js index faee0b5f71..99c4486690 100644 --- a/src/components/structures/SearchBox.js +++ b/src/components/structures/SearchBox.js @@ -100,13 +100,13 @@ module.exports = React.createClass({ if (this.props.collapsed) { toggleCollapse = - + } else { toggleCollapse = - + } diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 039f5b76d3..7f1b8bf4c5 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1,4 +1,5 @@ { + "Safari and Opera work too.": "Safari and Opera work too.", "Add an email address above to configure email notifications": "Add an email address above to configure email notifications", "Advanced notification settings": "Advanced notification settings", "All messages": "All messages", @@ -48,6 +49,7 @@ " from room": " from room", "Guests can join": "Guests can join", "Guest users can't invite users. Please register to invite": "Guest users can't invite users. Please register to invite", + "I understand the risks and wish to continue": "I understand the risks and wish to continue", "Invite to this room": "Invite to this room", "Keywords": "Keywords", "Leave": "Leave", @@ -72,6 +74,7 @@ "On": "On", "Operation failed": "Operation failed", "Permalink": "Permalink", + "Please install Chrome or Firefox for the best experience.": "Please install Chrome or Firefox for the best experience.", "Please Register": "Please Register", "powered by Matrix": "powered by Matrix", "Quote": "Quote", @@ -83,11 +86,13 @@ "Remove from Directory": "Remove from Directory", "Resend": "Resend", "Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network", + "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.": "Riot uses many advanced browser features, some of which are not available or experimental in your current browser.", "Room directory": "Room directory", "Room not found": "Room not found", "Search for a room": "Search for a room", "Settings": "Settings", "Source URL": "Source URL", + "Sorry, your browser is not able to run Riot.": "Sorry, your browser is not able to run Riot.", "Start chat": "Start chat", "The Home Server may be too old to support third party networks": "The Home Server may be too old to support third party networks", "There are advanced notifications which are not shown here": "There are advanced notifications which are not shown here", @@ -118,5 +123,6 @@ "Saturday": "Saturday", "Today": "Today", "Yesterday": "Yesterday", - "Welcome page": "Welcome page" + "Welcome page": "Welcome page", + "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!": "With your current browser, the look and feel of the application may be completely incorrect, and some or all features may not function. If you want to try it anyway you can continue, but you are on your own in terms of any issues you may encounter!" }