Skip to content

Commit 5b31589

Browse files
committed
Use brand name from config in all strings
1 parent c135c81 commit 5b31589

4 files changed

Lines changed: 22 additions & 11 deletions

File tree

src/async-components/structures/CompatibilityView.tsx

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

1717
import * as React from "react";
1818
import { _t } from "matrix-react-sdk/src/languageHandler";
19+
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
1920

2021
// directly import the style here as this layer does not support rethemedex at this time so no matrix-react-sdk
2122
// scss variables will be accessible.
@@ -26,6 +27,7 @@ interface IProps {
2627
}
2728

2829
const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
30+
const brand = SdkConfig.get().brand;
2931
return <div className="mx_ErrorView">
3032
<div className="mx_ErrorView_container">
3133
<div className="mx_HomePage_header">
@@ -38,10 +40,12 @@ const CompatibilityView: React.FC<IProps> = ({ onAccept }) => {
3840
<div className="mx_HomePage_col">
3941
<div className="mx_HomePage_row">
4042
<div>
41-
<h2 id="step1_heading">{ _t("Your browser can't run Riot") }</h2>
43+
<h2 id="step1_heading">{ _t("Your browser can't run %(brand)s", { brand }) }</h2>
4244
<p>
4345
{ _t(
44-
"Riot uses advanced browser features which aren't supported by your current browser.",
46+
"%(brand)s uses advanced browser features which aren't " +
47+
"supported by your current browser.",
48+
{ brand },
4549
) }
4650
</p>
4751
<p>

src/i18n/strings/en_EN.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"Missing indexeddb worker script!": "Missing indexeddb worker script!",
33
"Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.": "Invalid configuration: can only specify one of default_server_config, default_server_name, or default_hs_url.",
44
"Invalid configuration: no default server specified.": "Invalid configuration: no default server specified.",
5-
"Your Riot is misconfigured": "Your Riot is misconfigured",
6-
"Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.": "Your Riot configuration contains invalid JSON. Please correct the problem and reload the page.",
5+
"Your Element is misconfigured": "Your Element is misconfigured",
6+
"Your Element configuration contains invalid JSON. Please correct the problem and reload the page.": "Your Element configuration contains invalid JSON. Please correct the problem and reload the page.",
77
"The message from the parser is: %(message)s": "The message from the parser is: %(message)s",
88
"Invalid JSON": "Invalid JSON",
99
"Unable to load config file: please refresh the page to try again.": "Unable to load config file: please refresh the page to try again.",
@@ -13,7 +13,7 @@
1313
"Dismiss": "Dismiss",
1414
"Open user settings": "Open user settings",
1515
"Previous/next recently visited room or community": "Previous/next recently visited room or community",
16-
"Riot Desktop (%(platformName)s)": "Riot Desktop (%(platformName)s)",
16+
"%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)",
1717
"Go to your browser to complete Sign In": "Go to your browser to complete Sign In",
1818
"Unknown device": "Unknown device",
1919
"%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)",
@@ -22,8 +22,8 @@
2222
"Custom Server Options": "Custom Server Options",
2323
"You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.": "You can use the custom server options to sign into other Matrix servers by specifying a different homeserver URL. This allows you to use Riot with an existing Matrix account on a different homeserver.",
2424
"Unsupported browser": "Unsupported browser",
25-
"Your browser can't run Riot": "Your browser can't run Riot",
26-
"Riot uses advanced browser features which aren't supported by your current browser.": "Riot uses advanced browser features which aren't supported by your current browser.",
25+
"Your browser can't run %(brand)s": "Your browser can't run %(brand)s",
26+
"%(brand)s uses advanced browser features which aren't supported by your current browser.": "%(brand)s uses advanced browser features which aren't supported by your current browser.",
2727
"Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.": "Please install <chromeLink>Chrome</chromeLink>, <firefoxLink>Firefox</firefoxLink>, or <safariLink>Safari</safariLink> for the best experience.",
2828
"You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.": "You can continue using your current browser, but some or all features may not work and the look and feel of the application may be incorrect.",
2929
"I understand the risks and wish to continue": "I understand the risks and wish to continue",

src/vector/index.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,9 @@ async function start() {
173173
} catch (error) {
174174
// Now that we've loaded the theme (CSS), display the config syntax error if needed.
175175
if (error.err && error.err instanceof SyntaxError) {
176-
return showError(_t("Your Riot is misconfigured"), [
177-
_t("Your Riot configuration contains invalid JSON. Please correct the problem and reload the page."),
176+
// This uses the default brand since the app config is unavailable.
177+
return showError(_t("Your Element is misconfigured"), [
178+
_t("Your Element configuration contains invalid JSON. Please correct the problem and reload the page."),
178179
_t("The message from the parser is: %(message)s", { message: error.err.message || _t("Invalid JSON")}),
179180
]);
180181
}
@@ -196,7 +197,8 @@ async function start() {
196197
} catch (err) {
197198
console.error(err);
198199
// Like the compatibility page, AWOOOOOGA at the user
199-
await showError(_t("Your Riot is misconfigured"), [
200+
// This uses the default brand since the app config is unavailable.
201+
await showError(_t("Your Element is misconfigured"), [
200202
err.translatedMessage || _t("Unexpected error preparing the app. See console for details."),
201203
]);
202204
}

src/vector/platform/ElectronPlatform.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import BaseEventIndexManager, {
3131
} from 'matrix-react-sdk/src/indexing/BaseEventIndexManager';
3232
import dis from 'matrix-react-sdk/src/dispatcher/dispatcher';
3333
import {_t, _td} from 'matrix-react-sdk/src/languageHandler';
34+
import SdkConfig from 'matrix-react-sdk/src/SdkConfig';
3435
import * as rageshake from 'matrix-react-sdk/src/rageshake/rageshake';
3536
import {MatrixClient} from "matrix-js-sdk/src/client";
3637
import {Room} from "matrix-js-sdk/src/models/room";
@@ -437,7 +438,11 @@ export default class ElectronPlatform extends VectorBasePlatform {
437438
}
438439

439440
getDefaultDeviceDisplayName(): string {
440-
return _t('Riot Desktop (%(platformName)s)', { platformName: platformFriendlyName() });
441+
const brand = SdkConfig.get().brand;
442+
return _t('%(brand)s Desktop (%(platformName)s)', {
443+
brand,
444+
platformName: platformFriendlyName(),
445+
});
441446
}
442447

443448
screenCaptureErrorString(): string | null {

0 commit comments

Comments
 (0)