From 137cf32d3b68d54645c8b2daf7c66d4659167064 Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 18 Oct 2017 19:39:51 +0100 Subject: [PATCH 1/2] Use _t as _t Rather than through a languageHandler object. This way our translation script knows about it. --- src/vector/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vector/index.js b/src/vector/index.js index c0cb64102..5d8854987 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -69,6 +69,7 @@ import Promise from 'bluebird'; var request = require('browser-request'); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; import * as languageHandler from 'matrix-react-sdk/lib/languageHandler'; +import { _t } from 'matrix-react-sdk/lib/languageHandler'; import url from 'url'; @@ -248,13 +249,13 @@ async function loadApp() { if (!preventRedirect) { if (/iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream) { - if (confirm(languageHandler._t("Riot is not supported on mobile web. Install the app?"))) { + if (confirm(_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(languageHandler._t("Riot is not supported on mobile web. Install the app?"))) { + if (confirm(_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; } From 42ddafcfd41f1f95b8f08e9249ce5e8bf32351a9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Thu, 19 Oct 2017 10:03:47 +0100 Subject: [PATCH 2/2] comment --- src/vector/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/vector/index.js b/src/vector/index.js index 5d8854987..a08397ce5 100644 --- a/src/vector/index.js +++ b/src/vector/index.js @@ -69,6 +69,7 @@ import Promise from 'bluebird'; var request = require('browser-request'); import * as UserSettingsStore from 'matrix-react-sdk/lib/UserSettingsStore'; import * as languageHandler from 'matrix-react-sdk/lib/languageHandler'; +// Also import _t directly so we can call it just `_t` as this is what gen-i18n.js expects import { _t } from 'matrix-react-sdk/lib/languageHandler'; import url from 'url';