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

Align common_* strings with Element X project in Localazy #11434

Merged
merged 12 commits into from
Aug 22, 2023
2 changes: 1 addition & 1 deletion src/AsyncWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default class AsyncWrapper extends React.Component<IProps, IState> {
return <Component {...this.props} />;
} else if (this.state.error) {
return (
<BaseDialog onFinished={this.props.onFinished} title={_t("Error")}>
<BaseDialog onFinished={this.props.onFinished} title={_t("common|error")}>
{_t("Unable to load! Check your network connectivity and try again.")}
<DialogButtons
primaryButton={_t("Dismiss")}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ export default class CreateSecretStorageDialog extends React.PureComponent<IProp
<div>
<Field
type="password"
label={_t("Password")}
label={_t("common|password")}
value={this.state.accountPassword}
onChange={this.onAccountPasswordChange}
forceValidity={this.state.accountPasswordCorrect === false ? false : undefined}
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/MatrixChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1990,7 +1990,7 @@ export default class MatrixChat extends React.PureComponent<IProps, IState> {

this.subTitleStatus = "";
if (state === SyncState.Error) {
this.subTitleStatus += `[${_t("Offline")}] `;
this.subTitleStatus += `[${_t("common|offline")}] `;
}
if (numUnreadRooms > 0) {
this.subTitleStatus += `[${numUnreadRooms}]`;
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/RoomSearchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
if (!results?.results?.length) {
ret.push(
<li key="search-top-marker">
<h2 className="mx_RoomView_topMarker">{_t("No results")}</h2>
<h2 className="mx_RoomView_topMarker">{_t("common|no_results")}</h2>
</li>,
);
} else {
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 @@ -253,7 +253,7 @@ const SpaceLanding: React.FC<{ space: Room }> = ({ space }) => {
onClick={() => {
showSpaceSettings(space);
}}
title={_t("Settings")}
title={_t("common|settings")}
/>
);
}
Expand Down Expand Up @@ -313,7 +313,7 @@ const SpaceSetupFirstRooms: React.FC<{
key={name}
name={name}
type="text"
label={_t("Room name")}
label={_t("common|room_name")}
placeholder={placeholders[i]}
value={roomNames[i]}
onChange={(ev: React.ChangeEvent<HTMLInputElement>) => setRoomName(i, ev.target.value)}
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 @@ -378,7 +378,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
{homeButton}
<IconizedContextMenuOption
iconClassName="mx_UserMenu_iconSettings"
label={_t("Settings")}
label={_t("common|settings")}
onClick={(e) => this.onSettingsOpen(e)}
/>
{feedbackButton}
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/auth/SoftLogout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ export default class SoftLogout extends React.Component<IProps, IState> {
{error}
<Field
type="password"
label={_t("Password")}
label={_t("common|password")}
onChange={this.onPasswordChange}
value={this.state.password}
disabled={this.state.busy}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class PasswordAuthEntry extends React.Component<IAuthEntryProps, IPasswor
className={passwordBoxClass}
type="password"
name="passwordField"
label={_t("Password")}
label={_t("common|password")}
autoFocus={true}
value={this.state.password}
onChange={this.onPasswordFieldChange}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/auth/LoginWithQRFlow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ export default class LoginWithQRFlow extends React.Component<IProps> {
buttons = this.cancelButton();
break;
case Phase.Verifying:
title = _t("Success");
title = _t("common|success");
centreTitle = true;
main = this.simpleSpinner(_t("Completing set up of your new device"));
break;
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/auth/PassphraseField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ interface IProps extends Omit<IInputProps, "onValidate" | "element"> {

class PassphraseField extends PureComponent<IProps> {
public static defaultProps = {
label: _td("Password"),
label: _td("common|password"),
labelEnterPassword: _td("Enter password"),
labelStrongPassword: _td("Nice, strong password!"),
labelAllowedButUnsafe: _td("Password is allowed, but unsafe"),
Expand Down
8 changes: 4 additions & 4 deletions src/components/views/auth/PasswordLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ export default class PasswordLogin extends React.PureComponent<IProps, IState> {
autoComplete="username"
key="username_input"
type="text"
label={_t("Username")}
placeholder={_t("Username").toLocaleLowerCase()}
label={_t("common|username")}
placeholder={_t("common|username").toLocaleLowerCase()}
value={this.props.username}
onChange={this.onUsernameChanged}
onBlur={this.onUsernameBlur}
Expand Down Expand Up @@ -404,7 +404,7 @@ export default class PasswordLogin extends React.PureComponent<IProps, IState> {
disabled={this.props.busy}
>
<option key={LoginField.MatrixId} value={LoginField.MatrixId}>
{_t("Username")}
{_t("common|username")}
</option>
<option key={LoginField.Email} value={LoginField.Email}>
{_t("Email address")}
Expand All @@ -428,7 +428,7 @@ export default class PasswordLogin extends React.PureComponent<IProps, IState> {
autoComplete="current-password"
type="password"
name="password"
label={_t("Password")}
label={_t("common|password")}
value={this.state.password}
onChange={this.onPasswordChanged}
disabled={this.props.busy}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/auth/RegistrationForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,8 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
ref={(field) => (this[RegistrationField.Username] = field)}
type="text"
autoFocus={true}
label={_t("Username")}
placeholder={_t("Username").toLocaleLowerCase()}
label={_t("common|username")}
placeholder={_t("common|username").toLocaleLowerCase()}
value={this.state.username}
onChange={this.onUsernameChange}
onValidate={this.onUsernameValidate}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/avatars/DecoratedRoomAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function tooltipText(variant: Icon): string | undefined {
case Icon.PresenceAway:
return _t("Away");
case Icon.PresenceOffline:
return _t("Offline");
return _t("common|offline");
case Icon.PresenceBusy:
return _t("Busy");
}
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/context_menus/RoomContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
iconClassName = "mx_RoomTile_iconNotificationsMentionsKeywords";
break;
case RoomNotifState.Mute:
notificationLabel = _t("Mute");
notificationLabel = _t("common|mute");
iconClassName = "mx_RoomTile_iconNotificationsNone";
break;
}
Expand Down Expand Up @@ -228,7 +228,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
onFinished();
PosthogTrackers.trackInteraction("WebRoomHeaderContextMenuPeopleItem", ev);
}}
label={_t("People")}
label={_t("common|people")}
iconClassName="mx_RoomTile_iconPeople"
>
<span className="mx_IconizedContextMenu_sublabel">{room.getJoinedMemberCount()}</span>
Expand Down Expand Up @@ -390,7 +390,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
onFinished();
PosthogTrackers.trackInteraction("WebRoomHeaderContextMenuSettingsItem", ev);
}}
label={_t("Settings")}
label={_t("common|settings")}
iconClassName="mx_RoomTile_iconSettings"
/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
}),
onPostSettingsClick,
)}
label={_t("Settings")}
label={_t("common|settings")}
iconClassName="mx_RoomGeneralContextMenu_iconSettings"
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/context_menus/SpaceContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
<IconizedContextMenuOption
data-testid="settings-option"
iconClassName="mx_SpacePanel_iconSettings"
label={_t("Settings")}
label={_t("common|settings")}
onClick={onSettingsClick}
/>
);
Expand Down
4 changes: 3 additions & 1 deletion src/components/views/dialogs/AddExistingToSpaceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,9 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({

{dms.length > 0 && dmsRenderer ? dmsRenderer(dms, selectedToAdd, dmsScrollState, onChange) : null}

{noResults ? <span className="mx_AddExistingToSpace_noResults">{_t("No results")}</span> : undefined}
{noResults ? (
<span className="mx_AddExistingToSpace_noResults">{_t("common|no_results")}</span>
) : undefined}
</AutoHideScrollbar>

<div className="mx_AddExistingToSpace_footer">{footer}</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export default class ConfirmAndWaitRedactDialog extends React.PureComponent<IPro
return (
<ErrorDialog
onFinished={this.props.onFinished}
title={_t("Error")}
title={_t("common|error")}
description={_t("You cannot delete this message. (%(code)s)", { code })}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ConfirmRedactDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function createRedactEventDialog({
if (typeof code !== "undefined") {
// display error message stating you couldn't delete this.
Modal.createDialog(ErrorDialog, {
title: _t("Error"),
title: _t("common|error"),
description: _t("You cannot delete this message. (%(code)s)", { code }),
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/DeactivateAccountDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ export default class DeactivateAccountDialog extends React.Component<IProps, ISt
error = <div className="error">{this.state.errStr}</div>;
}

let auth = <div>{_t("Loading…")}</div>;
let auth = <div>{_t("common|loading")}</div>;
if (this.state.authData && this.state.authEnabled) {
auth = (
<div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ErrorDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export default class ErrorDialog extends React.Component<IProps, IState> {
<BaseDialog
className="mx_ErrorDialog"
onFinished={this.props.onFinished}
title={this.props.title || _t("Error")}
title={this.props.title || _t("common|error")}
headerImage={this.props.headerImage}
contentId="mx_Dialog_content"
>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/FeedbackDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const FeedbackDialog: React.FC<IProps> = (props: IProps) => {
description={
<React.Fragment>
<div className="mx_FeedbackDialog_section mx_FeedbackDialog_reportBug">
<h3>{_t("Report a bug")}</h3>
<h3>{_t("common|report_a_bug")}</h3>
<p>
{_t(
"Please view <existingIssuesLink>existing bugs on Github</existingIssuesLink> first. No match? <newIssueLink>Start a new one</newIssueLink>.",
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/ForwardDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ const ForwardDialog: React.FC<IProps> = ({ matrixClient: cli, event, permalinkCr

return (
<BaseDialog
title={_t("Forward message")}
title={_t("common|forward_message")}
className="mx_ForwardDialog"
contentId="mx_ForwardList"
onFinished={onFinished}
Expand Down Expand Up @@ -329,7 +329,7 @@ const ForwardDialog: React.FC<IProps> = ({ matrixClient: cli, event, permalinkCr
/>
</div>
) : (
<span className="mx_ForwardList_noResults">{_t("No results")}</span>
<span className="mx_ForwardList_noResults">{_t("common|no_results")}</span>
)}
</AutoHideScrollbar>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default class IntegrationsDisabledDialog extends React.Component<IProps>
</p>
</div>
<DialogButtons
primaryButton={_t("Settings")}
primaryButton={_t("common|settings")}
onPrimaryButtonClick={this.onOpenSettingsClick}
cancelButton={_t("OK")}
onCancel={this.onAcknowledgeClick}
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/dialogs/InviteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -990,10 +990,10 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
let showNum = kind === "recents" ? this.state.numRecentsShown : this.state.numSuggestionsShown;
const showMoreFn = kind === "recents" ? this.showMoreRecents.bind(this) : this.showMoreSuggestions.bind(this);
const lastActive = (m: Result): number | undefined => (kind === "recents" ? m.lastActive : undefined);
let sectionName = kind === "recents" ? _t("Recent Conversations") : _t("Suggestions");
let sectionName = kind === "recents" ? _t("Recent Conversations") : _t("common|suggestions");

if (this.props.kind === InviteKind.Invite) {
sectionName = kind === "recents" ? _t("Recently Direct Messaged") : _t("Suggestions");
sectionName = kind === "recents" ? _t("Recently Direct Messaged") : _t("common|suggestions");
}

// Mix in the server results if we have any, but only if we're searching. We track the additional
Expand Down Expand Up @@ -1038,7 +1038,7 @@ export default class InviteDialog extends React.PureComponent<Props, IInviteDial
return (
<div className="mx_InviteDialog_section">
<h3>{sectionName}</h3>
<p>{_t("No results")}</p>
<p>{_t("common|no_results")}</p>
</div>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ const ManageRestrictedJoinRuleDialog: React.FC<IProps> = ({ room, selected = [],
) : null}

{totalResults < 1 ? (
<span className="mx_ManageRestrictedJoinRuleDialog_noResults">{_t("No results")}</span>
<span className="mx_ManageRestrictedJoinRuleDialog_noResults">{_t("common|no_results")}</span>
) : undefined}
</AutoHideScrollbar>

Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/RoomSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ class RoomSettingsDialog extends React.Component<IProps, IState> {
tabs.push(
new Tab(
RoomSettingsTab.People,
_td("People"),
_td("common|people"),
"mx_RoomSettingsDialog_peopleIcon",
<PeopleRoomSettingsTab room={this.state.room} />,
),
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/SpacePreferencesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const SpacePreferencesAppearanceTab: React.FC<Pick<IProps, "space">> = ({ space
);
}}
>
{_t("People")}
{_t("common|people")}
</StyledCheckbox>
<SettingsSubsectionText>
{_t(
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/TextInputDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default class TextInputDialog extends React.Component<IProps, IState> {
title: "",
value: "",
description: "",
busyMessage: _td("Loading…"),
busyMessage: _td("common|loading"),
focus: true,
hasCancel: true,
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/UserSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
className="mx_UserSettingsDialog"
hasCancel={true}
onFinished={this.props.onFinished}
title={_t("Settings")}
title={_t("common|settings")}
>
<div className="mx_SettingsDialog_content">
<TabbedView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
</div>
);
} else if (this.state.loadError) {
title = _t("Error");
title = _t("common|error");
content = _t("Unable to load backup status");
} else if (this.state.restoreError) {
if (
Expand Down Expand Up @@ -369,11 +369,11 @@ export default class RestoreKeyBackupDialog extends React.PureComponent<IProps,
);
}
} else {
title = _t("Error");
title = _t("common|error");
content = _t("Unable to restore backup");
}
} else if (this.state.backupInfo === null) {
title = _t("Error");
title = _t("common|error");
content = _t("No backup found!");
} else if (this.state.recoverInfo) {
title = _t("Keys restored");
Expand Down
6 changes: 3 additions & 3 deletions src/components/views/dialogs/spotlight/SpotlightDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ enum Section {
function filterToLabel(filter: Filter): string {
switch (filter) {
case Filter.People:
return _t("People");
return _t("common|people");
case Filter.PublicRooms:
return _t("Public rooms");
case Filter.PublicSpaces:
Expand Down Expand Up @@ -751,7 +751,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
role="group"
aria-labelledby="mx_SpotlightDialog_section_suggestions"
>
<h4 id="mx_SpotlightDialog_section_suggestions">{_t("Suggestions")}</h4>
<h4 id="mx_SpotlightDialog_section_suggestions">{_t("common|suggestions")}</h4>
<div>{results[Section.Suggestions].slice(0, SECTION_LIMIT).map(resultMapper)}</div>
</div>
);
Expand Down Expand Up @@ -807,7 +807,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
aria-labelledby="mx_SpotlightDialog_section_publicRooms"
>
<div className="mx_SpotlightDialog_sectionHeader">
<h4 id="mx_SpotlightDialog_section_publicRooms">{_t("Suggestions")}</h4>
<h4 id="mx_SpotlightDialog_section_publicRooms">{_t("common|suggestions")}</h4>
<div className="mx_SpotlightDialog_options">
<NetworkDropdown protocols={protocols} config={config ?? null} setConfig={setConfig} />
</div>
Expand Down
Loading
Loading