Migrate more strings to translation keys (#11669)

This commit is contained in:
Michael Telatynski 2023-09-26 13:04:17 +01:00 committed by GitHub
parent 0c6e56ca91
commit 5252361d1e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
112 changed files with 4855 additions and 4542 deletions

View file

@ -131,15 +131,15 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
const roomId = await upgradeRoom(room, targetVersion, opts.invite, true, true, true, (progress) => {
const total = 2 + progress.updateSpacesTotal + progress.inviteUsersTotal;
if (!progress.roomUpgraded) {
fn(_t("Upgrading room"), 0, total);
fn(_t("room_settings|security|join_rule_upgrade_upgrading_room"), 0, total);
} else if (!progress.roomSynced) {
fn(_t("Loading new room"), 1, total);
fn(_t("room_settings|security|join_rule_upgrade_awaiting_room"), 1, total);
} else if (
progress.inviteUsersProgress !== undefined &&
progress.inviteUsersProgress < progress.inviteUsersTotal
) {
fn(
_t("Sending invites... (%(progress)s out of %(count)s)", {
_t("room_settings|security|join_rule_upgrade_sending_invites", {
progress: progress.inviteUsersProgress,
count: progress.inviteUsersTotal,
}),
@ -151,7 +151,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
progress.updateSpacesProgress < progress.updateSpacesTotal
) {
fn(
_t("Updating spaces... (%(progress)s out of %(count)s)", {
_t("room_settings|security|join_rule_upgrade_updating_spaces", {
progress: progress.updateSpacesProgress,
count: progress.updateSpacesTotal,
}),
@ -179,7 +179,11 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
});
};
const upgradeRequiredPill = <span className="mx_JoinRuleSettings_upgradeRequired">{_t("Upgrade required")}</span>;
const upgradeRequiredPill = (
<span className="mx_JoinRuleSettings_upgradeRequired">
{_t("room_settings|security|join_rule_upgrade_required")}
</span>
);
const definitions: IDefinition<JoinRule>[] = [
{
@ -213,11 +217,11 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
let moreText;
if (shownSpaces.length < restrictedAllowRoomIds.length) {
if (shownSpaces.length > 0) {
moreText = _t("& %(count)s more", {
moreText = _t("room_settings|security|join_rule_restricted_n_more", {
count: restrictedAllowRoomIds.length - shownSpaces.length,
});
} else {
moreText = _t("Currently, %(count)s spaces have access", {
moreText = _t("room_settings|security|join_rule_restricted_summary", {
count: restrictedAllowRoomIds.length,
});
}
@ -256,7 +260,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
<div>
<span>
{_t(
"Anyone in a space can find and join. <a>Edit which spaces can access here.</a>",
"room_settings|security|join_rule_restricted_description",
{},
{
a: (sub) => (
@ -273,7 +277,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
</span>
<div className="mx_JoinRuleSettings_spacesWithAccess">
<h4>{_t("Spaces with access")}</h4>
<h4>{_t("room_settings|security|join_rule_restricted_description_spaces")}</h4>
{shownSpaces.map((room) => {
return (
<span key={room.roomId}>
@ -288,21 +292,21 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
);
} else if (SpaceStore.instance.activeSpaceRoom) {
description = _t(
"Anyone in <spaceName/> can find and join. You can select other spaces too.",
"room_settings|security|join_rule_restricted_description_active_space",
{},
{
spaceName: () => <b>{SpaceStore.instance.activeSpaceRoom!.name}</b>,
},
);
} else {
description = _t("Anyone in a space can find and join. You can select multiple spaces.");
description = _t("room_settings|security|join_rule_restricted_description_prompt");
}
definitions.splice(1, 0, {
value: JoinRule.Restricted,
label: (
<>
{_t("Space members")}
{_t("room_settings|security|join_rule_restricted")}
{preferredRestrictionVersion && upgradeRequiredPill}
</>
),
@ -317,20 +321,20 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
value: JoinRule.Knock,
label: (
<>
{_t("Ask to join")}
{_t("room_settings|security|join_rule_knock")}
{preferredKnockVersion && upgradeRequiredPill}
</>
),
description: (
<>
{_t("People cannot join unless access is granted.")}
{_t("room_settings|security|join_rule_knock_description")}
<LabelledCheckbox
className="mx_JoinRuleSettings_labelledCheckbox"
disabled={joinRule !== JoinRule.Knock}
label={
room.isSpaceRoom()
? _t("Make this space visible in the public room directory.")
: _t("Make this room visible in the public room directory.")
? _t("room_settings|security|publish_space")
: _t("room_settings|security|publish_room")
}
onChange={onIsPublicKnockRoomChange}
value={isPublicKnockRoom}
@ -359,21 +363,13 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
(roomId) => !cli.getRoom(roomId)?.currentState.maySendStateEvent(EventType.SpaceChild, userId),
);
if (unableToUpdateSomeParents) {
warning = (
<b>
{_t(
"This room is in some spaces you're not an admin of. In those spaces, the old room will still be shown, but people will be prompted to join the new one.",
)}
</b>
);
warning = <b>{_t("room_settings|security|join_rule_restricted_upgrade_warning")}</b>;
}
upgradeRequiredDialog(
targetVersion,
<>
{_t(
"This upgrade will allow members of selected spaces access to this room without an invite.",
)}
{_t("room_settings|security|join_rule_restricted_upgrade_description")}
{warning}
</>,
);