Use brand name from config in all strings

This commit is contained in:
J. Ryan Stinnett 2020-07-13 14:12:44 +01:00
parent c135c819b7
commit 5b31589b3a
4 changed files with 22 additions and 11 deletions

View file

@ -173,8 +173,9 @@ async function start() {
} catch (error) {
// Now that we've loaded the theme (CSS), display the config syntax error if needed.
if (error.err && error.err instanceof SyntaxError) {
return showError(_t("Your Riot is misconfigured"), [
_t("Your Riot configuration contains invalid JSON. Please correct the problem and reload the page."),
// This uses the default brand since the app config is unavailable.
return showError(_t("Your Element is misconfigured"), [
_t("Your Element configuration contains invalid JSON. Please correct the problem and reload the page."),
_t("The message from the parser is: %(message)s", { message: error.err.message || _t("Invalid JSON")}),
]);
}
@ -196,7 +197,8 @@ async function start() {
} catch (err) {
console.error(err);
// Like the compatibility page, AWOOOOOGA at the user
await showError(_t("Your Riot is misconfigured"), [
// This uses the default brand since the app config is unavailable.
await showError(_t("Your Element is misconfigured"), [
err.translatedMessage || _t("Unexpected error preparing the app. See console for details."),
]);
}

View file

@ -31,6 +31,7 @@ import BaseEventIndexManager, {
} from 'matrix-react-sdk/src/indexing/BaseEventIndexManager';
import dis from 'matrix-react-sdk/src/dispatcher/dispatcher';
import {_t, _td} from 'matrix-react-sdk/src/languageHandler';
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
import * as rageshake from 'matrix-react-sdk/src/rageshake/rageshake';
import {MatrixClient} from "matrix-js-sdk/src/client";
import {Room} from "matrix-js-sdk/src/models/room";
@ -437,7 +438,11 @@ export default class ElectronPlatform extends VectorBasePlatform {
}
getDefaultDeviceDisplayName(): string {
return _t('Riot Desktop (%(platformName)s)', { platformName: platformFriendlyName() });
const brand = SdkConfig.get().brand;
return _t('%(brand)s Desktop (%(platformName)s)', {
brand,
platformName: platformFriendlyName(),
});
}
screenCaptureErrorString(): string | null {