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

Create more action_* common strings #11438

Merged
merged 12 commits into from
Aug 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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/Lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ async function onFailedDelegatedAuthLogin(description: string | ReactNode, tryAg
Modal.createDialog(ErrorDialog, {
title: _t("We couldn't log you in"),
description,
button: _t("Try again"),
button: _t("action|try_again"),
// if we have a tryAgain callback, call it the primary 'try again' button was clicked in the dialog
onFinished: tryAgain ? (shouldTryAgain?: boolean) => shouldTryAgain && tryAgain() : undefined,
});
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
4 changes: 2 additions & 2 deletions src/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ export async function startAnyRegistrationFlow(
const modal = Modal.createDialog(QuestionDialog, {
hasCancelButton: true,
quitOnly: true,
title: SettingsStore.getValue(UIFeature.Registration) ? _t("Sign In or Create Account") : _t("Sign In"),
title: SettingsStore.getValue(UIFeature.Registration) ? _t("Sign In or Create Account") : _t("action|sign_in"),
description: SettingsStore.getValue(UIFeature.Registration)
? _t("Use your account or create a new one to continue.")
: _t("Use your account to continue."),
button: _t("Sign In"),
button: _t("action|sign_in"),
extraButtons: SettingsStore.getValue(UIFeature.Registration)
? [
<button
Expand Down
4 changes: 2 additions & 2 deletions src/SecurityManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ async function confirmToDismiss(): Promise<boolean> {
title: _t("Cancel entering passphrase?"),
description: _t("Are you sure you want to cancel entering passphrase?"),
danger: false,
button: _t("Go Back"),
cancelButton: _t("Cancel"),
button: _t("action|go_back"),
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 @@ -763,7 +763,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
onClick={this.onDownloadClick}
disabled={this.state.phase === Phase.Storing}
>
{_t("Download")}
{_t("action|download")}
</AccessibleButton>
<span>
{_t("%(downloadButton)s or %(copyButton)s", {
Expand Down Expand Up @@ -832,12 +832,12 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
</p>
<p>{_t("You can also set up Secure Backup & manage your keys in Settings.")}</p>
<DialogButtons
primaryButton={_t("Go back")}
primaryButton={_t("action|go_back")}
onPrimaryButtonClick={this.onGoBackClick}
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: 3 additions & 1 deletion src/components/structures/RoomSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,9 @@ export default class RoomSearch extends React.PureComponent<IProps> {
return (
<AccessibleButton onClick={this.openSpotlight} className={classes}>
{icon}
{!this.props.isMinimized && <div className="mx_RoomSearch_spotlightTriggerText">{_t("Search")}</div>}
{!this.props.isMinimized && (
<div className="mx_RoomSearch_spotlightTriggerText">{_t("action|search")}</div>
)}
{shortcutPrompt}
</AccessibleButton>
);
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
4 changes: 2 additions & 2 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,9 @@ const SpaceLandingAddButton: React.FC<{ space: Room }> = ({ space }) => {
inputRef={handle}
onClick={openMenu}
isExpanded={menuDisplayed}
label={_t("Add")}
label={_t("action|add")}
>
{_t("Add")}
{_t("action|add")}
</ContextMenuButton>
{contextMenu}
</>
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
<IconizedContextMenuOption
className="mx_IconizedContextMenu_option_red"
iconClassName="mx_UserMenu_iconSignOut"
label={_t("Sign out")}
label={_t("action|sign_out")}
onClick={this.onSignOutClick}
/>
</IconizedContextMenuOptionList>
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 @@ -564,7 +564,7 @@ export default class LoginComponent extends React.PureComponent<IProps, IState>
<AuthHeader disableLanguageSelector={this.props.isSyncing || this.state.busyLoggingIn} />
<AuthBody>
<h1>
{_t("Sign in")}
{_t("action|sign_in")}
{loader}
</h1>
{errorTextSection}
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/auth/Registration.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ export default class Registration extends React.Component<IProps, IState> {
if (this.state.doingUIAuth) {
goBack = (
<AccessibleButton kind="link" className="mx_AuthBody_changeFlow" onClick={this.onGoToFormClicked}>
{_t("Go back")}
{_t("action|go_back")}
</AccessibleButton>
);
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/auth/SetupEncryptionBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
{_t("I'll verify later")}
</AccessibleButton>
<AccessibleButton kind="primary" onClick={this.onSkipBackClick}>
{_t("Go Back")}
{_t("action|go_back")}
</AccessibleButton>
</div>
</div>
Expand All @@ -286,7 +286,7 @@ export default class SetupEncryptionBody extends React.Component<IProps, IState>
{_t("Proceed with reset")}
</AccessibleButton>
<AccessibleButton kind="primary" onClick={this.onResetBackClick}>
{_t("Go Back")}
{_t("action|go_back")}
</AccessibleButton>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/components/structures/auth/SoftLogout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
type="submit"
disabled={this.state.busy}
>
{_t("Sign In")}
{_t("action|sign_in")}
</AccessibleButton>
<AccessibleButton onClick={this.onForgotPassword} kind="link">
{_t("Forgotten your password?")}
Expand Down Expand Up @@ -340,7 +340,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
<AuthBody>
<h1>{_t("You're signed out")}</h1>

<h2>{_t("Sign in")}</h2>
<h2>{_t("action|sign_in")}</h2>
<div>{this.renderSignInSection()}</div>

<h2>{_t("Clear personal data")}</h2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const CheckEmail: React.FC<CheckEmailProps> = ({
aria-describedby={tooltipVisible ? tooltipId : undefined}
>
<RetryIcon className="mx_Icon mx_Icon_16" />
{_t("Resend")}
{_t("action|resend")}
<Tooltip
id={tooltipId}
label={_t("Verification link email resent!")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const VerifyEmailModal: React.FC<Props> = ({
aria-describedby={tooltipVisible ? tooltipId : undefined}
>
<RetryIcon className="mx_Icon mx_Icon_16" />
{_t("Resend")}
{_t("action|resend")}
<Tooltip
id={tooltipId}
label={_t("Verification link email resent!")}
Expand Down
Loading
Loading