Migrate more strings to translation keys (#11599)
This commit is contained in:
committed by
GitHub
parent
0583fc8090
commit
d00ba74aaa
@@ -47,14 +47,14 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
|
||||
return (
|
||||
<BaseDialog
|
||||
title={_t("Download %(brand)s", { brand })}
|
||||
title={_t("onboarding|download_brand", { brand })}
|
||||
className="mx_AppDownloadDialog"
|
||||
fixedWidth
|
||||
onFinished={onFinished}
|
||||
>
|
||||
{desktopBuilds?.get("available") && (
|
||||
<div className="mx_AppDownloadDialog_desktop">
|
||||
<Heading size="3">{_t("Download %(brand)s Desktop", { brand })}</Heading>
|
||||
<Heading size="3">{_t("onboarding|download_brand_desktop", { brand })}</Heading>
|
||||
<AccessibleButton
|
||||
kind="primary"
|
||||
element="a"
|
||||
@@ -62,7 +62,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
target="_blank"
|
||||
onClick={() => {}}
|
||||
>
|
||||
{_t("Download %(brand)s Desktop", { brand })}
|
||||
{_t("onboarding|download_brand_desktop", { brand })}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
)}
|
||||
@@ -71,7 +71,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
<Heading size="3">{_t("common|ios")}</Heading>
|
||||
<QRCode data={urlAppStore} margin={0} width={172} />
|
||||
<div className="mx_AppDownloadDialog_info">
|
||||
{_t("%(qrCode)s or %(appLinks)s", {
|
||||
{_t("onboarding|qr_or_app_links", {
|
||||
appLinks: "",
|
||||
qrCode: "",
|
||||
})}
|
||||
@@ -81,7 +81,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
element="a"
|
||||
href={urlAppStore}
|
||||
target="_blank"
|
||||
aria-label={_t("Download on the App Store")}
|
||||
aria-label={_t("onboarding|download_app_store")}
|
||||
onClick={() => {}}
|
||||
>
|
||||
<IOSBadge />
|
||||
@@ -92,7 +92,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
<Heading size="3">{_t("common|android")}</Heading>
|
||||
<QRCode data={urlAndroid} margin={0} width={172} />
|
||||
<div className="mx_AppDownloadDialog_info">
|
||||
{_t("%(qrCode)s or %(appLinks)s", {
|
||||
{_t("onboarding|qr_or_app_links", {
|
||||
appLinks: "",
|
||||
qrCode: "",
|
||||
})}
|
||||
@@ -102,7 +102,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
element="a"
|
||||
href={urlGooglePlay}
|
||||
target="_blank"
|
||||
aria-label={_t("Get it on Google Play")}
|
||||
aria-label={_t("onboarding|download_google_play")}
|
||||
onClick={() => {}}
|
||||
>
|
||||
<GooglePlayBadge />
|
||||
@@ -111,7 +111,7 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
element="a"
|
||||
href={urlFDroid}
|
||||
target="_blank"
|
||||
aria-label={_t("Get it on F-Droid")}
|
||||
aria-label={_t("onboarding|download_f_droid")}
|
||||
onClick={() => {}}
|
||||
>
|
||||
<FDroidBadge />
|
||||
@@ -120,8 +120,8 @@ export const AppDownloadDialog: FC<Props> = ({ onFinished }) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="mx_AppDownloadDialog_legal">
|
||||
<p>{_t("App Store® and the Apple logo® are trademarks of Apple Inc.")}</p>
|
||||
<p>{_t("Google Play and the Google Play logo are trademarks of Google LLC.")}</p>
|
||||
<p>{_t("onboarding|apple_trademarks")}</p>
|
||||
<p>{_t("onboarding|google_trademarks")}</p>
|
||||
</div>
|
||||
</BaseDialog>
|
||||
);
|
||||
|
||||
@@ -74,7 +74,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
|
||||
const dialogAesthetics = {
|
||||
[SSOAuthEntry.PHASE_PREAUTH]: {
|
||||
body: _t("Confirm your account deactivation by using Single Sign On to prove your identity."),
|
||||
continueText: _t("Single Sign On"),
|
||||
continueText: _t("auth|sso"),
|
||||
continueKind: "danger",
|
||||
},
|
||||
[SSOAuthEntry.PHASE_POSTAUTH]: {
|
||||
|
||||
@@ -106,7 +106,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
const [isExporting, setExporting] = useState(false);
|
||||
const sizeLimitRef = useRef<Field>(null);
|
||||
const messageCountRef = useRef<Field>(null);
|
||||
const [exportProgressText, setExportProgressText] = useState(_t("Processing…"));
|
||||
const [exportProgressText, setExportProgressText] = useState(_t("export_chat|processing"));
|
||||
const [displayCancel, setCancelWarning] = useState(false);
|
||||
const [exportCancelled, setExportCancelled] = useState(false);
|
||||
const [exportSuccessful, setExportSuccessful] = useState(false);
|
||||
@@ -173,7 +173,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
invalid: () => {
|
||||
const min = 1;
|
||||
const max = 2000;
|
||||
return _t("Enter a number between %(min)s and %(max)s", {
|
||||
return _t("export_chat|enter_number_between_min_max", {
|
||||
min,
|
||||
max,
|
||||
});
|
||||
@@ -188,7 +188,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
invalid: () => {
|
||||
const min = 1;
|
||||
const max = 2000;
|
||||
return _t("Size can only be a number between %(min)s MB and %(max)s MB", { min, max });
|
||||
return _t("export_chat|size_limit_min_max", { min, max });
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -209,7 +209,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
invalid: () => {
|
||||
const min = 1;
|
||||
const max = 10 ** 8;
|
||||
return _t("Enter a number between %(min)s and %(max)s", {
|
||||
return _t("export_chat|enter_number_between_min_max", {
|
||||
min,
|
||||
max,
|
||||
});
|
||||
@@ -224,7 +224,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
invalid: () => {
|
||||
const min = 1;
|
||||
const max = 10 ** 8;
|
||||
return _t("Number of messages can only be a number between %(min)s and %(max)s", { min, max });
|
||||
return _t("export_chat|num_messages_min_max", { min, max });
|
||||
},
|
||||
},
|
||||
],
|
||||
@@ -270,7 +270,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
value={numberOfMessages.toString()}
|
||||
ref={messageCountRef}
|
||||
onValidate={onValidateNumberOfMessages}
|
||||
label={_t("Number of messages")}
|
||||
label={_t("export_chat|num_messages")}
|
||||
onChange={(e) => {
|
||||
setNumberOfMessages(parseInt(e.target.value));
|
||||
}}
|
||||
@@ -284,8 +284,8 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
// Display successful cancellation message
|
||||
return (
|
||||
<InfoDialog
|
||||
title={_t("Export Cancelled")}
|
||||
description={_t("The export was cancelled successfully")}
|
||||
title={_t("export_chat|cancelled")}
|
||||
description={_t("export_chat|cancelled_detail")}
|
||||
hasCloseButton={true}
|
||||
onFinished={onFinished}
|
||||
/>
|
||||
@@ -294,8 +294,8 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
// Display successful export message
|
||||
return (
|
||||
<InfoDialog
|
||||
title={_t("Export Successful")}
|
||||
description={_t("Your export was successful. Find it in your Downloads folder.")}
|
||||
title={_t("export_chat|successful")}
|
||||
description={_t("export_chat|successful_detail")}
|
||||
hasCloseButton={true}
|
||||
onFinished={onFinished}
|
||||
/>
|
||||
@@ -310,7 +310,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
onFinished={onFinished}
|
||||
fixedWidth={true}
|
||||
>
|
||||
<p>{_t("Are you sure you want to stop exporting your data? If you do, you'll need to start over.")}</p>
|
||||
<p>{_t("export_chat|confirm_stop")}</p>
|
||||
<DialogButtons
|
||||
primaryButton={_t("action|stop")}
|
||||
primaryButtonClass="danger"
|
||||
@@ -325,19 +325,19 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
// Display export settings
|
||||
return (
|
||||
<BaseDialog
|
||||
title={isExporting ? _t("Exporting your data") : _t("Export Chat")}
|
||||
title={isExporting ? _t("export_chat|exporting_your_data") : _t("export_chat|title")}
|
||||
className={`mx_ExportDialog ${isExporting && "mx_ExportDialog_Exporting"}`}
|
||||
contentId="mx_Dialog_content"
|
||||
hasCancel={true}
|
||||
onFinished={onFinished}
|
||||
fixedWidth={true}
|
||||
>
|
||||
{!isExporting ? <p>{_t("Select from the options below to export chats from your timeline")}</p> : null}
|
||||
{!isExporting ? <p>{_t("export_chat|select_option")}</p> : null}
|
||||
|
||||
<div className="mx_ExportDialog_options">
|
||||
{!!setExportFormat && (
|
||||
<>
|
||||
<span className="mx_ExportDialog_subheading">{_t("Format")}</span>
|
||||
<span className="mx_ExportDialog_subheading">{_t("export_chat|format")}</span>
|
||||
|
||||
<StyledRadioGroup
|
||||
name="exportFormat"
|
||||
@@ -350,7 +350,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
|
||||
{!!setExportType && (
|
||||
<>
|
||||
<span className="mx_ExportDialog_subheading">{_t("Messages")}</span>
|
||||
<span className="mx_ExportDialog_subheading">{_t("export_chat|messages")}</span>
|
||||
|
||||
<Field
|
||||
id="export-type"
|
||||
@@ -368,7 +368,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
|
||||
{setSizeLimit && (
|
||||
<>
|
||||
<span className="mx_ExportDialog_subheading">{_t("Size Limit")}</span>
|
||||
<span className="mx_ExportDialog_subheading">{_t("export_chat|size_limit")}</span>
|
||||
|
||||
<Field
|
||||
id="size-limit"
|
||||
@@ -392,7 +392,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
|
||||
checked={includeAttachments}
|
||||
onChange={(e) => setAttachments((e.target as HTMLInputElement).checked)}
|
||||
>
|
||||
{_t("Include Attachments")}
|
||||
{_t("export_chat|include_attachments")}
|
||||
</StyledCheckbox>
|
||||
</>
|
||||
)}
|
||||
|
||||
@@ -99,7 +99,7 @@ export default class InteractiveAuthDialog<T> extends React.Component<Interactiv
|
||||
[SSOAuthEntry.PHASE_PREAUTH]: {
|
||||
title: _t("Use Single Sign On to continue"),
|
||||
body: _t("To continue, use Single Sign On to prove your identity."),
|
||||
continueText: _t("Single Sign On"),
|
||||
continueText: _t("auth|sso"),
|
||||
continueKind: "primary",
|
||||
},
|
||||
[SSOAuthEntry.PHASE_POSTAUTH]: {
|
||||
|
||||
@@ -216,7 +216,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
((this.state.nature == Nature.Other || this.state.nature == NonStandardValue.Admin) && !reason)
|
||||
) {
|
||||
this.setState({
|
||||
err: _t("Please fill why you're reporting."),
|
||||
err: _t("report_content|missing_reason"),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -225,7 +225,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
// We need a `reason`.
|
||||
if (!reason) {
|
||||
this.setState({
|
||||
err: _t("Please fill why you're reporting."),
|
||||
err: _t("report_content|missing_reason"),
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -295,8 +295,8 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
const ignoreUserCheckbox = (
|
||||
<LabelledCheckbox
|
||||
value={this.state.ignoreUserToo}
|
||||
label={_t("Ignore user")}
|
||||
byline={_t("Check if you want to hide all current and future messages from this user.")}
|
||||
label={_t("report_content|ignore_user")}
|
||||
byline={_t("report_content|hide_messages_from_user")}
|
||||
onChange={this.onIgnoreUserTooChanged}
|
||||
disabled={this.state.busy}
|
||||
/>
|
||||
@@ -317,7 +317,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
let subtitle: string;
|
||||
switch (this.state.nature) {
|
||||
case Nature.Disagreement:
|
||||
subtitle = _t("What this user is writing is wrong.\nThis will be reported to the room moderators.");
|
||||
subtitle = _t("report_content|nature_disagreement");
|
||||
break;
|
||||
case Nature.Toxic:
|
||||
subtitle = _t(
|
||||
@@ -353,7 +353,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
);
|
||||
break;
|
||||
default:
|
||||
subtitle = _t("Please pick a nature and describe what makes this message abusive.");
|
||||
subtitle = _t("report_content|nature");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -371,7 +371,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
checked={this.state.nature == Nature.Disagreement}
|
||||
onChange={this.onNatureChosen}
|
||||
>
|
||||
{_t("Disagree")}
|
||||
{_t("report_content|disagree")}
|
||||
</StyledRadioButton>
|
||||
<StyledRadioButton
|
||||
name="nature"
|
||||
@@ -379,7 +379,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
checked={this.state.nature == Nature.Toxic}
|
||||
onChange={this.onNatureChosen}
|
||||
>
|
||||
{_t("Toxic Behaviour")}
|
||||
{_t("report_content|toxic_behaviour")}
|
||||
</StyledRadioButton>
|
||||
<StyledRadioButton
|
||||
name="nature"
|
||||
@@ -387,7 +387,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
checked={this.state.nature == Nature.Illegal}
|
||||
onChange={this.onNatureChosen}
|
||||
>
|
||||
{_t("Illegal Content")}
|
||||
{_t("report_content|illegal_content")}
|
||||
</StyledRadioButton>
|
||||
<StyledRadioButton
|
||||
name="nature"
|
||||
@@ -395,7 +395,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
checked={this.state.nature == Nature.Spam}
|
||||
onChange={this.onNatureChosen}
|
||||
>
|
||||
{_t("Spam or propaganda")}
|
||||
{_t("report_content|spam_or_propaganda")}
|
||||
</StyledRadioButton>
|
||||
<StyledRadioButton
|
||||
name="nature"
|
||||
@@ -403,7 +403,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
checked={this.state.nature == NonStandardValue.Admin}
|
||||
onChange={this.onNatureChosen}
|
||||
>
|
||||
{_t("Report the entire room")}
|
||||
{_t("report_content|report_entire_room")}
|
||||
</StyledRadioButton>
|
||||
<StyledRadioButton
|
||||
name="nature"
|
||||
@@ -443,7 +443,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
||||
<BaseDialog
|
||||
className="mx_ReportEventDialog"
|
||||
onFinished={this.props.onFinished}
|
||||
title={_t("Report Content to Your Homeserver Administrator")}
|
||||
title={_t("report_content|report_content_to_homeserver")}
|
||||
contentId="mx_ReportEventDialog"
|
||||
>
|
||||
<div className="mx_ReportEventDialog" id="mx_ReportEventDialog">
|
||||
|
||||
@@ -114,7 +114,7 @@ export default class CreateCrossSigningDialog extends React.PureComponent<IProps
|
||||
[SSOAuthEntry.PHASE_PREAUTH]: {
|
||||
title: _t("Use Single Sign On to continue"),
|
||||
body: _t("To continue, use Single Sign On to prove your identity."),
|
||||
continueText: _t("Single Sign On"),
|
||||
continueText: _t("auth|sso"),
|
||||
continueKind: "primary",
|
||||
},
|
||||
[SSOAuthEntry.PHASE_POSTAUTH]: {
|
||||
|
||||
@@ -106,7 +106,7 @@ export function RoomResultContextMenus({ room }: Props): JSX.Element {
|
||||
const target = ev.target as HTMLElement;
|
||||
setNotificationMenuPosition(target.getBoundingClientRect());
|
||||
}}
|
||||
title={_t("Notification options")}
|
||||
title={_t("room_list|notification_options")}
|
||||
isExpanded={notificationMenuPosition !== null}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -263,15 +263,15 @@ const findVisibleRoomMembers = (visibleRooms: Room[], cli: MatrixClient, filterD
|
||||
|
||||
const roomAriaUnreadLabel = (room: Room, notification: RoomNotificationState): string | undefined => {
|
||||
if (notification.hasMentions) {
|
||||
return _t("%(count)s unread messages including mentions.", {
|
||||
return _t("a11y|n_unread_messages_mentions", {
|
||||
count: notification.count,
|
||||
});
|
||||
} else if (notification.hasUnreadCount) {
|
||||
return _t("%(count)s unread messages.", {
|
||||
return _t("a11y|n_unread_messages", {
|
||||
count: notification.count,
|
||||
});
|
||||
} else if (notification.isUnread) {
|
||||
return _t("Unread messages.");
|
||||
return _t("a11y|unread_messages");
|
||||
} else {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user