Merge branch 'jryans/rename-strings' into 'element'

Update brand name using variable in all strings

See merge request new-vector/element/element-web/matrix-react-sdk!3
This commit is contained in:
J. Ryan Stinnett 2020-07-13 12:23:28 +00:00
commit c77b312fd3
88 changed files with 1478 additions and 6896 deletions

View file

@ -1,6 +1,6 @@
/*
Copyright 2019 New Vector Ltd
Copyright 2019 The Matrix.org Foundation C.I.C.
Copyright 2019, 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -70,10 +70,14 @@ export default class AutoDiscoveryUtils {
let title = _t("Cannot reach homeserver");
let body = _t("Ensure you have a stable internet connection, or get in touch with the server admin");
if (!AutoDiscoveryUtils.isLivelinessError(err)) {
title = _t("Your Riot is misconfigured");
const brand = SdkConfig.get().brand;
title = _t("Your %(brand)s is misconfigured", { brand });
body = _t(
"Ask your Riot admin to check <a>your config</a> for incorrect or duplicate entries.",
{}, {
"Ask your %(brand)s admin to check <a>your config</a> for incorrect or duplicate entries.",
{
brand,
},
{
a: (sub) => {
return <a
href="https://github.com/vector-im/riot-web/blob/master/docs/config.md"

View file

@ -1,5 +1,6 @@
/*
Copyright 2017 Vector Creations Ltd
Copyright 2020 The Matrix.org Foundation C.I.C.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@ -28,7 +29,7 @@ if (!TextDecoder) {
}
import { _t } from '../languageHandler';
import SdkConfig from '../SdkConfig';
const subtleCrypto = window.crypto.subtle || window.crypto.webkitSubtle;
@ -61,23 +62,24 @@ function cryptoFailMsg() {
*/
export async function decryptMegolmKeyFile(data, password) {
const body = unpackMegolmKeyFile(data);
const brand = SdkConfig.get().brand;
// check we have a version byte
if (body.length < 1) {
throw friendlyError('Invalid file: too short',
_t('Not a valid Riot keyfile'));
_t('Not a valid %(brand)s keyfile', { brand }));
}
const version = body[0];
if (version !== 1) {
throw friendlyError('Unsupported version',
_t('Not a valid Riot keyfile'));
_t('Not a valid %(brand)s keyfile', { brand }));
}
const ciphertextLength = body.length-(1+16+16+4+32);
if (ciphertextLength < 0) {
throw friendlyError('Invalid file: too short',
_t('Not a valid Riot keyfile'));
_t('Not a valid %(brand)s keyfile', { brand }));
}
const salt = body.subarray(1, 1+16);