Fix instances of double translation and guard translation calls using typescript (#11443)
Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
d13b6e1b41
commit
ac70f7ac9b
157 changed files with 554 additions and 780 deletions
|
@ -20,7 +20,7 @@ import { Room, EventType } from "matrix-js-sdk/src/matrix";
|
|||
import { sleep } from "matrix-js-sdk/src/utils";
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { _t, _td } from "../../../languageHandler";
|
||||
import { _t, _td, TranslationKey } from "../../../languageHandler";
|
||||
import BaseDialog from "./BaseDialog";
|
||||
import Dropdown from "../elements/Dropdown";
|
||||
import SearchBox from "../../structures/SearchBox";
|
||||
|
@ -357,7 +357,7 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
|
|||
};
|
||||
|
||||
const defaultRendererFactory =
|
||||
(title: string): Renderer =>
|
||||
(title: TranslationKey): Renderer =>
|
||||
(rooms, selectedToAdd, { scrollTop, height }, onChange) =>
|
||||
(
|
||||
<div className="mx_AddExistingToSpace_section">
|
||||
|
|
|
@ -78,9 +78,7 @@ export const AnalyticsLearnMoreDialog: React.FC<IProps> = ({
|
|||
<div className="mx_AnalyticsLearnMore_image_holder" />
|
||||
<div className="mx_AnalyticsLearnMore_copy">
|
||||
{_t(
|
||||
"Help us identify issues and improve %(analyticsOwner)s by sharing anonymous usage data. " +
|
||||
"To understand how people use multiple devices, we'll generate a random identifier, " +
|
||||
"shared by your devices.",
|
||||
"Help us identify issues and improve %(analyticsOwner)s by sharing anonymous usage data. To understand how people use multiple devices, we'll generate a random identifier, shared by your devices.",
|
||||
{ analyticsOwner },
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -224,10 +224,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
|||
{warning}
|
||||
<p>
|
||||
{_t(
|
||||
"Debug logs contain application usage data including your " +
|
||||
"username, the IDs or aliases of the rooms you " +
|
||||
"have visited, which UI elements you last interacted with, " +
|
||||
"and the usernames of other users. They do not contain messages.",
|
||||
"Debug logs contain application usage data including your username, the IDs or aliases of the rooms you have visited, which UI elements you last interacted with, and the usernames of other users. They do not contain messages.",
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
|
@ -273,10 +270,7 @@ export default class BugReportDialog extends React.Component<IProps, IState> {
|
|||
onChange={this.onTextChange}
|
||||
value={this.state.text}
|
||||
placeholder={_t(
|
||||
"If there is additional context that would help in " +
|
||||
"analysing the issue, such as what you were doing at " +
|
||||
"the time, room IDs, user IDs, etc., " +
|
||||
"please include those things here.",
|
||||
"If there is additional context that would help in analysing the issue, such as what you were doing at the time, room IDs, user IDs, etc., please include those things here.",
|
||||
)}
|
||||
/>
|
||||
{progress}
|
||||
|
|
|
@ -114,16 +114,13 @@ const BulkRedactDialog: React.FC<Props> = (props) => {
|
|||
<div className="mx_Dialog_content" id="mx_Dialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"You are about to remove %(count)s messages by %(user)s. " +
|
||||
"This will remove them permanently for everyone in the conversation. " +
|
||||
"Do you wish to continue?",
|
||||
"You are about to remove %(count)s messages by %(user)s. This will remove them permanently for everyone in the conversation. Do you wish to continue?",
|
||||
{ count, user },
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
{_t(
|
||||
"For a large amount of messages, this might take some time. " +
|
||||
"Please don't refresh your client in the meantime.",
|
||||
"For a large amount of messages, this might take some time. Please don't refresh your client in the meantime.",
|
||||
)}
|
||||
</p>
|
||||
<StyledCheckbox checked={keepStateEvents} onChange={(e) => setKeepStateEvents(e.target.checked)}>
|
||||
|
@ -131,8 +128,7 @@ const BulkRedactDialog: React.FC<Props> = (props) => {
|
|||
</StyledCheckbox>
|
||||
<div className="mx_BulkRedactDialog_checkboxMicrocopy">
|
||||
{_t(
|
||||
"Uncheck if you also want to remove system messages on this user " +
|
||||
"(e.g. membership change, profile change…)",
|
||||
"Uncheck if you also want to remove system messages on this user (e.g. membership change, profile change…)",
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -26,8 +26,7 @@ export const createCantStartVoiceMessageBroadcastDialog = (): void => {
|
|||
description: (
|
||||
<p>
|
||||
{_t(
|
||||
"You can't start a voice message as you are currently recording a live broadcast. " +
|
||||
"Please end your live broadcast in order to start recording a voice message.",
|
||||
"You can't start a voice message as you are currently recording a live broadcast. Please end your live broadcast in order to start recording a voice message.",
|
||||
)}
|
||||
</p>
|
||||
),
|
||||
|
|
|
@ -44,8 +44,7 @@ export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
|
|||
<div className="mx_ConfirmWipeDeviceDialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"Clearing all data from this session is permanent. Encrypted messages will be lost " +
|
||||
"unless their keys have been backed up.",
|
||||
"Clearing all data from this session is permanent. Encrypted messages will be lost unless their keys have been backed up.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -311,8 +311,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
}
|
||||
} else {
|
||||
microcopy = _t(
|
||||
"Your server admin has disabled end-to-end encryption by default " +
|
||||
"in private rooms & Direct Messages.",
|
||||
"Your server admin has disabled end-to-end encryption by default in private rooms & Direct Messages.",
|
||||
);
|
||||
}
|
||||
e2eeSection = (
|
||||
|
@ -330,15 +329,13 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
let federateLabel = _t(
|
||||
"You might enable this if the room will only be used for collaborating with internal " +
|
||||
"teams on your homeserver. This cannot be changed later.",
|
||||
"You might enable this if the room will only be used for collaborating with internal teams on your homeserver. This cannot be changed later.",
|
||||
);
|
||||
if (SdkConfig.get().default_federate === false) {
|
||||
// We only change the label if the default setting is different to avoid jarring text changes to the
|
||||
// user. They will have read the implications of turning this off/on, so no need to rephrase for them.
|
||||
federateLabel = _t(
|
||||
"You might disable this if the room will be used for collaborating with external " +
|
||||
"teams who have their own homeserver. This cannot be changed later.",
|
||||
"You might disable this if the room will be used for collaborating with external teams who have their own homeserver. This cannot be changed later.",
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,7 @@ const CryptoStoreTooNewDialog: React.FC<IProps> = (props: IProps) => {
|
|||
Modal.createDialog(QuestionDialog, {
|
||||
title: _t("Sign out"),
|
||||
description: _t(
|
||||
"To avoid losing your chat history, you must export your room keys " +
|
||||
"before logging out. You will need to go back to the newer version of " +
|
||||
"%(brand)s to do this",
|
||||
"To avoid losing your chat history, you must export your room keys before logging out. You will need to go back to the newer version of %(brand)s to do this",
|
||||
{ brand },
|
||||
),
|
||||
button: _t("Sign out"),
|
||||
|
@ -53,9 +51,7 @@ const CryptoStoreTooNewDialog: React.FC<IProps> = (props: IProps) => {
|
|||
};
|
||||
|
||||
const description = _t(
|
||||
"You've previously used a newer version of %(brand)s with this session. " +
|
||||
"To use this version again with end to end encryption, you will " +
|
||||
"need to sign out and back in again.",
|
||||
"You've previously used a newer version of %(brand)s with this session. To use this version again with end to end encryption, you will need to sign out and back in again.",
|
||||
{ brand },
|
||||
);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
|
||||
import React, { useState } from "react";
|
||||
|
||||
import { _t, _td } from "../../../languageHandler";
|
||||
import { _t, _td, TranslationKey } from "../../../languageHandler";
|
||||
import MatrixClientContext from "../../../contexts/MatrixClientContext";
|
||||
import BaseDialog from "./BaseDialog";
|
||||
import { TimelineEventEditor } from "./devtools/Event";
|
||||
|
@ -40,13 +40,13 @@ enum Category {
|
|||
Other,
|
||||
}
|
||||
|
||||
const categoryLabels: Record<Category, string> = {
|
||||
const categoryLabels: Record<Category, TranslationKey> = {
|
||||
[Category.Room]: _td("Room"),
|
||||
[Category.Other]: _td("Other"),
|
||||
};
|
||||
|
||||
export type Tool = React.FC<IDevtoolsProps> | ((props: IDevtoolsProps) => JSX.Element);
|
||||
const Tools: Record<Category, [label: string, tool: Tool][]> = {
|
||||
const Tools: Record<Category, [label: TranslationKey, tool: Tool][]> = {
|
||||
[Category.Room]: [
|
||||
[_td("Send custom timeline event"), TimelineEventEditor],
|
||||
[_td("Explore room state"), RoomStateExplorer],
|
||||
|
|
|
@ -70,9 +70,7 @@ export default class EndPollDialog extends React.Component<IProps> {
|
|||
<QuestionDialog
|
||||
title={_t("End Poll")}
|
||||
description={_t(
|
||||
"Are you sure you want to end this poll? " +
|
||||
"This will show the final results of the poll and " +
|
||||
"stop people from being able to vote.",
|
||||
"Are you sure you want to end this poll? This will show the final results of the poll and stop people from being able to vote.",
|
||||
)}
|
||||
button={_t("End Poll")}
|
||||
onFinished={(endPoll: boolean) => this.onFinished(endPoll)}
|
||||
|
|
|
@ -96,8 +96,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
|||
bugReports = (
|
||||
<p className="mx_FeedbackDialog_section_microcopy">
|
||||
{_t(
|
||||
"PRO TIP: If you start a bug, please submit <debugLogsLink>debug logs</debugLogsLink> " +
|
||||
"to help us track down the problem.",
|
||||
"PRO TIP: If you start a bug, please submit <debugLogsLink>debug logs</debugLogsLink> to help us track down the problem.",
|
||||
{},
|
||||
{
|
||||
debugLogsLink: (sub) => (
|
||||
|
@ -125,8 +124,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
|
|||
<h3>{_t("Report a bug")}</h3>
|
||||
<p>
|
||||
{_t(
|
||||
"Please view <existingIssuesLink>existing bugs on Github</existingIssuesLink> first. " +
|
||||
"No match? <newIssueLink>Start a new one</newIssueLink>.",
|
||||
"Please view <existingIssuesLink>existing bugs on Github</existingIssuesLink> first. No match? <newIssueLink>Start a new one</newIssueLink>.",
|
||||
{},
|
||||
{
|
||||
existingIssuesLink: (sub) => {
|
||||
|
|
|
@ -181,17 +181,14 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
|||
const userDetailText = [
|
||||
<p key="p1">
|
||||
{_t(
|
||||
"Verify this user to mark them as trusted. " +
|
||||
"Trusting users gives you extra peace of mind when using " +
|
||||
"end-to-end encrypted messages.",
|
||||
"Verify this user to mark them as trusted. Trusting users gives you extra peace of mind when using end-to-end encrypted messages.",
|
||||
)}
|
||||
</p>,
|
||||
<p key="p2">
|
||||
{_t(
|
||||
// NB. Below wording adjusted to singular 'session' until we have
|
||||
// cross-signing
|
||||
"Verifying this user will mark their session as trusted, and " +
|
||||
"also mark your session as trusted to them.",
|
||||
"Verifying this user will mark their session as trusted, and also mark your session as trusted to them.",
|
||||
)}
|
||||
</p>,
|
||||
];
|
||||
|
@ -199,15 +196,12 @@ export default class IncomingSasDialog extends React.Component<IProps, IState> {
|
|||
const selfDetailText = [
|
||||
<p key="p1">
|
||||
{_t(
|
||||
"Verify this device to mark it as trusted. " +
|
||||
"Trusting this device gives you and other users extra peace of mind when using " +
|
||||
"end-to-end encrypted messages.",
|
||||
"Verify this device to mark it as trusted. Trusting this device gives you and other users extra peace of mind when using end-to-end encrypted messages.",
|
||||
)}
|
||||
</p>,
|
||||
<p key="p2">
|
||||
{_t(
|
||||
"Verifying this device will mark it as trusted, and users who have verified with " +
|
||||
"you will trust this device.",
|
||||
"Verifying this device will mark it as trusted, and users who have verified with you will trust this device.",
|
||||
)}
|
||||
</p>,
|
||||
];
|
||||
|
|
|
@ -43,8 +43,7 @@ export default class IntegrationsImpossibleDialog extends React.Component<IProps
|
|||
<div className="mx_IntegrationsImpossibleDialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"Your %(brand)s doesn't allow you to use an integration manager to do this. " +
|
||||
"Please contact an admin.",
|
||||
"Your %(brand)s doesn't allow you to use an integration manager to do this. Please contact an admin.",
|
||||
{ brand },
|
||||
)}
|
||||
</p>
|
||||
|
|
|
@ -1133,9 +1133,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
return (
|
||||
<div className="mx_InviteDialog_identityServer">
|
||||
{_t(
|
||||
"Use an identity server to invite by email. " +
|
||||
"<default>Use the default (%(defaultIdentityServerName)s)</default> " +
|
||||
"or manage in <settings>Settings</settings>.",
|
||||
"Use an identity server to invite by email. <default>Use the default (%(defaultIdentityServerName)s)</default> or manage in <settings>Settings</settings>.",
|
||||
{
|
||||
defaultIdentityServerName: abbreviateUrl(defaultIdentityServerUrl),
|
||||
},
|
||||
|
@ -1158,7 +1156,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
return (
|
||||
<div className="mx_InviteDialog_identityServer">
|
||||
{_t(
|
||||
"Use an identity server to invite by email. " + "Manage in <settings>Settings</settings>.",
|
||||
"Use an identity server to invite by email. Manage in <settings>Settings</settings>.",
|
||||
{},
|
||||
{
|
||||
settings: (sub) => (
|
||||
|
@ -1349,23 +1347,21 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
|
|||
if (isSpace) {
|
||||
if (identityServersEnabled) {
|
||||
helpTextUntranslated = _td(
|
||||
"Invite someone using their name, email address, username " +
|
||||
"(like <userId/>) or <a>share this space</a>.",
|
||||
"Invite someone using their name, email address, username (like <userId/>) or <a>share this space</a>.",
|
||||
);
|
||||
} else {
|
||||
helpTextUntranslated = _td(
|
||||
"Invite someone using their name, username " + "(like <userId/>) or <a>share this space</a>.",
|
||||
"Invite someone using their name, username (like <userId/>) or <a>share this space</a>.",
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (identityServersEnabled) {
|
||||
helpTextUntranslated = _td(
|
||||
"Invite someone using their name, email address, username " +
|
||||
"(like <userId/>) or <a>share this room</a>.",
|
||||
"Invite someone using their name, email address, username (like <userId/>) or <a>share this room</a>.",
|
||||
);
|
||||
} else {
|
||||
helpTextUntranslated = _td(
|
||||
"Invite someone using their name, username " + "(like <userId/>) or <a>share this room</a>.",
|
||||
"Invite someone using their name, username (like <userId/>) or <a>share this room</a>.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,19 +29,14 @@ interface IProps {
|
|||
const LazyLoadingDisabledDialog: React.FC<IProps> = (props) => {
|
||||
const brand = SdkConfig.get().brand;
|
||||
const description1 = _t(
|
||||
"You've previously used %(brand)s on %(host)s with lazy loading of members enabled. " +
|
||||
"In this version lazy loading is disabled. " +
|
||||
"As the local cache is not compatible between these two settings, " +
|
||||
"%(brand)s needs to resync your account.",
|
||||
"You've previously used %(brand)s on %(host)s with lazy loading of members enabled. In this version lazy loading is disabled. As the local cache is not compatible between these two settings, %(brand)s needs to resync your account.",
|
||||
{
|
||||
brand,
|
||||
host: props.host,
|
||||
},
|
||||
);
|
||||
const description2 = _t(
|
||||
"If the other version of %(brand)s is still open in another tab, " +
|
||||
"please close it as using %(brand)s on the same host with both " +
|
||||
"lazy loading enabled and disabled simultaneously will cause issues.",
|
||||
"If the other version of %(brand)s is still open in another tab, please close it as using %(brand)s on the same host with both lazy loading enabled and disabled simultaneously will cause issues.",
|
||||
{
|
||||
brand,
|
||||
},
|
||||
|
|
|
@ -28,9 +28,7 @@ interface IProps {
|
|||
const LazyLoadingResyncDialog: React.FC<IProps> = (props) => {
|
||||
const brand = SdkConfig.get().brand;
|
||||
const description = _t(
|
||||
"%(brand)s now uses 3-5x less memory, by only loading information " +
|
||||
"about other users when needed. Please wait whilst we resynchronise " +
|
||||
"with the server!",
|
||||
"%(brand)s now uses 3-5x less memory, by only loading information about other users when needed. Please wait whilst we resynchronise with the server!",
|
||||
{ brand },
|
||||
);
|
||||
|
||||
|
|
|
@ -63,15 +63,12 @@ const LeaveSpaceDialog: React.FC<IProps> = ({ space, onFinished }) => {
|
|||
|
||||
let onlyAdminWarning;
|
||||
if (isOnlyAdmin(space)) {
|
||||
onlyAdminWarning = _t(
|
||||
"You're the only admin of this space. " + "Leaving it will mean no one has control over it.",
|
||||
);
|
||||
onlyAdminWarning = _t("You're the only admin of this space. Leaving it will mean no one has control over it.");
|
||||
} else {
|
||||
const numChildrenOnlyAdminIn = roomsToLeave.filter(isOnlyAdmin).length;
|
||||
if (numChildrenOnlyAdminIn > 0) {
|
||||
onlyAdminWarning = _t(
|
||||
"You're the only admin of some of the rooms or spaces you wish to leave. " +
|
||||
"Leaving them will leave them without any admins.",
|
||||
"You're the only admin of some of the rooms or spaces you wish to leave. Leaving them will leave them without any admins.",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,16 +138,12 @@ export default class LogoutDialog extends React.Component<IProps, IState> {
|
|||
<div>
|
||||
<p>
|
||||
{_t(
|
||||
"Encrypted messages are secured with end-to-end encryption. " +
|
||||
"Only you and the recipient(s) have the keys to read these messages.",
|
||||
"Encrypted messages are secured with end-to-end encryption. Only you and the recipient(s) have the keys to read these messages.",
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
{_t(
|
||||
"When you sign out, these keys will be deleted from this device, " +
|
||||
"which means you won't be able to read encrypted messages unless you " +
|
||||
"have the keys for them on your other devices, or backed them up to the " +
|
||||
"server.",
|
||||
"When you sign out, these keys will be deleted from this device, which means you won't be able to read encrypted messages unless you have the keys for them on your other devices, or backed them up to the server.",
|
||||
)}
|
||||
</p>
|
||||
<p>{_t("Back up your keys before signing out to avoid losing them.")}</p>
|
||||
|
|
|
@ -152,8 +152,7 @@ const ManageRestrictedJoinRuleDialog: React.FC<IProps> = ({ room, selected = [],
|
|||
>
|
||||
<p>
|
||||
{_t(
|
||||
"Decide which spaces can access this room. " +
|
||||
"If a space is selected, its members can find and join <RoomName/>.",
|
||||
"Decide which spaces can access this room. If a space is selected, its members can find and join <RoomName/>.",
|
||||
{},
|
||||
{
|
||||
RoomName: () => <b>{room.name}</b>,
|
||||
|
|
|
@ -59,8 +59,7 @@ const RegistrationEmailPromptDialog: React.FC<IProps> = ({ onFinished }) => {
|
|||
<div className="mx_Dialog_content" id="mx_RegistrationEmailPromptDialog">
|
||||
<p>
|
||||
{_t(
|
||||
"Just a heads up, if you don't add an email and forget your password, you could " +
|
||||
"<b>permanently lose access to your account</b>.",
|
||||
"Just a heads up, if you don't add an email and forget your password, you could <b>permanently lose access to your account</b>.",
|
||||
{},
|
||||
{
|
||||
b: (sub) => <b>{sub}</b>,
|
||||
|
|
|
@ -317,54 +317,39 @@ 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.\n" + "This will be reported to the room moderators.",
|
||||
);
|
||||
subtitle = _t("What this user is writing is wrong.\nThis will be reported to the room moderators.");
|
||||
break;
|
||||
case Nature.Toxic:
|
||||
subtitle = _t(
|
||||
"This user is displaying toxic behaviour, " +
|
||||
"for instance by insulting other users or sharing " +
|
||||
"adult-only content in a family-friendly room " +
|
||||
"or otherwise violating the rules of this room.\n" +
|
||||
"This will be reported to the room moderators.",
|
||||
"This user is displaying toxic behaviour, for instance by insulting other users or sharing adult-only content in a family-friendly room or otherwise violating the rules of this room.\nThis will be reported to the room moderators.",
|
||||
);
|
||||
break;
|
||||
case Nature.Illegal:
|
||||
subtitle = _t(
|
||||
"This user is displaying illegal behaviour, " +
|
||||
"for instance by doxing people or threatening violence.\n" +
|
||||
"This will be reported to the room moderators who may escalate this to legal authorities.",
|
||||
"This user is displaying illegal behaviour, for instance by doxing people or threatening violence.\nThis will be reported to the room moderators who may escalate this to legal authorities.",
|
||||
);
|
||||
break;
|
||||
case Nature.Spam:
|
||||
subtitle = _t(
|
||||
"This user is spamming the room with ads, links to ads or to propaganda.\n" +
|
||||
"This will be reported to the room moderators.",
|
||||
"This user is spamming the room with ads, links to ads or to propaganda.\nThis will be reported to the room moderators.",
|
||||
);
|
||||
break;
|
||||
case NonStandardValue.Admin:
|
||||
if (client.isRoomEncrypted(this.props.mxEvent.getRoomId()!)) {
|
||||
subtitle = _t(
|
||||
"This room is dedicated to illegal or toxic content " +
|
||||
"or the moderators fail to moderate illegal or toxic content.\n" +
|
||||
"This will be reported to the administrators of %(homeserver)s. " +
|
||||
"The administrators will NOT be able to read the encrypted content of this room.",
|
||||
"This room is dedicated to illegal or toxic content or the moderators fail to moderate illegal or toxic content.\nThis will be reported to the administrators of %(homeserver)s. The administrators will NOT be able to read the encrypted content of this room.",
|
||||
{ homeserver: homeServerName },
|
||||
);
|
||||
} else {
|
||||
subtitle = _t(
|
||||
"This room is dedicated to illegal or toxic content " +
|
||||
"or the moderators fail to moderate illegal or toxic content.\n" +
|
||||
"This will be reported to the administrators of %(homeserver)s.",
|
||||
"This room is dedicated to illegal or toxic content or the moderators fail to moderate illegal or toxic content.\nThis will be reported to the administrators of %(homeserver)s.",
|
||||
{ homeserver: homeServerName },
|
||||
);
|
||||
}
|
||||
break;
|
||||
case Nature.Other:
|
||||
subtitle = _t(
|
||||
"Any other reason. Please describe the problem.\n" +
|
||||
"This will be reported to the room moderators.",
|
||||
"Any other reason. Please describe the problem.\nThis will be reported to the room moderators.",
|
||||
);
|
||||
break;
|
||||
default:
|
||||
|
@ -464,10 +449,7 @@ export default class ReportEventDialog extends React.Component<IProps, IState> {
|
|||
<div className="mx_ReportEventDialog" id="mx_ReportEventDialog">
|
||||
<p>
|
||||
{_t(
|
||||
"Reporting this message will send its unique 'event ID' to the administrator of " +
|
||||
"your homeserver. If messages in this room are encrypted, your homeserver " +
|
||||
"administrator will not be able to read the message text or view any files " +
|
||||
"or images.",
|
||||
"Reporting this message will send its unique 'event ID' to the administrator of your homeserver. If messages in this room are encrypted, your homeserver administrator will not be able to read the message text or view any files or images.",
|
||||
)}
|
||||
</p>
|
||||
{adminMessage}
|
||||
|
|
|
@ -94,9 +94,7 @@ export default class RoomUpgradeDialog extends React.Component<IProps, IState> {
|
|||
>
|
||||
<p>
|
||||
{_t(
|
||||
"Upgrading this room requires closing down the current " +
|
||||
"instance of the room and creating a new room in its place. " +
|
||||
"To give room members the best possible experience, we will:",
|
||||
"Upgrading this room requires closing down the current instance of the room and creating a new room in its place. To give room members the best possible experience, we will:",
|
||||
)}
|
||||
</p>
|
||||
<ol>
|
||||
|
@ -104,14 +102,12 @@ export default class RoomUpgradeDialog extends React.Component<IProps, IState> {
|
|||
<li>{_t("Update any local room aliases to point to the new room")}</li>
|
||||
<li>
|
||||
{_t(
|
||||
"Stop users from speaking in the old version of the room, " +
|
||||
"and post a message advising users to move to the new room",
|
||||
"Stop users from speaking in the old version of the room, and post a message advising users to move to the new room",
|
||||
)}
|
||||
</li>
|
||||
<li>
|
||||
{_t(
|
||||
"Put a link back to the old room at the start of the new room " +
|
||||
"so people can see old messages",
|
||||
"Put a link back to the old room at the start of the new room so people can see old messages",
|
||||
)}
|
||||
</li>
|
||||
</ol>
|
||||
|
|
|
@ -135,8 +135,7 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
|
|||
let bugReports = (
|
||||
<p>
|
||||
{_t(
|
||||
"This usually only affects how the room is processed on the server. If you're " +
|
||||
"having problems with your %(brand)s, please report a bug.",
|
||||
"This usually only affects how the room is processed on the server. If you're having problems with your %(brand)s, please report a bug.",
|
||||
{ brand },
|
||||
)}
|
||||
</p>
|
||||
|
@ -145,8 +144,7 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
|
|||
bugReports = (
|
||||
<p>
|
||||
{_t(
|
||||
"This usually only affects how the room is processed on the server. If you're " +
|
||||
"having problems with your %(brand)s, please <a>report a bug</a>.",
|
||||
"This usually only affects how the room is processed on the server. If you're having problems with your %(brand)s, please <a>report a bug</a>.",
|
||||
{
|
||||
brand,
|
||||
},
|
||||
|
@ -195,14 +193,12 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
|
|||
<p>
|
||||
{this.props.description ||
|
||||
_t(
|
||||
"Upgrading a room is an advanced action and is usually recommended when a room " +
|
||||
"is unstable due to bugs, missing features or security vulnerabilities.",
|
||||
"Upgrading a room is an advanced action and is usually recommended when a room is unstable due to bugs, missing features or security vulnerabilities.",
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
{_t(
|
||||
"<b>Please note upgrading will make a new version of the room</b>. " +
|
||||
"All current messages will stay in this archived room.",
|
||||
"<b>Please note upgrading will make a new version of the room</b>. All current messages will stay in this archived room.",
|
||||
{},
|
||||
{
|
||||
b: (sub) => <b>{sub}</b>,
|
||||
|
|
|
@ -107,8 +107,7 @@ export default class ServerOfflineDialog extends React.PureComponent<IProps> {
|
|||
<div className="mx_ServerOfflineDialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"Your server isn't responding to some of your requests. " +
|
||||
"Below are some of the most likely reasons.",
|
||||
"Your server isn't responding to some of your requests. Below are some of the most likely reasons.",
|
||||
)}
|
||||
</p>
|
||||
<ul>
|
||||
|
|
|
@ -37,9 +37,7 @@ export default class SeshatResetDialog extends React.PureComponent<Props> {
|
|||
{_t("You most likely do not want to reset your event index store")}
|
||||
<br />
|
||||
{_t(
|
||||
"If you do, please note that none of your messages will be deleted, " +
|
||||
"but the search experience might be degraded for a few moments " +
|
||||
"whilst the index is recreated",
|
||||
"If you do, please note that none of your messages will be deleted, but the search experience might be degraded for a few moments whilst the index is recreated",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -101,17 +101,14 @@ export default class SessionRestoreErrorDialog extends React.Component<IProps> {
|
|||
|
||||
<p>
|
||||
{_t(
|
||||
"If you have previously used a more recent version of %(brand)s, your session " +
|
||||
"may be incompatible with this version. Close this window and return " +
|
||||
"to the more recent version.",
|
||||
"If you have previously used a more recent version of %(brand)s, your session may be incompatible with this version. Close this window and return to the more recent version.",
|
||||
{ brand },
|
||||
)}
|
||||
</p>
|
||||
|
||||
<p>
|
||||
{_t(
|
||||
"Clearing your browser's storage may fix the problem, but will sign you " +
|
||||
"out and cause any encrypted chat history to become unreadable.",
|
||||
"Clearing your browser's storage may fix the problem, but will sign you out and cause any encrypted chat history to become unreadable.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -78,8 +78,7 @@ export default class SetEmailDialog extends React.Component<IProps, IState> {
|
|||
Modal.createDialog(QuestionDialog, {
|
||||
title: _t("Verification Pending"),
|
||||
description: _t(
|
||||
"Please check your email and click on the link it contains. Once this " +
|
||||
"is done, click continue.",
|
||||
"Please check your email and click on the link it contains. Once this is done, click continue.",
|
||||
),
|
||||
button: _t("Continue"),
|
||||
onFinished: this.onEmailDialogFinished,
|
||||
|
|
|
@ -59,8 +59,7 @@ const SpacePreferencesAppearanceTab: React.FC<Pick<IProps, "space">> = ({ space
|
|||
</StyledCheckbox>
|
||||
<SettingsSubsectionText>
|
||||
{_t(
|
||||
"This groups your chats with members of this space. " +
|
||||
"Turning this off will hide those chats from your view of %(spaceName)s.",
|
||||
"This groups your chats with members of this space. Turning this off will hide those chats from your view of %(spaceName)s.",
|
||||
{
|
||||
spaceName: space.name,
|
||||
},
|
||||
|
|
|
@ -65,9 +65,7 @@ export default class StorageEvictedDialog extends React.Component<IProps> {
|
|||
<div className="mx_Dialog_content" id="mx_Dialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"Some session data, including encrypted message keys, is " +
|
||||
"missing. Sign out and sign in to fix this, restoring keys " +
|
||||
"from backup.",
|
||||
"Some session data, including encrypted message keys, is missing. Sign out and sign in to fix this, restoring keys from backup.",
|
||||
)}
|
||||
</p>
|
||||
<p>
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
import React, { ChangeEvent, createRef } from "react";
|
||||
|
||||
import Field from "../elements/Field";
|
||||
import { _t, _td } from "../../../languageHandler";
|
||||
import { _t, _td, TranslationKey } from "../../../languageHandler";
|
||||
import { IFieldState, IValidationResult } from "../elements/Validation";
|
||||
import BaseDialog from "./BaseDialog";
|
||||
import DialogButtons from "../elements/DialogButtons";
|
||||
|
@ -28,7 +28,7 @@ interface IProps {
|
|||
value: string;
|
||||
placeholder?: string;
|
||||
button?: string;
|
||||
busyMessage: string; // pass _td string
|
||||
busyMessage: TranslationKey;
|
||||
focus: boolean;
|
||||
hasCancel: boolean;
|
||||
validator?: (fieldState: IFieldState) => Promise<IValidationResult>; // result of withValidation
|
||||
|
|
|
@ -49,8 +49,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
|
|||
let buttons;
|
||||
if (this.props.totalFiles === 1 && this.props.badFiles.length === 1) {
|
||||
message = _t(
|
||||
"This file is <b>too large</b> to upload. " +
|
||||
"The file size limit is %(limit)s but this file is %(sizeOfThisFile)s.",
|
||||
"This file is <b>too large</b> to upload. The file size limit is %(limit)s but this file is %(sizeOfThisFile)s.",
|
||||
{
|
||||
limit: fileSize(this.props.contentMessages.getUploadLimit()),
|
||||
sizeOfThisFile: fileSize(this.props.badFiles[0].size),
|
||||
|
@ -69,7 +68,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
|
|||
);
|
||||
} else if (this.props.totalFiles === this.props.badFiles.length) {
|
||||
message = _t(
|
||||
"These files are <b>too large</b> to upload. " + "The file size limit is %(limit)s.",
|
||||
"These files are <b>too large</b> to upload. The file size limit is %(limit)s.",
|
||||
{
|
||||
limit: fileSize(this.props.contentMessages.getUploadLimit()),
|
||||
},
|
||||
|
@ -87,7 +86,7 @@ export default class UploadFailureDialog extends React.Component<IProps> {
|
|||
);
|
||||
} else {
|
||||
message = _t(
|
||||
"Some files are <b>too large</b> to be uploaded. " + "The file size limit is %(limit)s.",
|
||||
"Some files are <b>too large</b> to be uploaded. The file size limit is %(limit)s.",
|
||||
{
|
||||
limit: fileSize(this.props.contentMessages.getUploadLimit()),
|
||||
},
|
||||
|
|
|
@ -18,7 +18,7 @@ limitations under the License.
|
|||
import React, { ChangeEvent, ReactNode, useContext, useMemo, useRef, useState } from "react";
|
||||
import { IContent, MatrixEvent } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { _t, _td } from "../../../../languageHandler";
|
||||
import { _t, _td, TranslationKey } from "../../../../languageHandler";
|
||||
import Field from "../../elements/Field";
|
||||
import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool";
|
||||
import MatrixClientContext from "../../../../contexts/MatrixClientContext";
|
||||
|
@ -37,7 +37,7 @@ interface IEventEditorProps extends Pick<IDevtoolsProps, "onBack"> {
|
|||
|
||||
interface IFieldDef {
|
||||
id: string;
|
||||
label: string; // _td
|
||||
label: TranslationKey;
|
||||
default?: string;
|
||||
}
|
||||
|
||||
|
|
|
@ -21,12 +21,12 @@ import { VerificationPhase as Phase, VerificationRequestEvent } from "matrix-js-
|
|||
import { CryptoEvent } from "matrix-js-sdk/src/crypto";
|
||||
|
||||
import { useTypedEventEmitter, useTypedEventEmitterState } from "../../../../hooks/useEventEmitter";
|
||||
import { _t, _td } from "../../../../languageHandler";
|
||||
import { _t, _td, TranslationKey } from "../../../../languageHandler";
|
||||
import MatrixClientContext from "../../../../contexts/MatrixClientContext";
|
||||
import BaseTool, { DevtoolsContext, IDevtoolsProps } from "./BaseTool";
|
||||
import { Tool } from "../DevtoolsDialog";
|
||||
|
||||
const PHASE_MAP: Record<Phase, string> = {
|
||||
const PHASE_MAP: Record<Phase, TranslationKey> = {
|
||||
[Phase.Unsent]: _td("Unsent"),
|
||||
[Phase.Requested]: _td("Requested"),
|
||||
[Phase.Ready]: _td("Ready"),
|
||||
|
|
|
@ -305,8 +305,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
|||
<p>{_t("Only do this if you have no other device to complete verification with.")}</p>
|
||||
<p>
|
||||
{_t(
|
||||
"If you reset everything, you will restart with no trusted sessions, no trusted users, and " +
|
||||
"might not be able to see past messages.",
|
||||
"If you reset everything, you will restart with no trusted sessions, no trusted users, and might not be able to see past messages.",
|
||||
)}
|
||||
</p>
|
||||
<DialogButtons
|
||||
|
@ -329,8 +328,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
|
|||
<div className="mx_AccessSecretStorageDialog_keyStatus">
|
||||
{"\uD83D\uDC4E "}
|
||||
{_t(
|
||||
"Unable to access secret storage. " +
|
||||
"Please verify that you entered the correct Security Phrase.",
|
||||
"Unable to access secret storage. Please verify that you entered the correct Security Phrase.",
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -44,10 +44,7 @@ export default class ConfirmDestroyCrossSigningDialog extends React.Component<IP
|
|||
<div className="mx_ConfirmDestroyCrossSigningDialog_content">
|
||||
<p>
|
||||
{_t(
|
||||
"Deleting cross-signing keys is permanent. " +
|
||||
"Anyone you have verified with will see security alerts. " +
|
||||
"You almost certainly don't want to do this, unless " +
|
||||
"you've lost every device you can cross-sign from.",
|
||||
"Deleting cross-signing keys is permanent. Anyone you have verified with will see security alerts. You almost certainly don't want to do this, unless you've lost every device you can cross-sign from.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
@ -351,8 +351,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
<div>
|
||||
<p>
|
||||
{_t(
|
||||
"Backup could not be decrypted with this Security Key: " +
|
||||
"please verify that you entered the correct Security Key.",
|
||||
"Backup could not be decrypted with this Security Key: please verify that you entered the correct Security Key.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -363,8 +362,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
<div>
|
||||
<p>
|
||||
{_t(
|
||||
"Backup could not be decrypted with this Security Phrase: " +
|
||||
"please verify that you entered the correct Security Phrase.",
|
||||
"Backup could not be decrypted with this Security Phrase: please verify that you entered the correct Security Phrase.",
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
|
@ -418,8 +416,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
</p>
|
||||
<p>
|
||||
{_t(
|
||||
"Access your secure message history and set up secure " +
|
||||
"messaging by entering your Security Phrase.",
|
||||
"Access your secure message history and set up secure messaging by entering your Security Phrase.",
|
||||
)}
|
||||
</p>
|
||||
|
||||
|
@ -441,9 +438,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
/>
|
||||
</form>
|
||||
{_t(
|
||||
"If you've forgotten your Security Phrase you can " +
|
||||
"<button1>use your Security Key</button1> or " +
|
||||
"<button2>set up new recovery options</button2>",
|
||||
"If you've forgotten your Security Phrase you can <button1>use your Security Key</button1> or <button2>set up new recovery options</button2>",
|
||||
{},
|
||||
{
|
||||
button1: (s) => (
|
||||
|
@ -493,8 +488,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
</p>
|
||||
<p>
|
||||
{_t(
|
||||
"Access your secure message history and set up secure " +
|
||||
"messaging by entering your Security Key.",
|
||||
"Access your secure message history and set up secure messaging by entering your Security Key.",
|
||||
)}
|
||||
</p>
|
||||
|
||||
|
@ -516,8 +510,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
|
|||
/>
|
||||
</div>
|
||||
{_t(
|
||||
"If you've forgotten your Security Key you can " +
|
||||
"<button>set up new recovery options</button>",
|
||||
"If you've forgotten your Security Key you can <button>set up new recovery options</button>",
|
||||
{},
|
||||
{
|
||||
button: (s) => (
|
||||
|
|
|
@ -923,10 +923,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||
<div className="mx_SpotlightDialog_section mx_SpotlightDialog_hiddenResults" role="group">
|
||||
<h4>{_t("Some results may be hidden")}</h4>
|
||||
<div className="mx_SpotlightDialog_otherSearches_messageSearchText">
|
||||
{_t(
|
||||
"If you can't find the room you're looking for, " +
|
||||
"ask for an invite or create a new room.",
|
||||
)}
|
||||
{_t("If you can't find the room you're looking for, ask for an invite or create a new room.")}
|
||||
</div>
|
||||
<Option
|
||||
id="mx_SpotlightDialog_button_createNewRoom"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue