diff --git a/src/async-components/structures/CompatibilityView.tsx b/src/async-components/structures/CompatibilityView.tsx index 07bee042..b42c3f7f 100644 --- a/src/async-components/structures/CompatibilityView.tsx +++ b/src/async-components/structures/CompatibilityView.tsx @@ -16,6 +16,7 @@ limitations under the License. import * as React from "react"; import { _t } from "matrix-react-sdk/src/languageHandler"; +import SdkConfig from 'matrix-react-sdk/src/SdkConfig'; // directly import the style here as this layer does not support rethemedex at this time so no matrix-react-sdk // scss variables will be accessible. @@ -26,6 +27,7 @@ interface IProps { } const CompatibilityView: React.FC = ({ onAccept }) => { + const brand = SdkConfig.get().brand; return
@@ -38,10 +40,12 @@ const CompatibilityView: React.FC = ({ onAccept }) => {
-

{ _t("Your browser can't run Riot") }

+

{ _t("Your browser can't run %(brand)s", { brand }) }

{ _t( - "Riot 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.", + { brand }, ) }

diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index d2a95c8d..952ac7e4 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -2,8 +2,8 @@ "Missing indexeddb worker script!": "Missing indexeddb worker script!", "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.", "Invalid configuration: no default server specified.": "Invalid configuration: no default server specified.", - "Your Riot is misconfigured": "Your Riot is misconfigured", - "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.", + "Your Element is misconfigured": "Your Element is misconfigured", + "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.", "The message from the parser is: %(message)s": "The message from the parser is: %(message)s", "Invalid JSON": "Invalid JSON", "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 @@ "Dismiss": "Dismiss", "Open user settings": "Open user settings", "Previous/next recently visited room or community": "Previous/next recently visited room or community", - "Riot Desktop (%(platformName)s)": "Riot Desktop (%(platformName)s)", + "%(brand)s Desktop (%(platformName)s)": "%(brand)s Desktop (%(platformName)s)", "Go to your browser to complete Sign In": "Go to your browser to complete Sign In", "Unknown device": "Unknown device", "%(appName)s (%(browserName)s, %(osName)s)": "%(appName)s (%(browserName)s, %(osName)s)", @@ -22,8 +22,8 @@ "Custom Server Options": "Custom Server Options", "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.", "Unsupported browser": "Unsupported browser", - "Your browser can't run Riot": "Your browser can't run Riot", - "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.", + "Your browser can't run %(brand)s": "Your browser can't run %(brand)s", + "%(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.", "Please install Chrome, Firefox, or Safari for the best experience.": "Please install Chrome, Firefox, or Safari for the best experience.", "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.", "I understand the risks and wish to continue": "I understand the risks and wish to continue", diff --git a/src/vector/index.ts b/src/vector/index.ts index b3e25a58..e4701ced 100644 --- a/src/vector/index.ts +++ b/src/vector/index.ts @@ -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."), ]); } diff --git a/src/vector/platform/ElectronPlatform.tsx b/src/vector/platform/ElectronPlatform.tsx index c356e0b0..e777e9b5 100644 --- a/src/vector/platform/ElectronPlatform.tsx +++ b/src/vector/platform/ElectronPlatform.tsx @@ -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 {