From 52ddcd8a600bba9b66f66b04a7cc5640a705b81b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 14:51:08 +0100 Subject: [PATCH 1/4] Translate src/vector/platform --- src/i18n/strings/en_EN.json | 4 ++++ src/vector/index.js | 1 - src/vector/platform/ElectronPlatform.js | 5 +++-- src/vector/platform/VectorBasePlatform.js | 6 ++++-- src/vector/platform/WebPlatform.js | 9 ++++++--- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index adf0800d..494ad65d 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1,4 +1,5 @@ { + "%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s", "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", @@ -88,6 +89,7 @@ "remove %(name)s from the directory": "remove %(name)s from the directory", "Remove from Directory": "Remove from Directory", "Resend": "Resend", + "Riot Desktop on %(platformName)": "Riot Desktop on %(platformName)", "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", @@ -106,6 +108,7 @@ "Unable to join network": "Unable to join network", "Unable to look up room ID from server": "Unable to look up room ID from server", "Unhide Preview": "Unhide Preview", + "Unknown device": "Unknown device", "unknown error code": "unknown error code", "Unnamed room": "Unnamed room", "Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s", @@ -126,6 +129,7 @@ "Saturday": "Saturday", "Today": "Today", "Yesterday": "Yesterday", + "You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.", "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!" } diff --git a/src/vector/index.js b/src/vector/index.js index 432710fb..716e9c53 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -278,7 +278,6 @@ async function loadApp() { , document.getElementById('matrixchat')); } else if (validBrowser) { UpdateChecker.start(); - const MatrixChat = sdk.getComponent('structures.MatrixChat'); window.matrixChat = ReactDOM.render( Date: Wed, 31 May 2017 15:06:03 +0100 Subject: [PATCH 2/4] Translate src/vector --- src/i18n/strings/en_EN.json | 5 +++++ src/vector/index.html | 2 +- src/vector/index.js | 4 ++-- src/vector/submit-rageshake.js | 9 +++++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 494ad65d..2c8bb19a 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -12,6 +12,8 @@ "Can't update user notification settings": "Can't update user notification settings", "Close": "Close", "Collapse panel": "Collapse panel", + "Collecting app version information": "Collecting app version information", + "Collecting logs": "Collecting logs", "Create new room": "Create new room", "Couldn't find a matching Matrix room": "Couldn't find a matching Matrix room", "Custom Server Options": "Custom Server Options", @@ -91,6 +93,7 @@ "Resend": "Resend", "Riot Desktop on %(platformName)": "Riot Desktop on %(platformName)", "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 is not supported on mobile web. Install the app?": "Riot is not supported on mobile web. Install the app?", "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", @@ -112,8 +115,10 @@ "unknown error code": "unknown error code", "Unnamed room": "Unnamed room", "Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s", + "Uploading report": "Uploading report", "View Decrypted Source": "View Decrypted Source", "View Source": "View Source", + "Waiting for response from server": "Waiting for response from server", "When I'm invited to a room": "When I'm invited to a room", "World readable": "World readable", "You cannot delete this image. (%(code)s)": "You cannot delete this image. (%(code)s)", diff --git a/src/vector/index.html b/src/vector/index.html index 38810f62..49c2979e 100644 --- a/src/vector/index.html +++ b/src/vector/index.html @@ -36,7 +36,7 @@
- + <% for (var i=0; i < htmlWebpackPlugin.files.js.length; i++) { // Not a particularly graceful way of not putting the indexeddb worker script // into the main page diff --git a/src/vector/index.js b/src/vector/index.js index 716e9c53..9f162051 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -245,13 +245,13 @@ async function loadApp() { if (!preventRedirect) { if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { - if (confirm("Riot is not supported on mobile web. Install the app?")) { + if (confirm(languageHandler._t("Riot is not supported on mobile web. Install the app?"))) { window.location = "https://itunes.apple.com/us/app/vector.im/id1083446067"; return; } } else if (/Android/.test(navigator.userAgent)) { - if (confirm("Riot is not supported on mobile web. Install the app?")) { + if (confirm(languageHandler._t("Riot is not supported on mobile web. Install the app?"))) { window.location = "https://play.google.com/store/apps/details?id=im.vector.alpha"; return; } diff --git a/src/vector/submit-rageshake.js b/src/vector/submit-rageshake.js index 45b427e8..c6c551c6 100644 --- a/src/vector/submit-rageshake.js +++ b/src/vector/submit-rageshake.js @@ -19,6 +19,7 @@ import q from "q"; import MatrixClientPeg from 'matrix-react-sdk/lib/MatrixClientPeg'; import PlatformPeg from 'matrix-react-sdk/lib/PlatformPeg'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; import rageshake from './rageshake' @@ -53,7 +54,7 @@ export default async function sendBugReport(bugReportEndpoint, opts) { opts = opts || {}; const progressCallback = opts.progressCallback || (() => {}); - progressCallback("Collecting app version information"); + progressCallback(_t("Collecting app version information")); let version = "UNKNOWN"; try { version = await PlatformPeg.get().getAppVersion(); @@ -81,7 +82,7 @@ export default async function sendBugReport(bugReportEndpoint, opts) { } if (opts.sendLogs) { - progressCallback("Collecting logs"); + progressCallback(_t("Collecting logs")); const logs = await rageshake.getLogsForReport(); for (let entry of logs) { // encode as UTF-8 @@ -94,7 +95,7 @@ export default async function sendBugReport(bugReportEndpoint, opts) { } } - progressCallback("Uploading report"); + progressCallback(_t("Uploading report")); await _submitReport(bugReportEndpoint, body, progressCallback); } @@ -106,7 +107,7 @@ function _submitReport(endpoint, body, progressCallback) { req.timeout = 5 * 60 * 1000; req.onreadystatechange = function() { if (req.readyState === XMLHttpRequest.LOADING) { - progressCallback("Waiting for response from server"); + progressCallback(_t("Waiting for response from server")); } else if (req.readyState === XMLHttpRequest.DONE) { on_done(); } From c4c2b760ba940e1c7ca01c1bf72b7bb448285201 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 16:07:12 +0100 Subject: [PATCH 3/4] Add translation from #4103 --- src/i18n/strings/pt_BR.json | 1 + 1 file changed, 1 insertion(+) diff --git a/src/i18n/strings/pt_BR.json b/src/i18n/strings/pt_BR.json index 3bfb0f0a..ffaae2b2 100644 --- a/src/i18n/strings/pt_BR.json +++ b/src/i18n/strings/pt_BR.json @@ -42,6 +42,7 @@ "Files": "Arquivos", "Filter room names": "Filtrar salas por título", "Forget": "Esquecer", + "Forward Message": "Encaminhar", " from room": " da sala", "Guests can join": "Convidados podem entrar", "Guest users can't invite users. Please register to invite": "Usuários convidados não podem convidar outros usuários. Por gentileza se registre para enviar convites", From 7dc55a9a47259fdf4be0b5112e0962df5e69914e Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 17:53:32 +0100 Subject: [PATCH 4/4] Import correctly --- src/vector/platform/ElectronPlatform.js | 2 +- src/vector/platform/VectorBasePlatform.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 6bc04730..0f044458 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -19,7 +19,7 @@ limitations under the License. import VectorBasePlatform from './VectorBasePlatform'; import dis from 'matrix-react-sdk/lib/dispatcher'; -import _t from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; import q from 'q'; import electron, {remote, ipcRenderer} from 'electron'; diff --git a/src/vector/platform/VectorBasePlatform.js b/src/vector/platform/VectorBasePlatform.js index bf15e6cf..76707d1d 100644 --- a/src/vector/platform/VectorBasePlatform.js +++ b/src/vector/platform/VectorBasePlatform.js @@ -18,7 +18,7 @@ limitations under the License. */ import BasePlatform from 'matrix-react-sdk/lib/BasePlatform'; -import _t from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; import Favico from 'favico.js';