Migrate more strings to translation keys (#11669)
This commit is contained in:
parent
0c6e56ca91
commit
5252361d1e
112 changed files with 4855 additions and 4542 deletions
|
@ -145,7 +145,7 @@ const SpaceChildrenPicker: React.FC<IProps> = ({
|
|||
|
||||
{state === Target.Specific && (
|
||||
<SpecificChildrenPicker
|
||||
filterPlaceholder={_t("Search %(spaceName)s", { spaceName: space.name })}
|
||||
filterPlaceholder={_t("space|search_children", { spaceName: space.name })}
|
||||
rooms={spaceChildren}
|
||||
selected={selected}
|
||||
onChange={(isSelected: boolean, room: Room) => {
|
||||
|
|
|
@ -193,8 +193,8 @@ export const SpaceCreateForm: React.FC<ISpaceCreateFormProps> = ({
|
|||
onChange={setAlias}
|
||||
domain={domain}
|
||||
value={alias}
|
||||
placeholder={name ? nameToLocalpart(name) : _t("create_space|name_placeholder")}
|
||||
label={_t("Address")}
|
||||
placeholder={name ? nameToLocalpart(name) : _t("create_space|address_placeholder")}
|
||||
label={_t("create_space|address_label")}
|
||||
disabled={busy}
|
||||
onKeyDown={onKeyDown}
|
||||
/>
|
||||
|
@ -284,7 +284,7 @@ const SpaceCreateMenu: React.FC<{
|
|||
if (visibility === null) {
|
||||
body = (
|
||||
<React.Fragment>
|
||||
<h2>{_t("Create a space")}</h2>
|
||||
<h2>{_t("create_space|label")}</h2>
|
||||
<p>{_t("create_space|explainer")}</p>
|
||||
|
||||
<SpaceCreateMenuType
|
||||
|
@ -322,7 +322,7 @@ const SpaceCreateMenu: React.FC<{
|
|||
: _t("create_space|private_heading")}
|
||||
</h2>
|
||||
<p>
|
||||
{_t("create_space|add_details_prompt")} {_t("You can change these anytime.")}
|
||||
{_t("create_space|add_details_prompt")} {_t("create_space|add_details_prompt_2")}
|
||||
</p>
|
||||
|
||||
<SpaceCreateForm
|
||||
|
@ -341,7 +341,7 @@ const SpaceCreateMenu: React.FC<{
|
|||
/>
|
||||
|
||||
<AccessibleButton kind="primary" onClick={onSpaceCreateClick} disabled={busy}>
|
||||
{busy ? _t("Creating…") : _t("action|create")}
|
||||
{busy ? _t("create_space|creating") : _t("action|create")}
|
||||
</AccessibleButton>
|
||||
</React.Fragment>
|
||||
);
|
||||
|
|
|
@ -101,7 +101,7 @@ export const HomeButtonContextMenu: React.FC<ComponentProps<typeof SpaceContextM
|
|||
<IconizedContextMenuOptionList first>
|
||||
<IconizedContextMenuCheckbox
|
||||
iconClassName="mx_SpacePanel_noIcon"
|
||||
label={_t("Show all rooms")}
|
||||
label={_t("settings|sidebar|metaspaces_home_all_rooms")}
|
||||
active={allRoomsInHome}
|
||||
onClick={() => {
|
||||
onFinished();
|
||||
|
@ -245,7 +245,7 @@ const CreateSpaceButton: React.FC<Pick<IInnerSpacePanelProps, "isPanelCollapsed"
|
|||
className={classNames("mx_SpaceButton_new", {
|
||||
mx_SpaceButton_newCancel: menuDisplayed,
|
||||
})}
|
||||
label={menuDisplayed ? _t("action|cancel") : _t("Create a space")}
|
||||
label={menuDisplayed ? _t("action|cancel") : _t("create_space|label")}
|
||||
onClick={onNewClick}
|
||||
isNarrow={isPanelCollapsed}
|
||||
innerRef={handle}
|
||||
|
@ -297,7 +297,7 @@ const InnerSpacePanel = React.memo<IInnerSpacePanelProps>(
|
|||
}
|
||||
element="ul"
|
||||
role="tree"
|
||||
aria-label={_t("Spaces")}
|
||||
aria-label={_t("common|spaces")}
|
||||
>
|
||||
{metaSpacesSection}
|
||||
{invites.map((s) => (
|
||||
|
|
|
@ -52,7 +52,7 @@ const SpacePublicShare: React.FC<IProps> = ({ space, onFinished }) => {
|
|||
}
|
||||
}}
|
||||
>
|
||||
{_t("Share invite link")}
|
||||
{_t("space|invite_link")}
|
||||
<div>{copiedText}</div>
|
||||
</AccessibleButton>
|
||||
{space.canInvite(MatrixClientPeg.safeGet().getSafeUserId()) &&
|
||||
|
@ -64,8 +64,8 @@ const SpacePublicShare: React.FC<IProps> = ({ space, onFinished }) => {
|
|||
showRoomInviteDialog(space.roomId);
|
||||
}}
|
||||
>
|
||||
{_t("Invite people")}
|
||||
<div>{_t("Invite with email or username")}</div>
|
||||
{_t("space|invite")}
|
||||
<div>{_t("space|invite_description")}</div>
|
||||
</AccessibleButton>
|
||||
) : null}
|
||||
</div>
|
||||
|
|
|
@ -90,15 +90,15 @@ const SpaceSettingsGeneralTab: React.FC<IProps> = ({ matrixClient: cli, space })
|
|||
const failures = results.filter((r) => r.status === "rejected");
|
||||
if (failures.length > 0) {
|
||||
logger.error("Failed to save space settings: ", failures);
|
||||
setError(_t("Failed to save space settings."));
|
||||
setError(_t("room_settings|general|error_save_space_settings"));
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<SettingsTab>
|
||||
<SettingsSection heading={_t("General")}>
|
||||
<SettingsSection heading={_t("common|general")}>
|
||||
<div>
|
||||
<div>{_t("Edit settings relating to your space.")}</div>
|
||||
<div>{_t("room_settings|general|description_space")}</div>
|
||||
|
||||
{error && <div className="mx_SpaceRoomView_errorText">{error}</div>}
|
||||
|
||||
|
@ -122,18 +122,18 @@ const SpaceSettingsGeneralTab: React.FC<IProps> = ({ matrixClient: cli, space })
|
|||
{_t("action|cancel")}
|
||||
</AccessibleButton>
|
||||
<AccessibleButton onClick={onSave} disabled={busy} kind="primary">
|
||||
{busy ? _t("Saving…") : _t("Save Changes")}
|
||||
{busy ? _t("common|saving") : _t("room_settings|general|save")}
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
|
||||
<SettingsSubsection heading={_t("Leave Space")}>
|
||||
<SettingsSubsection heading={_t("room_settings|general|leave_space")}>
|
||||
<AccessibleButton
|
||||
kind="danger"
|
||||
onClick={() => {
|
||||
leaveSpace(space);
|
||||
}}
|
||||
>
|
||||
{_t("Leave Space")}
|
||||
{_t("room_settings|general|leave_space")}
|
||||
</AccessibleButton>
|
||||
</SettingsSubsection>
|
||||
</SettingsSection>
|
||||
|
|
|
@ -64,7 +64,7 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
},
|
||||
"",
|
||||
),
|
||||
() => setError(_t("Failed to update the guest access of this space")),
|
||||
() => setError(_t("room_settings|visibility|error_update_guest_access")),
|
||||
);
|
||||
const [historyVisibility, setHistoryVisibility] = useLocalEcho<HistoryVisibility>(
|
||||
() =>
|
||||
|
@ -79,7 +79,7 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
},
|
||||
"",
|
||||
),
|
||||
() => setError(_t("Failed to update the history visibility of this space")),
|
||||
() => setError(_t("room_settings|visibility|error_update_history_visibility")),
|
||||
);
|
||||
|
||||
const [showAdvancedSection, toggleAdvancedSection] = useStateToggle();
|
||||
|
@ -100,7 +100,7 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
className="mx_SettingsTab_showAdvanced"
|
||||
aria-expanded={showAdvancedSection}
|
||||
>
|
||||
{showAdvancedSection ? _t("Hide advanced") : _t("Show advanced")}
|
||||
{showAdvancedSection ? _t("action|hide_advanced") : _t("action|show_advanced")}
|
||||
</AccessibleButton>
|
||||
|
||||
{showAdvancedSection && (
|
||||
|
@ -109,12 +109,12 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
value={guestAccessEnabled}
|
||||
onChange={setGuestAccessEnabled}
|
||||
disabled={!canSetGuestAccess}
|
||||
label={_t("Enable guest access")}
|
||||
label={_t("room_settings|visibility|guest_access_label")}
|
||||
/>
|
||||
<p>
|
||||
{_t("Guests can join a space without having an account.")}
|
||||
{_t("room_settings|visibility|guest_access_explainer")}
|
||||
<br />
|
||||
{_t("This may be useful for public spaces.")}
|
||||
{_t("room_settings|visibility|guest_access_explainer_public_space")}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
|
@ -139,7 +139,7 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
|
||||
return (
|
||||
<SettingsTab>
|
||||
<SettingsSection heading={_t("Visibility")}>
|
||||
<SettingsSection heading={_t("room_settings|visibility|title")}>
|
||||
{error && (
|
||||
<div data-testid="space-settings-error" className="mx_SpaceRoomView_errorText">
|
||||
{error}
|
||||
|
@ -148,12 +148,12 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
|
||||
<SettingsFieldset
|
||||
data-testid="access-fieldset"
|
||||
legend={_t("Access")}
|
||||
description={_t("Decide who can view and join %(spaceName)s.", { spaceName: space.name })}
|
||||
legend={_t("room_settings|access|title")}
|
||||
description={_t("room_settings|access|description_space", { spaceName: space.name })}
|
||||
>
|
||||
<JoinRuleSettings
|
||||
room={space}
|
||||
onError={(): void => setError(_t("Failed to update the visibility of this space"))}
|
||||
onError={(): void => setError(_t("room_settings|visibility|error_failed_save"))}
|
||||
closeSettingsFn={closeSettingsFn}
|
||||
/>
|
||||
{advancedSection}
|
||||
|
@ -166,12 +166,12 @@ const SpaceSettingsVisibilityTab: React.FC<IProps> = ({ matrixClient: cli, space
|
|||
);
|
||||
}}
|
||||
disabled={!canSetHistoryVisibility}
|
||||
label={_t("Preview Space")}
|
||||
label={_t("room_settings|visibility|history_visibility_anyone_space")}
|
||||
/>
|
||||
<p>
|
||||
{_t("Allow people to preview your space before they join.")}
|
||||
{_t("room_settings|visibility|history_visibility_anyone_space_description")}
|
||||
<br />
|
||||
<b>{_t("Recommended for public spaces.")}</b>
|
||||
<b>{_t("room_settings|visibility|history_visibility_anyone_space_recommendation")}</b>
|
||||
</p>
|
||||
</div>
|
||||
</SettingsFieldset>
|
||||
|
|
|
@ -95,9 +95,9 @@ export const SpaceButton: React.FC<IButtonProps> = ({
|
|||
|
||||
let notifBadge;
|
||||
if (spaceKey && notificationState) {
|
||||
let ariaLabel = _t("Jump to first unread room.");
|
||||
let ariaLabel = _t("a11y_jump_first_unread_room");
|
||||
if (space?.getMyMembership() === "invite") {
|
||||
ariaLabel = _t("Jump to first invite.");
|
||||
ariaLabel = _t("a11y|jump_first_invite");
|
||||
}
|
||||
|
||||
const jumpToNotification = (ev: MouseEvent): void => {
|
||||
|
@ -371,7 +371,7 @@ export class SpaceItem extends React.PureComponent<IItemProps, IItemState> {
|
|||
className={isInvite ? "mx_SpaceButton_invite" : undefined}
|
||||
selected={selected}
|
||||
label={this.state.name}
|
||||
contextMenuTooltip={_t("Space options")}
|
||||
contextMenuTooltip={_t("space|context_menu|options")}
|
||||
notificationState={notificationState}
|
||||
isNarrow={isPanelCollapsed}
|
||||
size={isNested ? "24px" : "32px"}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue