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

Commit

Permalink
Create more action_* common strings
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed Aug 22, 2023
1 parent df4a221 commit e79bd0c
Show file tree
Hide file tree
Showing 158 changed files with 1,319 additions and 1,440 deletions.
4 changes: 2 additions & 2 deletions src/AddThreepid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ export default class AddThreepid {
[SSOAuthEntry.PHASE_POSTAUTH]: {
title: _t("Confirm adding email"),
body: _t("Click the button below to confirm adding this email address."),
continueText: _t("Confirm"),
continueText: _t("action|confirm"),
continueKind: "primary",
},
};
Expand Down Expand Up @@ -329,7 +329,7 @@ export default class AddThreepid {
[SSOAuthEntry.PHASE_POSTAUTH]: {
title: _t("Confirm adding phone number"),
body: _t("Click the button below to confirm adding this phone number."),
continueText: _t("Confirm"),
continueText: _t("action|confirm"),
continueKind: "primary",
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/AsyncWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class AsyncWrapper extends React.Component<IProps, IState> {
<BaseDialog onFinished={this.props.onFinished} title={_t("common|error")}>
{_t("Unable to load! Check your network connectivity and try again.")}
<DialogButtons
primaryButton={_t("Dismiss")}
primaryButton={_t("action|dismiss")}
onPrimaryButtonClick={this.onWrapperCancelClick}
hasCancel={false}
/>
Expand Down
2 changes: 1 addition & 1 deletion src/IdentityAuthClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ export default class IdentityAuthClient {
<p>{_t("Only continue if you trust the owner of the server.")}</p>
</div>
),
button: _t("Trust"),
button: _t("action|trust"),
});
const [confirmed] = await finished;
if (confirmed) {
Expand Down
2 changes: 1 addition & 1 deletion src/MatrixClientPeg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ class MatrixClientPegClass implements IMatrixClientPeg {
description: _t(
"This may be caused by having the app open in multiple tabs or due to clearing browser data.",
),
button: _t("Reload"),
button: _t("action|reload"),
});
const [reload] = await finished;
if (!reload) return;
Expand Down
2 changes: 1 addition & 1 deletion src/SecurityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ async function confirmToDismiss(): Promise<boolean> {
description: _t("Are you sure you want to cancel entering passphrase?"),
danger: false,
button: _t("Go Back"),
cancelButton: _t("Cancel"),
cancelButton: _t("action|cancel"),
}).finished;
return !sure;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
[SSOAuthEntry.PHASE_POSTAUTH]: {
title: _t("Confirm encryption setup"),
body: _t("Click the button below to confirm setting up encryption."),
continueText: _t("Confirm"),
continueText: _t("action|confirm"),
continueKind: "primary",
},
};
Expand Down Expand Up @@ -621,7 +621,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
primaryDisabled={!!this.state.canUploadKeysWithPasswordOnly && !this.state.accountPassword}
>
<button type="button" className="danger" onClick={this.onCancelClick}>
{_t("Skip")}
{_t("action|skip")}
</button>
</DialogButtons>
</form>
Expand Down Expand Up @@ -660,7 +660,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
disabled={!this.state.passPhraseValid}
>
<button type="button" onClick={this.onCancelClick} className="danger">
{_t("Cancel")}
{_t("action|cancel")}
</button>
</DialogButtons>
</form>
Expand Down Expand Up @@ -718,7 +718,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
disabled={this.state.passPhrase !== this.state.passPhraseConfirm}
>
<button type="button" onClick={this.onCancelClick} className="danger">
{_t("Skip")}
{_t("action|skip")}
</button>
</DialogButtons>
</form>
Expand Down Expand Up @@ -837,7 +837,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
hasCancel={false}
>
<button type="button" className="danger" onClick={this.onCancel}>
{_t("Cancel")}
{_t("action|cancel")}
</button>
</DialogButtons>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ export default class ExportE2eKeysDialog extends React.Component<IProps, IState>
disabled={disableForm}
/>
<button onClick={this.onCancelClick} disabled={disableForm}>
{_t("Cancel")}
{_t("action|cancel")}
</button>
</div>
</form>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export default class ImportE2eKeysDialog extends React.Component<IProps, IState>
disabled={!this.state.enableSubmit || disableForm}
/>
<button onClick={this.onCancelClick} disabled={disableForm}>
{_t("Cancel")}
{_t("action|cancel")}
</button>
</div>
</form>
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1597,7 +1597,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
</div>
),
button: _t("Review terms and conditions"),
cancelButton: _t("Dismiss"),
cancelButton: _t("action|dismiss"),
onFinished: (confirmed) => {
if (confirmed) {
const wnd = window.open(consentUri, "_blank")!;
Expand Down Expand Up @@ -2098,7 +2098,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {
<Spinner />
<div className="mx_MatrixChat_splashButtons">
<AccessibleButton kind="link_inline" onClick={this.onLogoutClick}>
{_t("Logout")}
{_t("action|logout")}
</AccessibleButton>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/SpaceHierarchy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ const Tile: React.FC<ITileProps> = ({
onFocus={onFocus}
tabIndex={isActive ? 0 : -1}
>
{_t("View")}
{_t("action|view")}
</AccessibleButton>
);
} else {
button = (
<AccessibleButton onClick={onJoinClick} kind="primary" onFocus={onFocus} tabIndex={isActive ? 0 : -1}>
{_t("Join")}
{_t("action|join")}
</AccessibleButton>
);
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/auth/InteractiveAuthEntryComponents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ export class TermsAuthEntry extends React.Component<ITermsAuthEntryProps, ITerms
onClick={this.trySubmit}
disabled={!allChecked}
>
{_t("Accept")}
{_t("action|accept")}
</AccessibleButton>
);
}
Expand Down Expand Up @@ -868,7 +868,7 @@ export class SSOAuthEntry extends React.Component<ISSOAuthEntryProps, ISSOAuthEn
onClick={this.props.onCancel ?? null}
kind={this.props.continueKind ? this.props.continueKind + "_outline" : "primary_outline"}
>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
);
if (this.state.phase === SSOAuthEntry.PHASE_PREAUTH) {
Expand All @@ -880,7 +880,7 @@ export class SSOAuthEntry extends React.Component<ISSOAuthEntryProps, ISSOAuthEn
} else {
continueButton = (
<AccessibleButton onClick={this.onConfirmClick} kind={this.props.continueKind || "primary"}>
{this.props.continueText || _t("Confirm")}
{this.props.continueText || _t("action|confirm")}
</AccessibleButton>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/auth/LoginWithQRFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export default class LoginWithQRFlow extends React.Component<IProps> {

private cancelButton = (): JSX.Element => (
<AccessibleButton data-testid="cancel-button" kind="primary_outline" onClick={this.handleClick(Click.Cancel)}>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
);

Expand Down Expand Up @@ -156,7 +156,7 @@ export default class LoginWithQRFlow extends React.Component<IProps> {
kind="primary_outline"
onClick={this.handleClick(Click.Decline)}
>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
<AccessibleButton
data-testid="approve-login-button"
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/BeaconViewDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ const BeaconViewDialog: React.FC<IProps> = ({ initialFocusedBeacon, roomId, matr
onClick={onFinished}
data-testid="beacon-view-dialog-fallback-close"
>
{_t("Close")}
{_t("action|close")}
</AccessibleButton>
</MapFallback>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/OwnBeaconStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const OwnBeaconStatus: React.FC<Props & HTMLProps<HTMLDivElement>> = ({ beacon,
className="mx_OwnBeaconStatus_button mx_OwnBeaconStatus_destructiveButton"
disabled={stoppingInProgress}
>
{_t("Stop")}
{_t("action|stop")}
</AccessibleButton>
)}
{hasLocationPublishError && (
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/beacon/RoomCallBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const RoomCallBannerInner: React.FC<RoomCallBannerProps> = ({ roomId, call }) =>
</div>

<AccessibleButton onClick={connect} kind="primary" element="button" disabled={false}>
{_t("Join")}
{_t("action|join")}
</AccessibleButton>
</div>
);
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("action|retry") : _t("Stop")}
{hasError ? _t("action|retry") : _t("action|stop")}
</AccessibleButton>
{hasLocationPublishError && (
<AccessibleButton
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/context_menus/MessageContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
<IconizedContextMenuOption
iconClassName="mx_MessageContextMenu_iconPermalink"
onClick={this.onShareClick}
label={_t("Share")}
label={_t("action|share")}
element="a"
{
// XXX: Typescript signature for AccessibleButton doesn't work properly for non-inputs like `a`
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/AskInviteAnywayDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default function AskInviteAnywayDialog({
</div>

<div className="mx_Dialog_buttons">
<button onClick={onGiveUpClicked}>{_t("Close")}</button>
<button onClick={onGiveUpClicked}>{_t("action|close")}</button>
<button onClick={onInviteNeverWarnClicked}>
{inviteNeverWarnLabel ?? _t("Invite anyway and never warn me again")}
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ChangelogDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default class ChangelogDialog extends React.Component<IProps, State> {
<QuestionDialog
title={_t("Changelog")}
description={content}
button={_t("Update")}
button={_t("action|update")}
onFinished={this.props.onFinished}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ConfirmWipeDeviceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class ConfirmWipeDeviceDialog extends React.Component<IProps> {
primaryButton={_t("Clear all data")}
onPrimaryButtonClick={this.onConfirm}
primaryButtonClass="danger"
cancelButton={_t("Cancel")}
cancelButton={_t("action|cancel")}
onCancel={this.onDecline}
/>
</BaseDialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/CreateSubspaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
</div>

<AccessibleButton kind="primary_outline" disabled={busy} onClick={() => onFinished(false)}>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
<AccessibleButton kind="primary" disabled={busy} onClick={onCreateSubspaceClick}>
{busy ? _t("Adding…") : _t("Add")}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/ExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
>
<p>{_t("Are you sure you want to stop exporting your data? If you do, you'll need to start over.")}</p>
<DialogButtons
primaryButton={_t("Stop")}
primaryButton={_t("action|stop")}
primaryButtonClass="danger"
hasCancel={true}
cancelButton={_t("action|continue")}
Expand Down Expand Up @@ -402,7 +402,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
<Spinner w={24} h={24} />
<p>{exportProgressText}</p>
<DialogButtons
primaryButton={_t("Cancel")}
primaryButton={_t("action|cancel")}
primaryButtonClass="danger"
hasCancel={false}
onPrimaryButtonClick={onCancel}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const GenericFeatureFeedbackDialog: React.FC<IProps> = ({
Modal.createDialog(InfoDialog, {
title,
description: _t("Feedback sent! Thanks, we appreciate it!"),
button: _t("Close"),
button: _t("action|close"),
hasCloseButton: false,
fixedWidth: false,
});
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/InteractiveAuthDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default class InteractiveAuthDialog<T> extends React.Component<Interactiv
[SSOAuthEntry.PHASE_POSTAUTH]: {
title: _t("Confirm to continue"),
body: _t("Click the button below to confirm your identity."),
continueText: _t("Confirm"),
continueText: _t("action|confirm"),
continueKind: "primary",
},
};
Expand Down Expand Up @@ -171,7 +171,7 @@ export default class InteractiveAuthDialog<T> extends React.Component<Interactiv
<div role="alert">{this.state.authError.message || this.state.authError.toString()}</div>
<br />
<AccessibleButton onClick={this.onDismissClick} className="mx_GeneralButton" autoFocus={true}>
{_t("Dismiss")}
{_t("action|dismiss")}
</AccessibleButton>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/InviteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1419,7 +1419,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
onClick={this.onCancel}
className="mx_InviteDialog_transferConsultConnect_pushRight"
>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
<AccessibleButton
kind="primary"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ const ManageRestrictedJoinRuleDialog: React.FC<IProps> = ({ room, selected = [],
{inviteOnlyWarning}
<div className="mx_ManageRestrictedJoinRuleDialog_footer_buttons">
<AccessibleButton kind="primary_outline" onClick={() => onFinished()}>
{_t("Cancel")}
{_t("action|cancel")}
</AccessibleButton>
<AccessibleButton kind="primary" onClick={() => onFinished(Array.from(newSelected))}>
{_t("Confirm")}
{_t("action|confirm")}
</AccessibleButton>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/RoomUpgradeWarningDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ export default class RoomUpgradeWarningDialog extends React.Component<IProps, IS
} else {
footer = (
<DialogButtons
primaryButton={_t("Upgrade")}
primaryButton={_t("action|upgrade")}
onPrimaryButtonClick={this.onContinue}
cancelButton={_t("Cancel")}
cancelButton={_t("action|cancel")}
onCancel={this.onCancel}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ScrollableBaseModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export default abstract class ScrollableBaseModal<
<div className="mx_CompoundDialog_content">{this.renderContent()}</div>
<div className="mx_CompoundDialog_footer">
<AccessibleButton onClick={this.onCancel} kind="primary_outline">
{this.state.cancelLabel ?? _t("Cancel")}
{this.state.cancelLabel ?? _t("action|cancel")}
</AccessibleButton>
<AccessibleButton
onClick={this.onSubmit}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/SeshatResetDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export default class SeshatResetDialog extends React.PureComponent<Props> {
primaryButton={_t("Reset event store")}
onPrimaryButtonClick={this.props.onFinished.bind(null, true)}
primaryButtonClass="danger"
cancelButton={_t("Cancel")}
cancelButton={_t("action|cancel")}
onCancel={this.props.onFinished.bind(null, false)}
/>
</BaseDialog>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/SetEmailDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ export default class SetEmailDialog extends React.Component<IProps, IState> {
value={_t("action|continue")}
onClick={this.onSubmit}
/>
<input type="submit" value={_t("Skip")} onClick={this.onCancelled} />
<input type="submit" value={_t("action|skip")} onClick={this.onCancelled} />
</div>
</BaseDialog>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/TermsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class TermsDialog extends React.PureComponent<ITermsDialogProps,
<th>{_t("Service")}</th>
<th>{_t("Summary")}</th>
<th>{_t("Document")}</th>
<th>{_t("Accept")}</th>
<th>{_t("action|accept")}</th>
</tr>
{rows}
</tbody>
Expand Down
Loading

0 comments on commit e79bd0c

Please sign in to comment.