Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 0fa902c

Browse files
committed
Merge remote-tracking branch 'origin/develop' into develop
2 parents 0b6d20a + 650d454 commit 0fa902c

37 files changed

+340
-135
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ install:
55
- npm install
66
- (cd node_modules/matrix-js-sdk && npm install)
77
script:
8-
- npm run test
9-
- ./.travis-test-riot.sh
8+
# don't run the riot tests unless the react-sdk tests pass, otherwise
9+
# the output is confusing.
10+
- npm run test && ./.travis-test-riot.sh

karma.conf.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@ module.exports = function (config) {
177177
],
178178
},
179179
devtool: 'inline-source-map',
180+
externals: {
181+
// Don't try to bundle electron: leave it as a commonjs dependency
182+
// (the 'commonjs' here means it will output a 'require')
183+
"electron": "commonjs electron",
184+
},
180185
},
181186

182187
webpackMiddleware: {

scripts/fix-i18n.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ BEGIN
5252
This room is inaccessible to guests. You may be able to join if you register.
5353
delete the alias.
5454
remove %(name)s from the directory.
55+
Conference call failed.
56+
Conference calling is in development and may not be reliable.
57+
Guest users can't create new rooms. Please register to create room and start a chat.
58+
Server may be unavailable, overloaded, or you hit a bug.
59+
Server unavailable, overloaded, or something else went wrong.
60+
You are already in a call.
61+
You cannot place VoIP calls in this browser.
62+
You cannot place a call with yourself.
63+
Your email address does not appear to be associated with a Matrix ID on this Homeserver.
5564
EOT
5665
)];
5766
}

src/CallHandler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ function _onAction(payload) {
226226
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
227227
Modal.createDialog(ErrorDialog, {
228228
title: _t('Existing Call'),
229-
description: _t('You are already in a call') + '.',
229+
description: _t('You are already in a call.'),
230230
});
231231
return; // don't allow >1 call to be placed.
232232
}
@@ -236,7 +236,7 @@ function _onAction(payload) {
236236
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
237237
Modal.createDialog(ErrorDialog, {
238238
title: _t('VoIP is unsupported'),
239-
description: _t('You cannot place VoIP calls in this browser') + '.',
239+
description: _t('You cannot place VoIP calls in this browser.'),
240240
});
241241
return;
242242
}
@@ -251,7 +251,7 @@ function _onAction(payload) {
251251
if (members.length <= 1) {
252252
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
253253
Modal.createDialog(ErrorDialog, {
254-
description: _t('You cannot place a call with yourself') + '.',
254+
description: _t('You cannot place a call with yourself.'),
255255
});
256256
return;
257257
}
@@ -284,7 +284,7 @@ function _onAction(payload) {
284284
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
285285
Modal.createDialog(ErrorDialog, {
286286
title: _t('VoIP is unsupported'),
287-
description: _t('You cannot place VoIP calls in this browser') + '.',
287+
description: _t('You cannot place VoIP calls in this browser.'),
288288
});
289289
}
290290
else if (MatrixClientPeg.get().isRoomEncrypted(payload.room_id)) {
@@ -303,7 +303,7 @@ function _onAction(payload) {
303303
var QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
304304
Modal.createDialog(QuestionDialog, {
305305
title: _t('Warning!'),
306-
description: _t('Conference calling is in development and may not be reliable') + '.',
306+
description: _t('Conference calling is in development and may not be reliable.'),
307307
onFinished: confirm=>{
308308
if (confirm) {
309309
ConferenceHandler.createNewMatrixCall(
@@ -315,7 +315,7 @@ function _onAction(payload) {
315315
console.error("Conference call failed: " + err);
316316
Modal.createDialog(ErrorDialog, {
317317
title: _t('Failed to set up conference call'),
318-
description: _t('Conference call failed') + '. ' + ((err && err.message) ? err.message : ''),
318+
description: _t('Conference call failed.') + ' ' + ((err && err.message) ? err.message : ''),
319319
});
320320
});
321321
}

src/Login.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ limitations under the License.
1616
*/
1717

1818
import Matrix from "matrix-js-sdk";
19+
import { _t } from "./languageHandler";
1920

2021
import q from 'q';
2122
import url from 'url';
@@ -97,9 +98,9 @@ export default class Login {
9798
};
9899
}, (error) => {
99100
if (error.httpStatus === 403) {
100-
error.friendlyText = "Guest access is disabled on this Home Server.";
101+
error.friendlyText = _t("Guest access is disabled on this Home Server.");
101102
} else {
102-
error.friendlyText = "Failed to register as guest: " + error.data;
103+
error.friendlyText = _t("Failed to register as guest:") + ' ' + error.data;
103104
}
104105
throw error;
105106
});
@@ -158,12 +159,12 @@ export default class Login {
158159
}, function(error) {
159160
if (error.httpStatus == 400 && loginParams.medium) {
160161
error.friendlyText = (
161-
'This Home Server does not support login using email address.'
162+
_t('This Home Server does not support login using email address.')
162163
);
163164
}
164165
else if (error.httpStatus === 403) {
165166
error.friendlyText = (
166-
'Incorrect username and/or password.'
167+
_t('Incorrect username and/or password.')
167168
);
168169
if (self._fallbackHsUrl) {
169170
var fbClient = Matrix.createClient({
@@ -187,7 +188,7 @@ export default class Login {
187188
}
188189
else {
189190
error.friendlyText = (
190-
'There was a problem logging in. (HTTP ' + error.httpStatus + ")"
191+
_t("There was a problem logging in.") + ' (HTTP ' + error.httpStatus + ")"
191192
);
192193
}
193194
throw error;

src/PasswordReset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ class PasswordReset {
8282
err.message = _t('Failed to verify email address: make sure you clicked the link in the email');
8383
}
8484
else if (err.httpStatus === 404) {
85-
err.message = _t('Your email address does not appear to be associated with a Matrix ID on this Homeserver') + '.';
85+
err.message = _t('Your email address does not appear to be associated with a Matrix ID on this Homeserver.');
8686
}
8787
else if (err.httpStatus) {
8888
err.message += ` (Status ${err.httpStatus})`;

src/SlashCommands.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ const commands = {
186186
if (targetRoomId) { break; }
187187
}
188188
if (!targetRoomId) {
189-
return reject("Unrecognised room alias: " + roomAlias);
189+
return reject(_t("Unrecognised room alias:") + ' ' + roomAlias);
190190
}
191191
}
192192
}
@@ -303,14 +303,14 @@ const commands = {
303303

304304
const device = MatrixClientPeg.get().getStoredDevice(userId, deviceId);
305305
if (!device) {
306-
return reject(`Unknown (user, device) pair: (${userId}, ${deviceId})`);
306+
return reject(_t(`Unknown (user, device) pair:`) + ` (${userId}, ${deviceId})`);
307307
}
308308

309309
if (device.isVerified()) {
310310
if (device.getFingerprint() === fingerprint) {
311-
return reject(`Device already verified!`);
311+
return reject(_t(`Device already verified!`));
312312
} else {
313-
return reject(`WARNING: Device already verified, but keys do NOT MATCH!`);
313+
return reject(_t(`WARNING: Device already verified, but keys do NOT MATCH!`));
314314
}
315315
}
316316

@@ -322,12 +322,15 @@ const commands = {
322322
// Tell the user we verified everything!
323323
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
324324
Modal.createDialog(QuestionDialog, {
325-
title: "Verified key",
325+
title: _t("Verified key"),
326326
description: (
327327
<div>
328328
<p>
329-
The signing key you provided matches the signing key you received
330-
from { userId }'s device { deviceId }. Device marked as verified.
329+
{
330+
_t("The signing key you provided matches the signing key you received " +
331+
"from %(userId)s's device %(deviceId)s. Device marked as verified.",
332+
{userId: userId, deviceId: deviceId})
333+
}
331334
</p>
332335
</div>
333336
),
@@ -336,9 +339,13 @@ const commands = {
336339

337340
return success();
338341
} else {
339-
return reject(`WARNING: KEY VERIFICATION FAILED! The signing key for ${userId} and device
340-
${deviceId} is "${device.getFingerprint()}" which does not match the provided key
341-
"${fingerprint}". This could mean your communications are being intercepted!`);
342+
const fprint = device.getFingerprint();
343+
return reject(
344+
_t('WARNING: KEY VERIFICATION FAILED! The signing key for %(userId)s and device' +
345+
' %(deviceId)s is "%(fprint)s" which does not match the provided key' +
346+
' "%(fingerprint)s". This could mean your communications are being intercepted!',
347+
{deviceId: deviceId, fprint: fprint, userId: userId, fingerprint: fingerprint})
348+
);
342349
}
343350
}
344351
}
@@ -383,7 +390,7 @@ module.exports = {
383390
if (commands[cmd]) {
384391
return commands[cmd].run(roomId, args);
385392
} else {
386-
return reject("Unrecognised command: " + input);
393+
return reject(_t("Unrecognised command:") + ' ' + input);
387394
}
388395
}
389396
return null; // not a command

src/UserSettingsStore.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,24 +17,26 @@ limitations under the License.
1717
import q from 'q';
1818
import MatrixClientPeg from './MatrixClientPeg';
1919
import Notifier from './Notifier';
20+
import { _t } from './languageHandler';
2021

2122
/*
2223
* TODO: Make things use this. This is all WIP - see UserSettings.js for usage.
2324
*/
2425

25-
/*
26-
* TODO: Find a way to translate the names of LABS_FEATURES. In other words, guarantee that languages were already loaded before building this array.
27-
*/
28-
2926
export default {
3027
LABS_FEATURES: [
3128
{
32-
name: "New Composer & Autocomplete",
29+
name: "-",
3330
id: 'rich_text_editor',
3431
default: false,
3532
},
3633
],
3734

35+
// horrible but it works. The locality makes this somewhat more palatable.
36+
doTranslations: function() {
37+
this.LABS_FEATURES[0].name = _t("New Composer & Autocomplete");
38+
},
39+
3840
loadProfileInfo: function() {
3941
const cli = MatrixClientPeg.get();
4042
return cli.getProfileInfo(cli.credentials.userId);

src/async-components/views/dialogs/ExportE2eKeysDialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ export default React.createClass({
166166
</div>
167167
</div>
168168
<div className='mx_Dialog_buttons'>
169-
<input className='mx_Dialog_primary' type='submit' value='Export'
169+
<input className='mx_Dialog_primary' type='submit' value={_t('Export')}
170170
disabled={disableForm}
171171
/>
172172
<button onClick={this._onCancelClick} disabled={disableForm}>
173-
Cancel
173+
{_t("Cancel")}
174174
</button>
175175
</div>
176176
</form>

src/async-components/views/dialogs/ImportE2eKeysDialog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ export default React.createClass({
164164
</div>
165165
</div>
166166
<div className='mx_Dialog_buttons'>
167-
<input className='mx_Dialog_primary' type='submit' value='Import'
167+
<input className='mx_Dialog_primary' type='submit' value={_t('Import')}
168168
disabled={!this.state.enableSubmit || disableForm}
169169
/>
170170
<button onClick={this._onCancelClick} disabled={disableForm}>
171-
Cancel
171+
{_t("Cancel")}
172172
</button>
173173
</div>
174174
</form>

0 commit comments

Comments
 (0)