Skip to content

Commit 52ddcd8

Browse files
committed
Translate src/vector/platform
1 parent 020d496 commit 52ddcd8

5 files changed

Lines changed: 17 additions & 8 deletions

File tree

‎src/i18n/strings/en_EN.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"%(appName)s via %(browserName)s on %(osName)s": "%(appName)s via %(browserName)s on %(osName)s",
23
"<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.": "<a href=\"http://apple.com/safari\">Safari</a> and <a href=\"http://opera.com\">Opera</a> work too.",
34
"Add an email address above to configure email notifications": "Add an email address above to configure email notifications",
45
"Advanced notification settings": "Advanced notification settings",
@@ -88,6 +89,7 @@
8889
"remove %(name)s from the directory": "remove %(name)s from the directory",
8990
"Remove from Directory": "Remove from Directory",
9091
"Resend": "Resend",
92+
"Riot Desktop on %(platformName)": "Riot Desktop on %(platformName)",
9193
"Riot does not know how to join a room on this network": "Riot does not know how to join a room on this network",
9294
"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.",
9395
"Room directory": "Room directory",
@@ -106,6 +108,7 @@
106108
"Unable to join network": "Unable to join network",
107109
"Unable to look up room ID from server": "Unable to look up room ID from server",
108110
"Unhide Preview": "Unhide Preview",
111+
"Unknown device": "Unknown device",
109112
"unknown error code": "unknown error code",
110113
"Unnamed room": "Unnamed room",
111114
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
@@ -126,6 +129,7 @@
126129
"Saturday": "Saturday",
127130
"Today": "Today",
128131
"Yesterday": "Yesterday",
132+
"You need to be using HTTPS to place a screen-sharing call.": "You need to be using HTTPS to place a screen-sharing call.",
129133
"Welcome page": "Welcome page",
130134
"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!"
131135
}

‎src/vector/index.js‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ async function loadApp() {
278278
</div>, document.getElementById('matrixchat'));
279279
} else if (validBrowser) {
280280
UpdateChecker.start();
281-
282281
const MatrixChat = sdk.getComponent('structures.MatrixChat');
283282
window.matrixChat = ReactDOM.render(
284283
<MatrixChat

‎src/vector/platform/ElectronPlatform.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ limitations under the License.
1919

2020
import VectorBasePlatform from './VectorBasePlatform';
2121
import dis from 'matrix-react-sdk/lib/dispatcher';
22+
import _t from 'matrix-react-sdk/lib/languageHandler';
2223
import q from 'q';
2324
import electron, {remote, ipcRenderer} from 'electron';
2425

@@ -68,7 +69,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
6869
}
6970

7071
getHumanReadableName(): string {
71-
return 'Electron Platform';
72+
return 'Electron Platform'; // no translation required: only used for analytics
7273
}
7374

7475
setNotificationCount(count: number) {
@@ -146,7 +147,7 @@ export default class ElectronPlatform extends VectorBasePlatform {
146147
}
147148

148149
getDefaultDeviceDisplayName(): string {
149-
return 'Riot Desktop on ' + platformFriendlyName();
150+
return _t('Riot Desktop on %(platformName)s', { platformName: platformFriendlyName() });
150151
}
151152

152153
screenCaptureErrorString(): ?string {

‎src/vector/platform/VectorBasePlatform.js‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ limitations under the License.
1818
*/
1919

2020
import BasePlatform from 'matrix-react-sdk/lib/BasePlatform';
21+
import _t from 'matrix-react-sdk/lib/languageHandler';
22+
2123
import Favico from 'favico.js';
2224

2325
/**
@@ -36,7 +38,7 @@ export default class VectorBasePlatform extends BasePlatform {
3638
}
3739

3840
getHumanReadableName(): string {
39-
return 'Vector Base Platform';
41+
return 'Vector Base Platform'; // no translation required: only used for analytics
4042
}
4143

4244
_updateFavicon() {
@@ -94,6 +96,6 @@ export default class VectorBasePlatform extends BasePlatform {
9496
* device Vector is running on
9597
*/
9698
getDefaultDeviceDisplayName(): string {
97-
return "Unknown device";
99+
return _t("Unknown device");
98100
}
99101
}

‎src/vector/platform/WebPlatform.js‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ limitations under the License.
2020
import VectorBasePlatform from './VectorBasePlatform';
2121
import request from 'browser-request';
2222
import dis from 'matrix-react-sdk/lib/dispatcher.js';
23+
import { _t } from 'matrix-react-sdk/lib/languageHandler';
2324
import q from 'q';
2425

2526
import url from 'url';
@@ -32,7 +33,7 @@ export default class WebPlatform extends VectorBasePlatform {
3233
}
3334

3435
getHumanReadableName(): string {
35-
return 'Web Platform';
36+
return 'Web Platform'; // no translation required: only used for analytics
3637
}
3738

3839
/**
@@ -159,13 +160,15 @@ export default class WebPlatform extends VectorBasePlatform {
159160
const appName = u.format();
160161

161162
const ua = new UAParser();
162-
return `${appName} via ${ua.getBrowser().name} on ${ua.getOS().name}`;
163+
const browserName = ua.getBrowser().name;
164+
const osName = ua.getOS().name;
165+
return _t('%(appName)s via %(browserName)s on %(osName)s', {appName: appName, browserName: browserName, osName: osName});
163166
}
164167

165168
screenCaptureErrorString(): ?string {
166169
// it won't work at all if you're not on HTTPS so whine whine whine
167170
if (!global.window || global.window.location.protocol !== "https:") {
168-
return "You need to be using HTTPS to place a screen-sharing call.";
171+
return _t("You need to be using HTTPS to place a screen-sharing call.");
169172
}
170173
return null;
171174
}

0 commit comments

Comments
 (0)