Locallazy: Convert even more strings (#11679)

Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
R Midhun Suresh 2023-10-02 16:13:00 +05:30 committed by GitHub
parent 8d289544b3
commit 9a76d6b9a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
82 changed files with 6216 additions and 5101 deletions

View file

@ -68,7 +68,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
} catch (err) {
if (this.unmounted) return;
logger.warn(`Error loading page: ${err}`);
this.setState({ page: _t("Couldn't load page") });
this.setState({ page: _t("cant_load_page") });
return;
}
@ -76,7 +76,7 @@ export default class EmbeddedPage extends React.PureComponent<IProps, IState> {
if (!res.ok) {
logger.warn(`Error loading page: ${res.status}`);
this.setState({ page: _t("Couldn't load page") });
this.setState({ page: _t("cant_load_page") });
return;
}

View file

@ -334,7 +334,7 @@ export default class LeftPanel extends React.Component<IProps, IState> {
<AccessibleTooltipButton
className={classNames("mx_LeftPanel_dialPadButton", {})}
onClick={this.onDialPad}
title={_t("Open dial pad")}
title={_t("left_panel|open_dial_pad")}
/>
);
}

View file

@ -512,7 +512,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
const largeFontSize = "50px";
const normalFontSize = "15px";
const waitText = _t("Wait!");
const waitText = _t("console_wait");
const scamText = _t("console_scam_warning");
const devText = _t("console_dev_note");
@ -698,8 +698,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
break;
case "reject_invite":
Modal.createDialog(QuestionDialog, {
title: _t("Reject invitation"),
description: _t("Are you sure you want to reject the invitation?"),
title: _t("reject_invitation_dialog|title"),
description: _t("reject_invitation_dialog|confirmation"),
onFinished: (confirm) => {
if (confirm) {
// FIXME: controller shouldn't be loading a view :(
@ -717,7 +717,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
(err) => {
modal.close();
Modal.createDialog(ErrorDialog, {
title: _t("Failed to reject invitation"),
title: _t("reject_invitation_dialog|failed"),
description: err.toString(),
});
},
@ -1196,9 +1196,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
warnings.push(
<span className="warning" key="only_member_warning">
{" " /* Whitespace, otherwise the sentences get smashed together */}
{_t(
"You are the only person here. If you leave, no one will be able to join in the future, including you.",
)}
{_t("leave_room_dialog|last_person_warning")}
</span>,
);
@ -1213,8 +1211,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
<span className="warning" key="non_public_warning">
{" " /* Whitespace, otherwise the sentences get smashed together */}
{isSpace
? _t("This space is not public. You will not be able to rejoin without an invite.")
: _t("This room is not public. You will not be able to rejoin without an invite.")}
? _t("leave_room_dialog|space_rejoin_warning")
: _t("leave_room_dialog|room_rejoin_warning")}
</span>,
);
}
@ -1233,10 +1231,10 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
description: (
<span>
{isSpace
? _t("Are you sure you want to leave the space '%(spaceName)s'?", {
? _t("leave_room_dialog|leave_space_question", {
spaceName: roomToLeave?.name ?? _t("common|unnamed_space"),
})
: _t("Are you sure you want to leave the room '%(roomName)s'?", {
: _t("leave_room_dialog|leave_room_question", {
roomName: roomToLeave?.name ?? _t("common|unnamed_room"),
})}
{warnings}
@ -1274,7 +1272,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
.catch((err) => {
const errCode = err.errcode || _td("unknown error code");
Modal.createDialog(ErrorDialog, {
title: _t("Failed to forget room %(errCode)s", { errCode }),
title: _t("error_dialog|forget_room_failed", { errCode }),
description: err && err.message ? err.message : _t("invite|failed_generic"),
});
});
@ -1285,8 +1283,8 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
const success = await copyPlaintext(roomLink);
if (!success) {
Modal.createDialog(ErrorDialog, {
title: _t("Unable to copy room link"),
description: _t("Unable to copy a link to the room to the clipboard."),
title: _t("error_dialog|copy_room_link_failed|title"),
description: _t("error_dialog|copy_room_link_failed|description"),
});
}
}

View file

@ -135,10 +135,8 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
}
logger.error("Search failed", error);
Modal.createDialog(ErrorDialog, {
title: _t("Search failed"),
description:
error?.message ??
_t("Server may be unavailable, overloaded, or search timed out :("),
title: _t("error_dialog|search_failed|title"),
description: error?.message ?? _t("error_dialog|search_failed|server_unavailable"),
});
return false;
},
@ -205,7 +203,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
} else {
ret.push(
<li key="search-top-marker">
<h2 className="mx_RoomView_topMarker">{_t("No more results")}</h2>
<h2 className="mx_RoomView_topMarker">{_t("no_more_results")}</h2>
</li>,
);
}

View file

@ -207,7 +207,7 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
}
if (consentError) {
title = _t(
"You can't send any messages until you review and agree to <consentLink>our terms and conditions</consentLink>.",
"room|status_bar|requires_consent_agreement",
{},
{
consentLink: (sub) => (
@ -222,28 +222,22 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
resourceLimitError.data.limit_type,
resourceLimitError.data.admin_contact,
{
"monthly_active_user": _td(
"Your message wasn't sent because this homeserver has hit its Monthly Active User Limit. Please <a>contact your service administrator</a> to continue using the service.",
),
"hs_disabled": _td(
"Your message wasn't sent because this homeserver has been blocked by its administrator. Please <a>contact your service administrator</a> to continue using the service.",
),
"": _td(
"Your message wasn't sent because this homeserver has exceeded a resource limit. Please <a>contact your service administrator</a> to continue using the service.",
),
"monthly_active_user": _td("room|status_bar|monthly_user_limit_reached"),
"hs_disabled": _td("room|status_bar|homeserver_blocked"),
"": _td("room|status_bar|exceeded_resource_limit"),
},
);
} else {
title = _t("Some of your messages have not been sent");
title = _t("room|status_bar|some_messages_not_sent");
}
let buttonRow = (
<>
<AccessibleButton onClick={this.onCancelAllClick} className="mx_RoomStatusBar_unsentCancelAllBtn">
{_t("Delete all")}
{_t("room|status_bar|delete_all")}
</AccessibleButton>
<AccessibleButton onClick={this.onResendAllClick} className="mx_RoomStatusBar_unsentRetry">
{_t("Retry all")}
{_t("room|status_bar|retry_all")}
</AccessibleButton>
</>
);
@ -260,7 +254,7 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
return (
<RoomStatusBarUnsentMessages
title={title}
description={_t("You can select all or individual messages to retry or delete")}
description={_t("room|status_bar|select_messages_to_retry")}
notificationState={StaticNotificationState.RED_EXCLAMATION}
buttons={buttonRow}
/>
@ -276,10 +270,10 @@ export default class RoomStatusBar extends React.PureComponent<IProps, IState> {
<WarningIcon width="24" height="24" />
<div>
<div className="mx_RoomStatusBar_connectionLostBar_title">
{_t("Connectivity to the server has been lost.")}
{_t("room|status_bar|server_connectivity_lost_title")}
</div>
<div className="mx_RoomStatusBar_connectionLostBar_desc">
{_t("Sent messages will be stored until your connection has returned.")}
{_t("room|status_bar|server_connectivity_lost_description")}
</div>
</div>
</div>

View file

@ -292,7 +292,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
statusBar = (
<RoomStatusBarUnsentMessages
title={_t("Some of your messages have not been sent")}
title={_t("room|status_bar|some_messages_not_sent")}
notificationState={StaticNotificationState.RED_EXCLAMATION}
buttons={buttons}
/>
@ -359,7 +359,7 @@ interface ILocalRoomCreateLoaderProps {
* @return {ReactElement}
*/
function LocalRoomCreateLoader(props: ILocalRoomCreateLoaderProps): ReactElement {
const text = _t("We're creating a room with %(names)s", { names: props.names });
const text = _t("room|creating_room_text", { names: props.names });
return (
<div className="mx_RoomView mx_RoomView--local">
<ErrorBoundary>
@ -1081,9 +1081,9 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
private onPageUnload = (event: BeforeUnloadEvent): string | undefined => {
if (ContentMessages.sharedInstance().getCurrentUploads().length > 0) {
return (event.returnValue = _t("You seem to be uploading files, are you sure you want to quit?"));
return (event.returnValue = _t("quit_warning|file_upload_in_progress"));
} else if (this.getCallForRoom() && this.state.callState !== "ended") {
return (event.returnValue = _t("You seem to be in a call, are you sure you want to quit?"));
return (event.returnValue = _t("quit_warning|call_in_progress"));
}
};
@ -1760,7 +1760,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
const msg = error.message ? error.message : JSON.stringify(error);
Modal.createDialog(ErrorDialog, {
title: _t("Failed to reject invite"),
title: _t("room|failed_reject_invite"),
description: msg,
});
@ -1793,7 +1793,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
const msg = error instanceof Error ? error.message : JSON.stringify(error);
Modal.createDialog(ErrorDialog, {
title: _t("Failed to reject invite"),
title: _t("room|failed_reject_invite"),
description: msg,
});
@ -2190,7 +2190,7 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
const myUserId = this.context.client.getSafeUserId();
const myMember = this.state.room.getMember(myUserId);
const inviteEvent = myMember ? myMember.events.member : null;
let inviterName = _t("Unknown");
let inviterName = _t("room|inviter_unknown");
if (inviteEvent) {
inviterName = inviteEvent.sender?.name ?? inviteEvent.getSender()!;
}

View file

@ -150,7 +150,7 @@ const Tile: React.FC<ITileProps> = ({
kind="primary_outline"
onFocus={onFocus}
tabIndex={isActive ? 0 : -1}
title={_t("Joining")}
title={_t("space|joining_space")}
>
<Spinner w={24} h={24} />
</AccessibleTooltipButton>
@ -181,7 +181,7 @@ const Tile: React.FC<ITileProps> = ({
} else {
checkbox = (
<TextWithTooltip
tooltip={_t("You don't have permission")}
tooltip={_t("space|user_lacks_permission")}
onClick={(ev) => {
ev.stopPropagation();
}}
@ -858,7 +858,7 @@ const SpaceHierarchy: React.FC<IProps> = ({ space, initialText = "", showRoom, a
results = (
<div className="mx_SpaceHierarchy_noResults">
<h3>{_t("No results found")}</h3>
<div>{_t("You may want to try a different search or check for typos.")}</div>
<div>{_t("space|no_search_result_hint")}</div>
</div>
);
}
@ -876,7 +876,9 @@ const SpaceHierarchy: React.FC<IProps> = ({ space, initialText = "", showRoom, a
<>
<div className="mx_SpaceHierarchy_listHeader">
<h4 className="mx_SpaceHierarchy_listHeader_header">
{query.trim() ? _t("Results") : _t("Rooms and spaces")}
{query.trim()
? _t("space|title_when_query_available")
: _t("space|title_when_query_unavailable")}
</h4>
<div className="mx_SpaceHierarchy_listHeader_buttons">
{additionalButtons}
@ -908,7 +910,7 @@ const SpaceHierarchy: React.FC<IProps> = ({ space, initialText = "", showRoom, a
<>
<SearchBox
className="mx_SpaceHierarchy_search mx_textinput_icon mx_textinput_search"
placeholder={_t("Search names and descriptions")}
placeholder={_t("space|search_placeholder")}
onSearch={setQuery}
autoFocus={true}
initialValue={initialText}

View file

@ -1650,15 +1650,13 @@ class TimelinePanel extends React.Component<IProps, IState> {
let description: string;
if (error.errcode == "M_FORBIDDEN") {
description = _t(
"Tried to load a specific point in this room's timeline, but you do not have permission to view the message in question.",
);
description = _t("timeline|load_error|no_permission");
} else {
description = _t("Tried to load a specific point in this room's timeline, but was unable to find it.");
description = _t("timeline|load_error|unable_to_find");
}
Modal.createDialog(ErrorDialog, {
title: _t("Failed to load timeline position"),
title: _t("timeline|load_error|title"),
description,
onFinished,
});

View file

@ -110,12 +110,12 @@ export default class UploadBar extends React.PureComponent<IProps, IState> {
let uploadText: string;
if (this.state.countFiles > 1) {
// MUST use var name 'count' for pluralization to kick in
uploadText = _t("Uploading %(filename)s and %(count)s others", {
uploadText = _t("room|upload|uploading_multiple_file", {
filename: this.state.currentFile,
count: this.state.countFiles - 1,
});
} else {
uploadText = _t("Uploading %(filename)s", {
uploadText = _t("room|upload|uploading_single_file", {
filename: this.state.currentFile,
});
}

View file

@ -72,7 +72,7 @@ export default class UserView extends React.Component<IProps, IState> {
profileInfo = await this.context.getProfileInfo(this.props.userId);
} catch (err) {
Modal.createDialog(ErrorDialog, {
title: _t("Could not load user profile"),
title: _t("error_dialog|error_loading_user_profile"),
description: err instanceof Error ? err.message : _t("invite|failed_generic"),
});
this.setState({ loading: false });

View file

@ -73,11 +73,8 @@ export const WaitingForThirdPartyRoomView: React.FC<Props> = ({ roomView, resize
<ScrollPanel className="mx_RoomView_messagePanel" resizeNotifier={resizeNotifier}>
<EventTileBubble
className="mx_cryptoEvent mx_cryptoEvent_icon"
title={_t("Waiting for users to join %(brand)s", { brand })}
subtitle={_t(
"Once invited users have joined %(brand)s, you will be able to chat and the room will be end-to-end encrypted",
{ brand },
)}
title={_t("room|waiting_for_join_title", { brand })}
subtitle={_t("room|waiting_for_join_subtitle", { brand })}
/>
<NewRoomIntro />
<UnwrappedEventTile mxEvent={inviteEvent} />

View file

@ -67,23 +67,23 @@ export default class CompleteSecurity extends React.Component<IProps, IState> {
} else if (phase === Phase.Intro) {
if (lostKeys) {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
title = _t("Unable to verify this device");
title = _t("encryption|verification|after_new_login|unable_to_verify");
} else {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
title = _t("Verify this device");
title = _t("encryption|verification|after_new_login|verify_this_device");
}
} else if (phase === Phase.Done) {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_verified" />;
title = _t("Device verified");
title = _t("encryption|verification|after_new_login|device_verified");
} else if (phase === Phase.ConfirmSkip) {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
title = _t("common|are_you_sure");
} else if (phase === Phase.Busy) {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
title = _t("Verify this device");
title = _t("encryption|verification|after_new_login|verify_this_device");
} else if (phase === Phase.ConfirmReset) {
icon = <span className="mx_CompleteSecurity_headerIcon mx_E2EIcon_warning" />;
title = _t("Really reset verification keys?");
title = _t("encryption|verification|after_new_login|reset_confirmation");
} else if (phase === Phase.Finished) {
// SetupEncryptionBody will take care of calling onFinished, we don't need to do anything
} else {
@ -96,7 +96,7 @@ export default class CompleteSecurity extends React.Component<IProps, IState> {
<AccessibleButton
onClick={this.onSkipClick}
className="mx_CompleteSecurity_skip"
aria-label={_t("Skip verification for now")}
aria-label={_t("encryption|verification|after_new_login|skip_verification")}
/>
);
}

View file

@ -35,12 +35,7 @@ export function ConfirmSessionLockTheftView(props: Props): JSX.Element {
return (
<div className="mx_ConfirmSessionLockTheftView">
<div className="mx_ConfirmSessionLockTheftView_body">
<p>
{_t(
'%(brand)s is open in another window. Click "%(label)s" to use %(brand)s here and disconnect the other window.',
{ brand, label: _t("action|continue") },
)}
</p>
<p>{_t("error_app_opened_in_another_window", { brand, label: _t("action|continue") })}</p>
<AccessibleButton kind="primary" onClick={props.onConfirm}>
{_t("action|continue")}

View file

@ -164,8 +164,8 @@ export default class ForgotPassword extends React.Component<Props, State> {
const retryAfterMs = parseInt(err?.data?.retry_after_ms, 10);
const errorText = isNaN(retryAfterMs)
? _t("Too many attempts in a short time. Wait some time before trying again.")
: _t("Too many attempts in a short time. Retry after %(timeout)s.", {
? _t("auth|reset_password|rate_limit_error")
: _t("auth|reset_password|rate_limit_error_with_time", {
timeout: formatSeconds(retryAfterMs / 1000),
});
@ -349,16 +349,8 @@ export default class ForgotPassword extends React.Component<Props, State> {
title: _t("common|warning"),
description: (
<div>
<p>
{_t(
"Signing out your devices will delete the message encryption keys stored on them, making encrypted chat history unreadable.",
)}
</p>
<p>
{_t(
"If you want to retain access to your chat history in encrypted rooms, set up Key Backup or export your message keys from one of your other devices before proceeding.",
)}
</p>
<p>{_t("auth|reset_password|other_devices_logout_warning_1")}</p>
<p>{_t("auth|reset_password|other_devices_logout_warning_2")}</p>
</div>
),
button: _t("action|continue"),
@ -402,9 +394,9 @@ export default class ForgotPassword extends React.Component<Props, State> {
/>
<PassphraseConfirmField
name="reset_password_confirm"
label={_td("Confirm new password")}
labelRequired={_td("A new password must be entered.")}
labelInvalid={_td("New passwords must match each other.")}
label={_td("auth|reset_password|confirm_new_password")}
labelRequired={_td("auth|reset_password|password_not_entered")}
labelInvalid={_td("auth|reset_password|passwords_mismatch")}
value={this.state.password2}
password={this.state.password}
fieldRef={(field) => (this.fieldPasswordConfirm = field)}
@ -417,7 +409,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
onChange={() => this.setState({ logoutDevices: !this.state.logoutDevices })}
checked={this.state.logoutDevices}
>
{_t("Sign out of all devices")}
{_t("auth|reset_password|sign_out_other_devices")}
</StyledCheckbox>
</div>
{this.state.errorText && <ErrorMessage message={this.state.errorText} />}
@ -434,19 +426,13 @@ export default class ForgotPassword extends React.Component<Props, State> {
return (
<>
<CheckboxIcon className="mx_Icon mx_Icon_32 mx_Icon_accent" />
<h1>{_t("Your password has been reset.")}</h1>
{this.state.logoutDevices ? (
<p>
{_t(
"You have been logged out of all devices and will no longer receive push notifications. To re-enable notifications, sign in again on each device.",
)}
</p>
) : null}
<h1>{_t("auth|reset_password|reset_successful")}</h1>
{this.state.logoutDevices ? <p>{_t("auth|reset_password|devices_logout_success")}</p> : null}
<input
className="mx_Login_submit"
type="button"
onClick={this.props.onComplete}
value={_t("Return to login screen")}
value={_t("auth|reset_password|return_to_login")}
/>
</>
);