From 52ddcd8a600bba9b66f66b04a7cc5640a705b81b Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 14:51:08 +0100 Subject: [PATCH 1/7] 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/7] 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 0e742cec277ff3aa708ecaf4028627b3350a74ae Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 31 May 2017 15:37:30 +0100 Subject: [PATCH 3/7] scripts/fetch-develop.deps.sh: set -e (#4120) ... so that when the git clone fails, it doesn't plough on regardless. --- scripts/fetch-develop.deps.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/fetch-develop.deps.sh b/scripts/fetch-develop.deps.sh index bbbc8341..29309f21 100755 --- a/scripts/fetch-develop.deps.sh +++ b/scripts/fetch-develop.deps.sh @@ -6,6 +6,8 @@ # the branch the current checkout is on, use that branch. Otherwise, # use develop. +set -e + # Look in the many different CI env vars for which branch we're # building if [[ "$TRAVIS" == true ]]; then From c4c2b760ba940e1c7ca01c1bf72b7bb448285201 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 16:07:12 +0100 Subject: [PATCH 4/7] 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 5/7] 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'; From 89e5c4f8aede1dd8c68f56626bd988203e30c172 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Wed, 31 May 2017 23:50:06 +0100 Subject: [PATCH 6/7] Fix fetch-develop-deps.sh This got broken by https://github.com/vector-im/riot-web/pull/4120 so that it didn't work on a clean git clone. --- scripts/fetch-develop.deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-develop.deps.sh b/scripts/fetch-develop.deps.sh index 29309f21..b39e0839 100755 --- a/scripts/fetch-develop.deps.sh +++ b/scripts/fetch-develop.deps.sh @@ -42,13 +42,13 @@ dodep matrix-org matrix-react-sdk mkdir -p node_modules cd node_modules -rm -r matrix-js-sdk 2> /dev/null +rm -r matrix-js-sdk 2> /dev/null || true ln -s ../matrix-js-sdk ./ pushd matrix-js-sdk npm install popd -rm -r matrix-react-sdk 2> /dev/null +rm -r matrix-react-sdk 2> /dev/null || true ln -s ../matrix-react-sdk ./ pushd matrix-react-sdk mkdir -p node_modules From 33ee42f821300021102877030db96419c238eaab Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Thu, 1 Jun 2017 00:00:00 +0100 Subject: [PATCH 7/7] use loudNotification for flashFrame, resetting on count=0 or focus win32 check is optional just there so we're not attaching pointless handlers Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> --- electron_app/src/electron-main.js | 24 ++++++++++++------------ src/vector/platform/ElectronPlatform.js | 4 ++++ 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/electron_app/src/electron-main.js b/electron_app/src/electron-main.js index f21fe1c0..a5708164 100644 --- a/electron_app/src/electron-main.js +++ b/electron_app/src/electron-main.js @@ -119,19 +119,19 @@ electron.ipcMain.on('install_update', installUpdate); let focusHandlerAttached = false; electron.ipcMain.on('setBadgeCount', function(ev, count) { electron.app.setBadgeCount(count); - if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused()) { - if (count > 0) { - if (!focusHandlerAttached) { - mainWindow.once('focus', () => { - mainWindow.flashFrame(false); - focusHandlerAttached = false; - }); - focusHandlerAttached = true; - } - mainWindow.flashFrame(true); - } else { + if (count === 0) { + mainWindow.flashFrame(false); + } +}); + +electron.ipcMain.on('loudNotification', function() { + if (process.platform === 'win32' && mainWindow && !mainWindow.isFocused() && !focusHandlerAttached) { + mainWindow.flashFrame(true); + mainWindow.once('focus', () => { mainWindow.flashFrame(false); - } + focusHandlerAttached = false; + }); + focusHandlerAttached = true; } }); diff --git a/src/vector/platform/ElectronPlatform.js b/src/vector/platform/ElectronPlatform.js index 06ea2136..7cfe36ef 100644 --- a/src/vector/platform/ElectronPlatform.js +++ b/src/vector/platform/ElectronPlatform.js @@ -124,6 +124,10 @@ export default class ElectronPlatform extends VectorBasePlatform { return notification; } + loudNotification(ev: Event, room: Object) { + ipcRenderer.send('loudNotification'); + } + clearNotification(notif: Notification) { notif.close(); }