Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Align action_* strings with Element X project in Localazy #11437

Merged
merged 9 commits into from
Aug 22, 2023
2 changes: 1 addition & 1 deletion src/LegacyCallHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ export default class LegacyCallHandler extends EventEmitter {
button: _t("Try using %(server)s", {
server: new URL(FALLBACK_ICE_SERVER).pathname,
}),
cancelButton: _t("OK"),
cancelButton: _t("action|ok"),
onFinished: (allow) => {
SettingsStore.setValue("fallbackICEServerAllowed", null, SettingLevel.DEVICE, allow);
cli.setFallbackICEServerAllowed(!!allow);
Expand Down
2 changes: 1 addition & 1 deletion src/Lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ async function checkServerVersions(): Promise<void> {
brand: SdkConfig.get().brand,
},
),
acceptLabel: _t("OK"),
acceptLabel: _t("action|ok"),
onAccept: () => {
ToastStore.sharedInstance().dismissToast(toastKey);
},
Expand Down
4 changes: 2 additions & 2 deletions src/SlashCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ export const Commands = [
)}
</p>
),
button: _t("Continue"),
button: _t("action|continue"),
});

prom = finished.then(([useDefault]) => {
Expand Down Expand Up @@ -457,7 +457,7 @@ export const Commands = [
new Command({
command: "part",
args: "[<room-address>]",
description: _td("Leave room"),
description: _td("action|leave_room"),
analyticsName: "Part",
isEnabled: (cli) => !isCurrentLocalRoom(cli),
runFn: function (cli, roomId, threadId, args) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class DisableEventIndexDialog extends React.Component<IProps, ISt
{_t("If disabled, messages from encrypted rooms won't appear in search results.")}
{this.state.disabling ? <Spinner /> : <div />}
<DialogButtons
primaryButton={_t("Disable")}
primaryButton={_t("action|disable")}
onPrimaryButtonClick={this.onDisable}
primaryButtonClass="danger"
cancelButtonClass="warning"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ export default class ManageEventIndexDialog extends React.Component<IProps, ISta
>
{eventIndexingSettings}
<DialogButtons
primaryButton={_t("Done")}
primaryButton={_t("action|done")}
onPrimaryButtonClick={this.props.onFinished}
primaryButtonClass="primary"
cancelButton={_t("Disable")}
cancelButton={_t("action|disable")}
onCancel={this.onDisable}
cancelButtonClass="danger"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export default class CreateKeyBackupDialog extends React.PureComponent<IProps, I
return (
<div>
<p>{_t("Your keys are being backed up (the first backup could take a few minutes).")}</p>
<DialogButtons primaryButton={_t("OK")} onPrimaryButtonClick={this.onDone} hasCancel={false} />
<DialogButtons primaryButton={_t("action|ok")} onPrimaryButtonClick={this.onDone} hasCancel={false} />
</div>
);
}
Expand All @@ -154,7 +154,7 @@ export default class CreateKeyBackupDialog extends React.PureComponent<IProps, I
<div>
<p>{_t("Unable to create key backup")}</p>
<DialogButtons
primaryButton={_t("Retry")}
primaryButton={_t("action|retry")}
onPrimaryButtonClick={this.createBackup}
hasCancel={true}
onCancel={this.onCancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
{optionPassphrase}
</div>
<DialogButtons
primaryButton={_t("Continue")}
primaryButton={_t("action|continue")}
onPrimaryButtonClick={this.onChooseKeyPassphraseFormSubmit}
onCancel={this.onCancelClick}
hasCancel={this.state.canSkip}
Expand All @@ -578,7 +578,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp

private renderPhaseMigrate(): JSX.Element {
let authPrompt;
let nextCaption = _t("Next");
let nextCaption = _t("action|next");
if (this.state.canUploadKeysWithPasswordOnly) {
authPrompt = (
<div>
Expand Down Expand Up @@ -654,7 +654,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
</div>

<DialogButtons
primaryButton={_t("Continue")}
primaryButton={_t("action|continue")}
onPrimaryButtonClick={this.onPassPhraseNextClick}
hasCancel={false}
disabled={!this.state.passPhraseValid}
Expand Down Expand Up @@ -712,7 +712,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
<div className="mx_CreateSecretStorageDialog_passPhraseMatch">{passPhraseMatch}</div>
</div>
<DialogButtons
primaryButton={_t("Continue")}
primaryButton={_t("action|continue")}
onPrimaryButtonClick={this.onPassPhraseConfirmNextClick}
hasCancel={false}
disabled={this.state.passPhrase !== this.state.passPhraseConfirm}
Expand All @@ -730,7 +730,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
if (this.state.phase === Phase.ShowKey) {
continueButton = (
<DialogButtons
primaryButton={_t("Continue")}
primaryButton={_t("action|continue")}
disabled={!this.state.downloaded && !this.state.copied && !this.state.setPassphrase}
onPrimaryButtonClick={this.onShowKeyContinueClick}
hasCancel={false}
Expand Down Expand Up @@ -777,7 +777,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
onClick={this.onCopyClick}
disabled={this.state.phase === Phase.Storing}
>
{this.state.copied ? _t("Copied!") : _t("Copy")}
{this.state.copied ? _t("Copied!") : _t("action|copy")}
</AccessibleButton>
</div>
</div>
Expand All @@ -800,7 +800,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
<>
<p className="mx_Dialog_content">{_t("Your keys are now being backed up from this device.")}</p>
<DialogButtons
primaryButton={_t("Done")}
primaryButton={_t("action|done")}
onPrimaryButtonClick={() => this.props.onFinished(true)}
hasCancel={false}
/>
Expand All @@ -814,7 +814,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
<p>{_t("Unable to query secret storage status")}</p>
<div className="mx_Dialog_buttons">
<DialogButtons
primaryButton={_t("Retry")}
primaryButton={_t("action|retry")}
onPrimaryButtonClick={this.onLoadRetryClick}
hasCancel={this.state.canSkip}
onCancel={this.onCancel}
Expand Down Expand Up @@ -889,7 +889,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
<p>{_t("Unable to set up secret storage")}</p>
<div className="mx_Dialog_buttons">
<DialogButtons
primaryButton={_t("Retry")}
primaryButton={_t("action|retry")}
onPrimaryButtonClick={this.bootstrapSecretStorage}
hasCancel={this.state.canSkip}
onCancel={this.onCancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default class NewRecoveryMethodDialog extends React.PureComponent<IProps>
<p>{_t("This session is encrypting history using the new recovery method.")}</p>
{hackWarning}
<DialogButtons
primaryButton={_t("OK")}
primaryButton={_t("action|ok")}
onPrimaryButtonClick={this.onOkClick}
cancelButton={_t("Go to Settings")}
onCancel={this.onGoToSettingsClick}
Expand Down
6 changes: 3 additions & 3 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1196,7 +1196,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {

const isSpace = roomToLeave?.isSpaceRoom();
Modal.createDialog(QuestionDialog, {
title: isSpace ? _t("Leave space") : _t("Leave room"),
title: isSpace ? _t("Leave space") : _t("action|leave_room"),
description: (
<span>
{isSpace
Expand All @@ -1209,7 +1209,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
{warnings}
</span>
),
button: _t("Leave"),
button: _t("action|leave"),
onFinished: async (shouldLeave) => {
if (shouldLeave) {
await leaveRoomBehaviour(cli, roomId);
Expand Down Expand Up @@ -1398,7 +1398,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
title: userNotice.title,
props: {
description: <Linkify>{userNotice.description}</Linkify>,
acceptLabel: _t("OK"),
acceptLabel: _t("action|ok"),
onAccept: () => {
ToastStore.sharedInstance().dismissToast(key);
localStorage.setItem(key, "1");
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function LocalRoomView(props: LocalRoomViewProps): ReactElement {
if (room.isError) {
const buttons = (
<AccessibleButton onClick={onRetryClicked} className="mx_RoomStatusBar_unsentRetry">
{_t("Retry")}
{_t("action|retry")}
</AccessibleButton>
);

Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/SpaceHierarchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ const ManageButtons: React.FC<IManageButtonsProps> = ({ hierarchy, selected, set
kind="danger_outline"
disabled={disabled}
>
{removing ? _t("Removing…") : _t("Remove")}
{removing ? _t("Removing…") : _t("action|remove")}
</Button>
<Button
{...props}
Expand Down
6 changes: 3 additions & 3 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ const SpaceLanding: React.FC<{ space: Room }> = ({ space }) => {
showSpaceInvite(space);
}}
>
{_t("Invite")}
{_t("action|invite")}
</AccessibleButton>
);
}
Expand Down Expand Up @@ -364,7 +364,7 @@ const SpaceSetupFirstRooms: React.FC<{
let buttonLabel = _t("Skip for now");
if (roomNames.some((name) => name.trim())) {
onClick = onNextClick;
buttonLabel = busy ? _t("Creating rooms…") : _t("Continue");
buttonLabel = busy ? _t("Creating rooms…") : _t("action|continue");
}

return (
Expand Down Expand Up @@ -572,7 +572,7 @@ const SpaceSetupPrivateInvite: React.FC<{
let buttonLabel = _t("Skip for now");
if (emailAddresses.some((name) => name.trim())) {
onClick = onNextClick;
buttonLabel = busy ? _t("Inviting…") : _t("Continue");
buttonLabel = busy ? _t("Inviting…") : _t("action|continue");
}

return (
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/ViewSource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export default class ViewSource extends React.Component<IProps, IState> {
? this.canSendStateEvent(mxEvent)
: canEditContent(MatrixClientPeg.safeGet(), this.props.mxEvent);
return (
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("View Source")}>
<BaseDialog className="mx_ViewSource" onFinished={this.props.onFinished} title={_t("action|view_source")}>
<div className="mx_ViewSource_header">
<CopyableText getTextToCopy={() => roomId} border={false}>
{_t("Room ID: %(roomId)s", { roomId })}
Expand All @@ -176,7 +176,7 @@ export default class ViewSource extends React.Component<IProps, IState> {
{isEditing ? this.editSourceContent() : this.viewSourceContent()}
{!isEditing && canEdit && (
<div className="mx_Dialog_buttons">
<button onClick={() => this.onEdit()}>{_t("Edit")}</button>
<button onClick={() => this.onEdit()}>{_t("action|edit")}</button>
</div>
)}
</BaseDialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/auth/ForgotPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ export default class ForgotPassword extends React.Component<Props, State> {
</p>
</div>
),
button: _t("Continue"),
button: _t("action|continue"),
});
const [confirmed] = await finished;
return !!confirmed;
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/auth/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
);
}}
>
{_t("Continue")}
{_t("action|continue")}
</AccessibleButton>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/auth/SetupEncryptionBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
{message}
<div className="mx_CompleteSecurity_actionRow">
<AccessibleButton kind="primary" onClick={this.onDoneClick}>
{_t("Done")}
{_t("action|done")}
</AccessibleButton>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const CheckEmail: React.FC<CheckEmailProps> = ({
</div>
</div>
{errorText && <ErrorMessage message={errorText} />}
<input onClick={onSubmitForm} type="button" className="mx_Login_submit" value={_t("Next")} />
<input onClick={onSubmitForm} type="button" className="mx_Login_submit" value={_t("action|next")} />
<div className="mx_AuthBody_did-not-receive">
<span className="mx_VerifyEMailDialog_text-light">{_t("Did not receive it?")}</span>
<AccessibleButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class PasswordAuthEntry extends React.Component<IAuthEntryProps, IPasswor
type="submit"
className="mx_Dialog_primary"
disabled={!this.state.password}
value={_t("Continue")}
value={_t("action|continue")}
/>
);
}
Expand Down Expand Up @@ -745,7 +745,7 @@ export class RegistrationTokenAuthEntry extends React.Component<IAuthEntryProps,
} else {
submitButtonOrSpinner = (
<AccessibleButton onClick={this.onSubmit} kind="primary" disabled={!this.state.registrationToken}>
{_t("Continue")}
{_t("action|continue")}
</AccessibleButton>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/beacon/OwnBeaconStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const OwnBeaconStatus: React.FC<Props & HTMLProps<HTMLDivElement>> = ({ beacon,
onClick={preventDefaultWrapper(onResetLocationPublishError)}
className="mx_OwnBeaconStatus_button mx_OwnBeaconStatus_destructiveButton"
>
{_t("Retry")}
{_t("action|retry")}
</AccessibleButton>
)}
{hasStopSharingError && (
Expand All @@ -89,7 +89,7 @@ const OwnBeaconStatus: React.FC<Props & HTMLProps<HTMLDivElement>> = ({ beacon,
onClick={preventDefaultWrapper(onStopSharing)}
className="mx_OwnBeaconStatus_button mx_OwnBeaconStatus_destructiveButton"
>
{_t("Retry")}
{_t("action|retry")}
</AccessibleButton>
)}
</BeaconStatus>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/RoomLiveShareWarning.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const RoomLiveShareWarningInner: React.FC<RoomLiveShareWarningInnerProps> = ({ l
element="button"
disabled={stoppingInProgress}
>
{hasError ? _t("Retry") : _t("Stop")}
{hasError ? _t("action|retry") : _t("Stop")}
</AccessibleButton>
{hasLocationPublishError && (
<AccessibleButton
Expand Down
Loading