Migrate more strings to translation keys (#11498)
This commit is contained in:
parent
9329b896b3
commit
6b3243b27b
89 changed files with 1495 additions and 1491 deletions
|
@ -897,7 +897,7 @@ const SpaceHierarchy: React.FC<IProps> = ({ space, initialText = "", showRoom, a
|
|||
className="mx_SpaceHierarchy_list"
|
||||
onKeyDown={onKeyDownHandler}
|
||||
role="tree"
|
||||
aria-label={_t("Space")}
|
||||
aria-label={_t("common|space")}
|
||||
>
|
||||
{results}
|
||||
</ul>
|
||||
|
|
|
@ -304,8 +304,8 @@ const SpaceSetupFirstRooms: React.FC<{
|
|||
const [busy, setBusy] = useState(false);
|
||||
const [error, setError] = useState("");
|
||||
const numFields = 3;
|
||||
const placeholders = [_t("General"), _t("Random"), _t("Support")];
|
||||
const [roomNames, setRoomName] = useStateArray(numFields, [_t("General"), _t("Random"), ""]);
|
||||
const placeholders = [_t("General"), _t("common|random"), _t("common|support")];
|
||||
const [roomNames, setRoomName] = useStateArray(numFields, [_t("General"), _t("common|random"), ""]);
|
||||
const fields = new Array(numFields).fill(0).map((x, i) => {
|
||||
const name = "roomName" + i;
|
||||
return (
|
||||
|
|
|
@ -62,7 +62,7 @@ export default class PlayPauseButton extends React.PureComponent<IProps> {
|
|||
<AccessibleTooltipButton
|
||||
data-testid="play-pause-button"
|
||||
className={classes}
|
||||
title={isPlaying ? _t("Pause") : _t("Play")}
|
||||
title={isPlaying ? _t("action|pause") : _t("action|play")}
|
||||
onClick={this.onClick}
|
||||
disabled={isDisabled}
|
||||
{...restProps}
|
||||
|
|
|
@ -163,7 +163,7 @@ export default class LoginWithQRFlow extends React.Component<IProps> {
|
|||
kind="primary"
|
||||
onClick={this.handleClick(Click.Approve)}
|
||||
>
|
||||
{_t("Approve")}
|
||||
{_t("action|approve")}
|
||||
</AccessibleButton>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -536,7 +536,12 @@ export default class RegistrationForm extends React.PureComponent<IProps, IState
|
|||
|
||||
public render(): ReactNode {
|
||||
const registerButton = (
|
||||
<input className="mx_Login_submit" type="submit" value={_t("Register")} disabled={!this.props.canSubmit} />
|
||||
<input
|
||||
className="mx_Login_submit"
|
||||
type="submit"
|
||||
value={_t("action|register")}
|
||||
disabled={!this.props.canSubmit}
|
||||
/>
|
||||
);
|
||||
|
||||
let emailHelperText: JSX.Element | undefined;
|
||||
|
|
|
@ -197,7 +197,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
|
|||
<IconizedContextMenuOption
|
||||
data-testid="new-subspace-option"
|
||||
iconClassName="mx_SpacePanel_iconPlus"
|
||||
label={_t("Space")}
|
||||
label={_t("common|space")}
|
||||
onClick={onNewSubspaceClick}
|
||||
>
|
||||
<BetaPill />
|
||||
|
@ -254,7 +254,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
|
|||
/>
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_SpacePanel_iconPreferences"
|
||||
label={_t("Preferences")}
|
||||
label={_t("common|preferences")}
|
||||
onClick={onPreferencesClick}
|
||||
/>
|
||||
{devtoolsOption}
|
||||
|
|
|
@ -86,7 +86,7 @@ const SpacePreferencesDialog: React.FC<IProps> = ({ space, initialTabId, onFinis
|
|||
className="mx_SpacePreferencesDialog"
|
||||
hasCancel
|
||||
onFinished={onFinished}
|
||||
title={_t("Preferences")}
|
||||
title={_t("common|preferences")}
|
||||
fixedWidth={false}
|
||||
>
|
||||
<h4>
|
||||
|
|
|
@ -104,7 +104,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
|
|||
tabs.push(
|
||||
new Tab(
|
||||
UserTab.Preferences,
|
||||
_td("Preferences"),
|
||||
_td("common|preferences"),
|
||||
"mx_UserSettingsDialog_preferencesIcon",
|
||||
<PreferencesUserSettingsTab closeSettingsFn={this.props.onFinished} />,
|
||||
"UserSettingsPreferences",
|
||||
|
|
|
@ -127,7 +127,7 @@ export default class WidgetCapabilitiesPromptDialog extends React.PureComponent<
|
|||
<div className="text-muted">{_t("This widget would like to:")}</div>
|
||||
{checkboxRows}
|
||||
<DialogButtons
|
||||
primaryButton={_t("Approve")}
|
||||
primaryButton={_t("action|approve")}
|
||||
cancelButton={_t("Decline All")}
|
||||
onPrimaryButtonClick={this.onSubmit}
|
||||
onCancel={this.onReject}
|
||||
|
|
|
@ -214,7 +214,7 @@ export default class ReactionsRow extends React.PureComponent<IProps, IState> {
|
|||
items = items.slice(0, MAX_ITEMS_WHEN_LIMITED);
|
||||
showAllButton = (
|
||||
<AccessibleButton kind="link_inline" className="mx_ReactionsRow_showAll" onClick={this.onShowAllClick}>
|
||||
{_t("Show all")}
|
||||
{_t("action|show_all")}
|
||||
</AccessibleButton>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ export function EmojiButton({ addEmoji, menuPosition, className }: IEmojiButtonP
|
|||
className={computedClassName}
|
||||
iconClassName="mx_EmojiButton_icon"
|
||||
onClick={openMenu}
|
||||
title={_t("Emoji")}
|
||||
title={_t("common|emoji")}
|
||||
inputRef={button}
|
||||
/>
|
||||
|
||||
|
|
|
@ -31,8 +31,8 @@ export enum PowerStatus {
|
|||
}
|
||||
|
||||
const PowerLabel: Record<PowerStatus, TranslationKey> = {
|
||||
[PowerStatus.Admin]: _td("Admin"),
|
||||
[PowerStatus.Moderator]: _td("Mod"),
|
||||
[PowerStatus.Admin]: _td("power_level|admin"),
|
||||
[PowerStatus.Moderator]: _td("power_level|mod"),
|
||||
};
|
||||
|
||||
export type PresenceState = "offline" | "online" | "unavailable";
|
||||
|
|
|
@ -247,7 +247,7 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||
{},
|
||||
{ idserver: (sub) => <b>{abbreviateUrl(this.state.currentClientIdServer)}</b> },
|
||||
),
|
||||
button: _t("Disconnect"),
|
||||
button: _t("action|disconnect"),
|
||||
});
|
||||
if (confirmed) {
|
||||
this.disconnectIdServer();
|
||||
|
@ -404,7 +404,7 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||
|
||||
let discoSection;
|
||||
if (idServerUrl) {
|
||||
let discoButtonContent: React.ReactNode = _t("Disconnect");
|
||||
let discoButtonContent: React.ReactNode = _t("action|disconnect");
|
||||
let discoBodyText = _t(
|
||||
"Disconnecting from your identity server will mean you won't be discoverable by other users and you won't be able to invite others by email or phone.",
|
||||
);
|
||||
|
@ -448,7 +448,7 @@ export default class SetIdServer extends React.Component<IProps, IState> {
|
|||
onClick={this.checkIdServer}
|
||||
disabled={!this.idServerChangeEnabled()}
|
||||
>
|
||||
{_t("Change")}
|
||||
{_t("action|change")}
|
||||
</AccessibleButton>
|
||||
{discoSection}
|
||||
</form>
|
||||
|
|
|
@ -139,7 +139,7 @@ export const DeviceDetailHeading: React.FC<Props> = ({ device, saveDeviceName })
|
|||
className="mx_DeviceDetailHeading_renameCta"
|
||||
data-testid="device-heading-rename-cta"
|
||||
>
|
||||
{_t("Rename")}
|
||||
{_t("action|rename")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -160,7 +160,7 @@ const NoResults: React.FC<NoResultsProps> = ({ filter, clearFilter }) => (
|
|||
<>
|
||||
|
||||
<AccessibleButton kind="link_inline" onClick={clearFilter} data-testid="devices-clear-filter-btn">
|
||||
{_t("Show all")}
|
||||
{_t("action|show_all")}
|
||||
</AccessibleButton>
|
||||
</>
|
||||
)
|
||||
|
@ -353,7 +353,7 @@ export const FilteredDeviceList = forwardRef(
|
|||
value={filter || ALL_FILTER_ID}
|
||||
onOptionChange={onFilterOptionChange}
|
||||
options={options}
|
||||
selectedLabel={_t("Show")}
|
||||
selectedLabel={_t("action|show")}
|
||||
/>
|
||||
)}
|
||||
</FilteredDeviceListHeader>
|
||||
|
|
|
@ -74,7 +74,7 @@ const SecurityRecommendations: React.FC<Props> = ({ devices, currentDeviceId, go
|
|||
onClick={() => goToFilteredList(DeviceSecurityVariation.Unverified)}
|
||||
data-testid="unverified-devices-cta"
|
||||
>
|
||||
{_t("View all") + ` (${unverifiedDevicesCount})`}
|
||||
{_t("action|view_all") + ` (${unverifiedDevicesCount})`}
|
||||
</AccessibleButton>
|
||||
</DeviceSecurityCard>
|
||||
)}
|
||||
|
@ -99,7 +99,7 @@ const SecurityRecommendations: React.FC<Props> = ({ devices, currentDeviceId, go
|
|||
onClick={() => goToFilteredList(DeviceSecurityVariation.Inactive)}
|
||||
data-testid="inactive-devices-cta"
|
||||
>
|
||||
{_t("View all") + ` (${inactiveDevicesCount})`}
|
||||
{_t("action|view_all") + ` (${inactiveDevicesCount})`}
|
||||
</AccessibleButton>
|
||||
</DeviceSecurityCard>
|
||||
</>
|
||||
|
|
|
@ -185,7 +185,7 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
|
|||
onClick={this.onContinueClick}
|
||||
disabled={this.state.continueDisabled}
|
||||
>
|
||||
{_t("Complete")}
|
||||
{_t("action|complete")}
|
||||
</AccessibleButton>
|
||||
</span>
|
||||
);
|
||||
|
@ -197,7 +197,7 @@ export class EmailAddress extends React.Component<IEmailAddressProps, IEmailAddr
|
|||
onClick={this.onRevokeClick}
|
||||
disabled={this.props.disabled}
|
||||
>
|
||||
{_t("Revoke")}
|
||||
{_t("action|revoke")}
|
||||
</AccessibleButton>
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -205,7 +205,7 @@ export class PhoneNumber extends React.Component<IPhoneNumberProps, IPhoneNumber
|
|||
onClick={this.onRevokeClick}
|
||||
disabled={this.props.disabled}
|
||||
>
|
||||
{_t("Revoke")}
|
||||
{_t("action|revoke")}
|
||||
</AccessibleButton>
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -106,7 +106,7 @@ export default function NotificationSettings2(): JSX.Element {
|
|||
{hasPendingChanges && model !== null && (
|
||||
<SettingsBanner
|
||||
icon={<img src={NewAndImprovedIcon} alt="" width={12} />}
|
||||
action={_t("Proceed")}
|
||||
action={_t("action|proceed")}
|
||||
onAction={() => reconcile(model!)}
|
||||
>
|
||||
{_t(
|
||||
|
|
|
@ -94,7 +94,7 @@ const Knock: VFC<{
|
|||
disabled={!canKick || disabled}
|
||||
kind="icon_primary_outline"
|
||||
onClick={() => handleDeny(roomMember.userId)}
|
||||
title={_t("Deny")}
|
||||
title={_t("action|deny")}
|
||||
>
|
||||
<XIcon width={18} height={18} />
|
||||
</AccessibleButton>
|
||||
|
@ -103,7 +103,7 @@ const Knock: VFC<{
|
|||
disabled={!canInvite || disabled}
|
||||
kind="icon_primary"
|
||||
onClick={() => handleApprove(roomMember.userId)}
|
||||
title={_t("Approve")}
|
||||
title={_t("action|approve")}
|
||||
>
|
||||
<CheckIcon width={18} height={18} />
|
||||
</AccessibleButton>
|
||||
|
|
|
@ -121,7 +121,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
}
|
||||
|
||||
return (
|
||||
<SettingsSubsection heading={_t("Legal")}>
|
||||
<SettingsSubsection heading={_t("common|legal")}>
|
||||
<SettingsSubsectionText>{legalLinks}</SettingsSubsectionText>
|
||||
</SettingsSubsection>
|
||||
);
|
||||
|
@ -131,7 +131,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
// Note: This is not translated because it is legal text.
|
||||
// Also, is ugly but necessary.
|
||||
return (
|
||||
<SettingsSubsection heading={_t("Credits")}>
|
||||
<SettingsSubsection heading={_t("common|credits")}>
|
||||
<SettingsSubsectionText>
|
||||
<ul>
|
||||
<li>
|
||||
|
@ -308,7 +308,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
<SettingsTab>
|
||||
<SettingsSection heading={_t("Help & About")}>
|
||||
{bugReportingSection}
|
||||
<SettingsSubsection heading={_t("FAQ")} description={faqText} />
|
||||
<SettingsSubsection heading={_t("common|faq")} description={faqText} />
|
||||
<SettingsSubsection heading={_t("Versions")}>
|
||||
<SettingsSubsectionText>
|
||||
<CopyableText getTextToCopy={this.getVersionTextToCopy}>
|
||||
|
@ -349,7 +349,7 @@ export default class HelpUserSettingsTab extends React.Component<IProps, IState>
|
|||
)}
|
||||
<SettingsSubsectionText>
|
||||
<details>
|
||||
<summary>{_t("Access Token")}</summary>
|
||||
<summary>{_t("common|access_token")}</summary>
|
||||
<b>
|
||||
{_t(
|
||||
"Your access token gives full access to your account. Do not share it with anyone.",
|
||||
|
|
|
@ -225,7 +225,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||
onClick={() => this.unsubscribeFromList(list)}
|
||||
disabled={this.state.busy}
|
||||
>
|
||||
{_t("Unsubscribe")}
|
||||
{_t("action|unsubscribe")}
|
||||
</AccessibleButton>
|
||||
|
||||
<AccessibleButton
|
||||
|
@ -326,7 +326,7 @@ export default class MjolnirUserSettingsTab extends React.Component<{}, IState>
|
|||
onClick={this.onSubscribeList}
|
||||
disabled={this.state.busy}
|
||||
>
|
||||
{_t("Subscribe")}
|
||||
{_t("action|subscribe")}
|
||||
</AccessibleButton>
|
||||
</form>
|
||||
</SettingsSubsection>
|
||||
|
|
|
@ -145,7 +145,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
|
||||
return (
|
||||
<SettingsTab data-testid="mx_PreferencesUserSettingsTab">
|
||||
<SettingsSection heading={_t("Preferences")}>
|
||||
<SettingsSection heading={_t("common|preferences")}>
|
||||
{roomListSettings.length > 0 && (
|
||||
<SettingsSubsection heading={_t("Room list")}>
|
||||
{this.renderGroup(roomListSettings)}
|
||||
|
@ -178,7 +178,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection
|
||||
heading={_t("Presence")}
|
||||
heading={_t("common|presence")}
|
||||
description={_t("Share your activity and status with others.")}
|
||||
>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.PRESENCE_SETTINGS)}
|
||||
|
@ -196,7 +196,7 @@ export default class PreferencesUserSettingsTab extends React.Component<IProps,
|
|||
{this.renderGroup(PreferencesUserSettingsTab.IMAGES_AND_VIDEOS_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
<SettingsSubsection heading={_t("Timeline")}>
|
||||
<SettingsSubsection heading={_t("common|timeline")}>
|
||||
{this.renderGroup(PreferencesUserSettingsTab.TIMELINE_SETTINGS)}
|
||||
</SettingsSubsection>
|
||||
|
||||
|
|
|
@ -317,7 +317,7 @@ export default class SecurityUserSettingsTab extends React.Component<IProps, ISt
|
|||
});
|
||||
};
|
||||
privacySection = (
|
||||
<SettingsSection heading={_t("Privacy")}>
|
||||
<SettingsSection heading={_t("common|privacy")}>
|
||||
<SettingsSubsection
|
||||
heading={_t("common|analytics")}
|
||||
description={_t(
|
||||
|
|
|
@ -169,10 +169,10 @@ export default class VoiceUserSettingsTab extends React.Component<{}, IState> {
|
|||
speakerDropdown = this.renderDropdown(MediaDeviceKindEnum.AudioOutput, _t("Audio Output")) || (
|
||||
<p>{_t("No Audio Outputs detected")}</p>
|
||||
);
|
||||
microphoneDropdown = this.renderDropdown(MediaDeviceKindEnum.AudioInput, _t("Microphone")) || (
|
||||
microphoneDropdown = this.renderDropdown(MediaDeviceKindEnum.AudioInput, _t("common|microphone")) || (
|
||||
<p>{_t("No Microphones detected")}</p>
|
||||
);
|
||||
webcamDropdown = this.renderDropdown(MediaDeviceKindEnum.VideoInput, _t("Camera")) || (
|
||||
webcamDropdown = this.renderDropdown(MediaDeviceKindEnum.VideoInput, _t("common|camera")) || (
|
||||
<p>{_t("No Webcams detected")}</p>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue