From 1c58a9cd5e1ef9625fb4a2b753b6639ec00027ce Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Thu, 8 Jun 2017 12:33:29 +0100 Subject: [PATCH] Everything but src/components/views/rooms --- .../views/dialogs/InteractiveAuthDialog.js | 2 +- .../dialogs/SessionRestoreErrorDialog.js | 9 +++++--- .../views/dialogs/SetDisplayNameDialog.js | 2 +- .../views/dialogs/UnknownDeviceDialog.js | 4 ++-- .../views/elements/TruncatedList.js | 3 ++- .../login/InteractiveAuthEntryComponents.js | 2 +- .../views/login/RegistrationForm.js | 4 ++-- .../views/room_settings/ColorSettings.js | 5 +++-- .../views/settings/AddPhoneNumber.js | 2 +- src/components/views/settings/ChangeAvatar.js | 5 +++-- .../views/settings/ChangeDisplayName.js | 3 ++- .../views/settings/ChangePassword.js | 2 +- src/components/views/settings/DevicesPanel.js | 11 +++++----- .../settings/EnableNotificationsButton.js | 5 +++-- src/components/views/voip/CallView.js | 7 +++++- src/components/views/voip/IncomingCallBox.js | 22 +++++++++++++++---- src/i18n/strings/en_EN.json | 22 +++++++++++++++++++ 17 files changed, 80 insertions(+), 30 deletions(-) diff --git a/src/components/views/dialogs/InteractiveAuthDialog.js b/src/components/views/dialogs/InteractiveAuthDialog.js index 945e0a9d69..363ce89b57 100644 --- a/src/components/views/dialogs/InteractiveAuthDialog.js +++ b/src/components/views/dialogs/InteractiveAuthDialog.js @@ -78,7 +78,7 @@ export default React.createClass({ - Dismiss + {_t("Dismiss")} ); diff --git a/src/components/views/dialogs/SessionRestoreErrorDialog.js b/src/components/views/dialogs/SessionRestoreErrorDialog.js index e7f6e19db7..51651b4aaa 100644 --- a/src/components/views/dialogs/SessionRestoreErrorDialog.js +++ b/src/components/views/dialogs/SessionRestoreErrorDialog.js @@ -18,7 +18,7 @@ import React from 'react'; import sdk from '../../../index'; import SdkConfig from '../../../SdkConfig'; import Modal from '../../../Modal'; -import { _t } from '../../../languageHandler'; +import { _t, _tJsx } from '../../../languageHandler'; export default React.createClass({ @@ -44,8 +44,11 @@ export default React.createClass({ if (SdkConfig.get().bug_report_endpoint_url) { bugreport = ( -

Otherwise, - click here to send a bug report. +

+ {_tJsx( + "Otherwise, click here to send a bug report.", + /(.*?)<\/a>/, (sub) => {sub} + )}

); } diff --git a/src/components/views/dialogs/SetDisplayNameDialog.js b/src/components/views/dialogs/SetDisplayNameDialog.js index 1134b1f8cd..0d6f486e0e 100644 --- a/src/components/views/dialogs/SetDisplayNameDialog.js +++ b/src/components/views/dialogs/SetDisplayNameDialog.js @@ -80,7 +80,7 @@ export default React.createClass({ />
- +
diff --git a/src/components/views/dialogs/UnknownDeviceDialog.js b/src/components/views/dialogs/UnknownDeviceDialog.js index 8f91b84519..6ebd0c3efc 100644 --- a/src/components/views/dialogs/UnknownDeviceDialog.js +++ b/src/components/views/dialogs/UnknownDeviceDialog.js @@ -145,7 +145,7 @@ export default React.createClass({ console.log("UnknownDeviceDialog closed by escape"); this.props.onFinished(); }} - title='Room contains unknown devices' + title={_t('Room contains unknown devices')} >

@@ -162,7 +162,7 @@ export default React.createClass({ this.props.onFinished(); Resend.resendUnsentEvents(this.props.room); }}> - Send anyway + {_t("Send anyway")} ); } else { return ( ); } diff --git a/src/components/views/voip/CallView.js b/src/components/views/voip/CallView.js index 6cab7531b7..b53794637f 100644 --- a/src/components/views/voip/CallView.js +++ b/src/components/views/voip/CallView.js @@ -18,6 +18,7 @@ var dis = require("../../../dispatcher"); var CallHandler = require("../../../CallHandler"); var sdk = require('../../../index'); var MatrixClientPeg = require("../../../MatrixClientPeg"); +import { _t } from '../../../languageHandler'; module.exports = React.createClass({ displayName: 'CallView', @@ -130,7 +131,11 @@ module.exports = React.createClass({ var voice; if (this.state.call && this.state.call.type === "voice" && this.props.showVoice) { var callRoom = MatrixClientPeg.get().getRoom(this.state.call.roomId); - voice =
Active call ({ callRoom.name })
; + voice = ( +
+ {_t("Active call (%(roomName)s)", {roomName: callRoom.name})} +
+ ); } return ( diff --git a/src/components/views/voip/IncomingCallBox.js b/src/components/views/voip/IncomingCallBox.js index 6cd19538f0..1b806fc5b3 100644 --- a/src/components/views/voip/IncomingCallBox.js +++ b/src/components/views/voip/IncomingCallBox.js @@ -17,6 +17,7 @@ var React = require('react'); var MatrixClientPeg = require('../../../MatrixClientPeg'); var dis = require("../../../dispatcher"); var CallHandler = require("../../../CallHandler"); +import { _t } from '../../../languageHandler'; module.exports = React.createClass({ displayName: 'IncomingCallBox', @@ -45,23 +46,36 @@ module.exports = React.createClass({ room = MatrixClientPeg.get().getRoom(this.props.incomingCall.roomId); } - var caller = room ? room.name : "unknown"; + var caller = room ? room.name : _t("unknown caller"); + + let incomingCallText = null; + if (this.props.incomingCall) { + if (this.props.incomingCall.type === "voice") { + incomingCallText = _t("Incoming voice call from %(name)s", {name: caller}); + } + else if (this.props.incomingCall.type === "video") { + incomingCallText = _t("Incoming video call from %(name)s", {name: caller}); + } + else { + incomingCallText = _t("Incoming call from %(name)s", {name: caller}); + } + } return (
- Incoming { this.props.incomingCall ? this.props.incomingCall.type : '' } call from { caller } + {incomingCallText}
- Decline + {_t("Decline")}
- Accept + {_t("Accept")}
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 36d220dca5..de1adc539d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -122,15 +122,18 @@ "A registered account is required for this action": "A registered account is required for this action", "A text message has been sent to +%(msisdn)s. Please enter the verification code it contains": "A text message has been sent to +%(msisdn)s. Please enter the verification code it contains", "accept": "accept", + "Accept": "Accept", "%(targetName)s accepted an invitation.": "%(targetName)s accepted an invitation.", "%(targetName)s accepted the invitation for %(displayName)s.": "%(targetName)s accepted the invitation for %(displayName)s.", "Account": "Account", "Access Token:": "Access Token:", + "Active call (%(roomName)s)": "Active call (%(roomName)s)", "Add": "Add", "Add a topic": "Add a topic", "Add email address": "Add email address", "Add phone number": "Add phone number", "Admin": "Admin", + "And %(count)s more...": "And %(count)s more...", "VoIP": "VoIP", "Missing Media Permissions, click here to request.": "Missing Media Permissions, click here to request.", "No Microphones detected": "No Microphones detected", @@ -230,6 +233,7 @@ "/ddg is not a command": "/ddg is not a command", "Deactivate Account": "Deactivate Account", "Deactivate my account": "Deactivate my account", + "Decline": "Decline", "decline": "decline", "Decrypt %(text)s": "Decrypt %(text)s", "Decryption error": "Decryption error", @@ -247,6 +251,7 @@ "Devices will not yet be able to decrypt history from before they joined the room": "Devices will not yet be able to decrypt history from before they joined the room", "Direct Chat": "Direct Chat", "Direct chats": "Direct chats", + "Disable Notifications": "Disable Notifications", "disabled": "disabled", "Disable inline URL previews by default": "Disable inline URL previews by default", "Disable markdown formatting": "Disable markdown formatting", @@ -264,6 +269,7 @@ "Email, name or matrix ID": "Email, name or matrix ID", "Emoji": "Emoji", "Enable encryption": "Enable encryption", + "Enable Notifications": "Enable Notifications", "enabled": "enabled", "Encrypted messages will not be visible on clients that do not yet implement encryption": "Encrypted messages will not be visible on clients that do not yet implement encryption", "Encrypted room": "Encrypted room", @@ -303,6 +309,7 @@ "Failed to toggle moderator status": "Failed to toggle moderator status", "Failed to unban": "Failed to unban", "Failed to upload file": "Failed to upload file", + "Failed to upload profile picture!": "Failed to upload profile picture!", "Failed to verify email address: make sure you clicked the link in the email": "Failed to verify email address: make sure you clicked the link in the email", "Failure to create room": "Failure to create room", "Favourite": "Favourite", @@ -332,6 +339,9 @@ "I have verified my email address": "I have verified my email address", "Import": "Import", "Import E2E room keys": "Import E2E room keys", + "Incoming call from %(name)s": "Incoming call from %(name)s", + "Incoming video call from %(name)s": "Incoming video call from %(name)s", + "Incoming voice call from %(name)s": "Incoming voice call from %(name)s", "Incorrect username and/or password.": "Incorrect username and/or password.", "Incorrect verification code": "Incorrect verification code", "Interface Language": "Interface Language", @@ -359,6 +369,7 @@ "Kick": "Kick", "Kicks user with given id": "Kicks user with given id", "Labs": "Labs", + "Last seen": "Last seen", "Leave room": "Leave room", "left and rejoined": "left and rejoined", "left": "left", @@ -402,6 +413,7 @@ "": "", "NOT verified": "NOT verified", "No devices with registered encryption keys": "No devices with registered encryption keys", + "No display name": "No display name", "No more results": "No more results", "No results": "No results", "No users have specific privileges in this room": "No users have specific privileges in this room", @@ -411,6 +423,7 @@ "Once you've followed the link it contains, click below": "Once you've followed the link it contains, click below", "Only people who have been invited": "Only people who have been invited", "Operation failed": "Operation failed", + "Otherwise, click here to send a bug report.": "Otherwise, click here to send a bug report.", "Password": "Password", "Password:": "Password:", "Passwords can't be empty": "Passwords can't be empty", @@ -453,9 +466,11 @@ "riot-web version:": "riot-web version:", "Room %(roomId)s not visible": "Room %(roomId)s not visible", "Room Colour": "Room Colour", + "Room contains unknown devices": "Room contains unknown devices", "Room name (optional)": "Room name (optional)", "Rooms": "Rooms", "Save": "Save", + "Saving room color settings is only available to registered users": "Saving room color settings is only available to registered users", "Scroll to bottom of page": "Scroll to bottom of page", "Scroll to unread messages": "Scroll to unread messages", "Search": "Search", @@ -464,6 +479,7 @@ "Searching known users": "Searching known users", "Send a message (unencrypted)": "Send a message (unencrypted)", "Send an encrypted message": "Send an encrypted message", + "Send anyway": "Send anyway", "Sender device information": "Sender device information", "Send Invites": "Send Invites", "Send Reset Email": "Send Reset Email", @@ -480,6 +496,7 @@ "Session ID": "Session ID", "%(senderName)s set a profile picture.": "%(senderName)s set a profile picture.", "%(senderName)s set their display name to %(displayName)s.": "%(senderName)s set their display name to %(displayName)s.", + "Set": "Set", "Setting a user name will create a fresh account": "Setting a user name will create a fresh account", "Settings": "Settings", "Show panel": "Show panel", @@ -494,6 +511,7 @@ "Someone": "Someone", "Sorry, this homeserver is using a login which is not recognised ": "Sorry, this homeserver is using a login which is not recognised ", "Start a chat": "Start a chat", + "Start authentication": "Start authentication", "Start Chat": "Start Chat", "Submit": "Submit", "Success": "Success", @@ -561,6 +579,7 @@ "Unable to load device list": "Unable to load device list", "Unencrypted room": "Unencrypted room", "unencrypted": "unencrypted", + "unknown caller": "unknown caller", "Unknown command": "Unknown command", "unknown device": "unknown device", "unknown error code": "unknown error code", @@ -580,6 +599,7 @@ "Upload Failed": "Upload Failed", "Upload Files": "Upload Files", "Upload file": "Upload file", + "Upload new:": "Upload new:", "Usage": "Usage", "Use compact timeline layout": "Use compact timeline layout", "Use with caution": "Use with caution", @@ -633,6 +653,7 @@ "You seem to be uploading files, are you sure you want to quit?": "You seem to be uploading files, are you sure you want to quit?", "You should not yet trust it to secure data": "You should not yet trust it to secure data", "You will not be able to undo this change as you are promoting the user to have the same power level as yourself": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself", + "Your home server does not support device management.": "Your home server does not support device management.", "Sun": "Sun", "Mon": "Mon", "Tue": "Tue", @@ -780,6 +801,7 @@ "To continue, please enter your password.": "To continue, please enter your password.", "To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:": "To verify that this device can be trusted, please contact its owner using some other means (e.g. in person or a phone call) and ask them whether the key they see in their User Settings for this device matches the key below:", "Device name": "Device name", + "Device Name": "Device Name", "Device key": "Device key", "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.": "If it matches, press the verify button below. If it doesn't, then someone else is intercepting this device and you probably want to press the blacklist button instead.", "In future this verification process will be more sophisticated.": "In future this verification process will be more sophisticated.",