From fd5e7ff37afcb5047d89f73608888aa9622df3a5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Wed, 31 May 2017 15:06:03 +0100 Subject: [PATCH] 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(); }