Use brand name from config in all strings

This commit is contained in:
J. Ryan Stinnett 2020-07-10 19:07:11 +01:00
parent bb5107a60b
commit 9085627a28
30 changed files with 325 additions and 160 deletions

View file

@ -17,6 +17,7 @@ limitations under the License.
import React from "react";
import { _t } from "../languageHandler";
import SdkConfig from "../SdkConfig";
import dis from "../dispatcher/dispatcher";
import Analytics from "../Analytics";
import AccessibleButton from "../components/views/elements/AccessibleButton";
@ -42,14 +43,17 @@ const onUsageDataClicked = () => {
const TOAST_KEY = "analytics";
export const showToast = (policyUrl?: string) => {
const brand = SdkConfig.get().brand;
ToastStore.sharedInstance().addOrReplaceToast({
key: TOAST_KEY,
title: _t("Help us improve Riot"),
title: _t("Help us improve %(brand)s", { brand }),
props: {
description: _t(
"Send <UsageDataLink>anonymous usage data</UsageDataLink> which helps us improve Riot. " +
"Send <UsageDataLink>anonymous usage data</UsageDataLink> which helps us improve %(brand)s. " +
"This will use a <PolicyLink>cookie</PolicyLink>.",
{},
{
brand,
},
{
"UsageDataLink": (sub) => (
<AccessibleButton kind="link" onClick={onUsageDataClicked}>{ sub }</AccessibleButton>

View file

@ -17,6 +17,7 @@ limitations under the License.
import React from "react";
import { _t } from "../languageHandler";
import SdkConfig from "../SdkConfig";
import GenericToast from "../components/views/toasts/GenericToast";
import ToastStore from "../stores/ToastStore";
import QuestionDialog from "../components/views/dialogs/QuestionDialog";
@ -76,11 +77,12 @@ export const showToast = (version: string, newVersion: string, releaseNotes?: st
acceptLabel = _t("Restart");
}
const brand = SdkConfig.get().brand;
ToastStore.sharedInstance().addOrReplaceToast({
key: TOAST_KEY,
title: _t("Upgrade your Riot"),
title: _t("Upgrade your %(brand)s", { brand }),
props: {
description: _t("A new version of Riot is available!"),
description: _t("A new version of %(brand)s is available!", { brand }),
acceptLabel,
onAccept,
rejectLabel: _t("Later"),