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 23, 2023
1 parent df4a221 commit 1c2a115
Show file tree
Hide file tree
Showing 160 changed files with 1,306 additions and 1,325 deletions.
20 changes: 10 additions & 10 deletions cypress/e2e/timeline/timeline.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ describe("Timeline", () => {

cy.get(".mx_GenericEventListSummary").within(() => {
// Click "expand" link button
cy.findByRole("button", { name: "expand" }).click();
cy.findByRole("button", { name: "Expand" }).click();

// Assert that the "expand" link button worked
cy.findByRole("button", { name: "collapse" }).should("exist");
cy.findByRole("button", { name: "Collapse" }).should("exist");
});

cy.get(".mx_MainSplit").percySnapshotElement("Expanded GELS on IRC layout", { percyCSS });
Expand All @@ -224,10 +224,10 @@ describe("Timeline", () => {

cy.get(".mx_GenericEventListSummary").within(() => {
// Click "expand" link button
cy.findByRole("button", { name: "expand" }).click();
cy.findByRole("button", { name: "Expand" }).click();

// Assert that the "expand" link button worked
cy.findByRole("button", { name: "collapse" }).should("exist");
cy.findByRole("button", { name: "Collapse" }).should("exist");
});

cy.get(".mx_MainSplit").percySnapshotElement("Expanded GELS on modern layout", { percyCSS });
Expand All @@ -247,10 +247,10 @@ describe("Timeline", () => {

cy.get(".mx_GenericEventListSummary").within(() => {
// Click "expand" link button
cy.findByRole("button", { name: "expand" }).click();
cy.findByRole("button", { name: "Expand" }).click();

// Assert that the "expand" link button worked
cy.findByRole("button", { name: "collapse" }).should("exist");
cy.findByRole("button", { name: "Collapse" }).should("exist");
});

// Make sure spacer is not visible on bubble layout
Expand All @@ -270,10 +270,10 @@ describe("Timeline", () => {
.realHover()
.findByRole("toolbar", { name: "Message Actions" })
.should("be.visible");
cy.findByRole("button", { name: "collapse" }).click();
cy.findByRole("button", { name: "Collapse" }).click();

// Assert that "collapse" link button worked
cy.findByRole("button", { name: "expand" }).should("exist");
cy.findByRole("button", { name: "Expand" }).should("exist");
});

// Save snapshot of collapsed generic event list summary on bubble layout
Expand All @@ -292,7 +292,7 @@ describe("Timeline", () => {
});

// Click "expand" link button
cy.get(".mx_GenericEventListSummary").findByRole("button", { name: "expand" }).click();
cy.get(".mx_GenericEventListSummary").findByRole("button", { name: "Expand" }).click();

// Check the event line has margin instead of inset property
// cf. _EventTile.pcss
Expand Down Expand Up @@ -388,7 +388,7 @@ describe("Timeline", () => {

// 2. Alignment of expanded GELS and messages
// Click "expand" link button
cy.get(".mx_GenericEventListSummary").findByRole("button", { name: "expand" }).click();
cy.get(".mx_GenericEventListSummary").findByRole("button", { name: "Expand" }).click();
// Check inline start spacing of info line on expanded GELS
cy.get(".mx_EventTile[data-layout=irc].mx_EventTile_info:first-of-type .mx_EventTile_line")
// See: _EventTile.pcss
Expand Down
5 changes: 5 additions & 0 deletions res/css/views/elements/_GenericEventListSummary.pcss
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ limitations under the License.
}
}

.mx_GenericEventListSummary_toggle {
// We reuse a title cased translation
text-transform: lowercase;
}

&[data-layout="irc"],
&[data-layout="group"] {
.mx_GenericEventListSummary_toggle {
Expand Down
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
Loading

0 comments on commit 1c2a115

Please sign in to comment.