Migrate more strings to translation keys (#11672)
This commit is contained in:
parent
39c4e0c41f
commit
fa377cbade
81 changed files with 3985 additions and 3766 deletions
|
@ -175,7 +175,7 @@ const SpaceLandingAddButton: React.FC<{ space: Room }> = ({ space }) => {
|
|||
/>
|
||||
{canCreateSpace && (
|
||||
<IconizedContextMenuOption
|
||||
label={_t("Add space")}
|
||||
label={_t("room_list|add_space_label")}
|
||||
iconClassName="mx_RoomList_iconPlus"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
|
|
@ -164,7 +164,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
<IconizedContextMenuCheckbox
|
||||
onClick={(e) => onTagRoom(e, DefaultTagID.LowPriority)}
|
||||
active={isLowPriority}
|
||||
label={_t("Low priority")}
|
||||
label={_t("common|low_priority")}
|
||||
iconClassName="mx_RoomTile_iconArrowDown"
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -387,7 +387,7 @@ const defaultRendererFactory =
|
|||
</div>
|
||||
);
|
||||
|
||||
export const defaultRoomsRenderer = defaultRendererFactory(_td("Rooms"));
|
||||
export const defaultRoomsRenderer = defaultRendererFactory(_td("common|rooms"));
|
||||
export const defaultSpacesRenderer = defaultRendererFactory(_td("common|spaces"));
|
||||
export const defaultDmsRenderer = defaultRendererFactory(_td("Direct Messages"));
|
||||
|
||||
|
|
|
@ -92,7 +92,7 @@ export function RoomResultContextMenus({ room }: Props): JSX.Element {
|
|||
const target = ev.target as HTMLElement;
|
||||
setGeneralMenuPosition(target.getBoundingClientRect());
|
||||
}}
|
||||
title={room.isSpaceRoom() ? _t("space|context_menu|options") : _t("Room options")}
|
||||
title={room.isSpaceRoom() ? _t("space|context_menu|options") : _t("room|context_menu|title")}
|
||||
isExpanded={generalMenuPosition !== null}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -788,7 +788,7 @@ const SpotlightDialog: React.FC<IProps> = ({ initialText = "", initialFilter = n
|
|||
role="group"
|
||||
aria-labelledby="mx_SpotlightDialog_section_rooms"
|
||||
>
|
||||
<h4 id="mx_SpotlightDialog_section_rooms">{_t("Rooms")}</h4>
|
||||
<h4 id="mx_SpotlightDialog_section_rooms">{_t("common|rooms")}</h4>
|
||||
<div>{results[Section.Rooms].slice(0, SECTION_LIMIT).map(resultMapper)}</div>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -212,9 +212,12 @@ const VideoCallButton: FC<VideoCallButtonProps> = ({ room, busy, setBusy, behavi
|
|||
menu = (
|
||||
<IconizedContextMenu {...aboveLeftOf(buttonRect)} onFinished={closeMenu}>
|
||||
<IconizedContextMenuOptionList>
|
||||
<IconizedContextMenuOption label={_t("Video call (Jitsi)")} onClick={onJitsiClick} />
|
||||
<IconizedContextMenuOption
|
||||
label={_t("Video call (%(brand)s)", { brand })}
|
||||
label={_t("room|header|video_call_button_jitsi")}
|
||||
onClick={onJitsiClick}
|
||||
/>
|
||||
<IconizedContextMenuOption
|
||||
label={_t("room|header|video_call_button_ec", { brand })}
|
||||
onClick={onElementClick}
|
||||
/>
|
||||
</IconizedContextMenuOptionList>
|
||||
|
@ -412,13 +415,13 @@ const CallLayoutSelector: FC<CallLayoutSelectorProps> = ({ call }) => {
|
|||
<IconizedContextMenuOptionList>
|
||||
<IconizedContextMenuRadio
|
||||
iconClassName="mx_LegacyRoomHeader_freedomIcon"
|
||||
label={_t("Freedom")}
|
||||
label={_t("room|header|video_call_ec_layout_freedom")}
|
||||
active={layout === Layout.Tile}
|
||||
onClick={onFreedomClick}
|
||||
/>
|
||||
<IconizedContextMenuRadio
|
||||
iconClassName="mx_LegacyRoomHeader_spotlightIcon"
|
||||
label={_t("Spotlight")}
|
||||
label={_t("room|header|video_call_ec_layout_spotlight")}
|
||||
active={layout === Layout.Spotlight}
|
||||
onClick={onSpotlightClick}
|
||||
/>
|
||||
|
@ -436,7 +439,7 @@ const CallLayoutSelector: FC<CallLayoutSelectorProps> = ({ call }) => {
|
|||
"mx_LegacyRoomHeader_layoutButton--spotlight": layout === Layout.Spotlight,
|
||||
})}
|
||||
onClick={onClick}
|
||||
title={_t("Change layout")}
|
||||
title={_t("room|header|video_call_ec_change_layout")}
|
||||
alignment={Alignment.Bottom}
|
||||
key="layout"
|
||||
/>
|
||||
|
@ -589,7 +592,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
|
|||
<AccessibleTooltipButton
|
||||
className="mx_LegacyRoomHeader_button mx_LegacyRoomHeader_forgetButton"
|
||||
onClick={this.props.onForgetClick}
|
||||
title={_t("Forget room")}
|
||||
title={_t("room|header|forget_room_button")}
|
||||
alignment={Alignment.Bottom}
|
||||
key="forget"
|
||||
/>,
|
||||
|
@ -603,7 +606,11 @@ export default class RoomHeader extends React.Component<IProps, IState> {
|
|||
mx_LegacyRoomHeader_appsButton_highlight: this.props.appsShown,
|
||||
})}
|
||||
onClick={this.props.onAppsClick}
|
||||
title={this.props.appsShown ? _t("Hide Widgets") : _t("Show Widgets")}
|
||||
title={
|
||||
this.props.appsShown
|
||||
? _t("room|header|hide_widgets_button")
|
||||
: _t("room|header|show_widgets_button")
|
||||
}
|
||||
aria-checked={this.props.appsShown}
|
||||
alignment={Alignment.Bottom}
|
||||
key="apps"
|
||||
|
@ -643,7 +650,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
|
|||
<AccessibleButton
|
||||
className="mx_LegacyRoomHeader_button mx_LegacyRoomHeader_closeButton"
|
||||
onClick={this.onHideCallClick}
|
||||
title={_t("Close call")}
|
||||
title={_t("room|header|close_call_button")}
|
||||
key="close"
|
||||
/>,
|
||||
);
|
||||
|
@ -652,7 +659,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
|
|||
<AccessibleTooltipButton
|
||||
className="mx_LegacyRoomHeader_button mx_LegacyRoomHeader_minimiseButton"
|
||||
onClick={this.onHideCallClick}
|
||||
title={_t("View chat timeline")}
|
||||
title={_t("room|header|video_room_view_chat_button")}
|
||||
alignment={Alignment.Bottom}
|
||||
key="minimise"
|
||||
/>,
|
||||
|
@ -718,7 +725,7 @@ export default class RoomHeader extends React.Component<IProps, IState> {
|
|||
className="mx_LegacyRoomHeader_name"
|
||||
onClick={this.onContextMenuOpenClick}
|
||||
isExpanded={!!this.state.contextMenuPosition}
|
||||
title={_t("Room options")}
|
||||
title={_t("room|context_menu|title")}
|
||||
alignment={Alignment.Bottom}
|
||||
>
|
||||
{roomName}
|
||||
|
|
|
@ -371,7 +371,7 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
className="mx_MemberList_invite"
|
||||
onClick={null}
|
||||
disabled
|
||||
tooltip={_t("You do not have permission to invite users")}
|
||||
tooltip={_t("member_list|invite_button_no_perms_tooltip")}
|
||||
>
|
||||
<span>{inviteButtonText}</span>
|
||||
</AccessibleTooltipButton>
|
||||
|
@ -382,7 +382,7 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
let invitedHeader;
|
||||
let invitedSection;
|
||||
if (this.getChildCountInvited() > 0) {
|
||||
invitedHeader = <h2>{_t("Invited")}</h2>;
|
||||
invitedHeader = <h2>{_t("member_list|invited_list_heading")}</h2>;
|
||||
invitedSection = (
|
||||
<TruncatedList
|
||||
className="mx_MemberList_section mx_MemberList_invited"
|
||||
|
@ -397,7 +397,7 @@ export default class MemberList extends React.Component<IProps, IState> {
|
|||
const footer = (
|
||||
<SearchBox
|
||||
className="mx_MemberList_query mx_textinput_icon mx_textinput_search"
|
||||
placeholder={_t("Filter room members")}
|
||||
placeholder={_t("member_list|filter_placeholder")}
|
||||
onSearch={this.onSearchQueryChanged}
|
||||
initialValue={this.props.searchQuery}
|
||||
/>
|
||||
|
|
|
@ -173,7 +173,7 @@ export default class MemberTile extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
private getPowerLabel(): string {
|
||||
return _t("%(userName)s (power %(powerLevelNumber)s)", {
|
||||
return _t("member_list|power_label", {
|
||||
userName: UserIdentifierCustomisations.getDisplayUserIdentifier(this.props.member.userId, {
|
||||
roomId: this.props.member.roomId,
|
||||
}),
|
||||
|
|
|
@ -535,7 +535,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
|
|||
className="mx_MessageComposer_roomReplaced_link"
|
||||
onClick={this.onTombstoneClick}
|
||||
>
|
||||
{_t("The conversation continues here.")}
|
||||
{_t("composer|room_upgraded_link")}
|
||||
</a>
|
||||
) : (
|
||||
""
|
||||
|
@ -551,7 +551,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
|
|||
src={require("../../../../res/img/room_replaced.svg").default}
|
||||
/>
|
||||
<span className="mx_MessageComposer_roomReplaced_header">
|
||||
{_t("This room has been replaced and is no longer active.")}
|
||||
{_t("composer|room_upgraded_notice")}
|
||||
</span>
|
||||
<br />
|
||||
{continuesLink}
|
||||
|
@ -561,7 +561,7 @@ export class MessageComposer extends React.Component<IProps, IState> {
|
|||
} else {
|
||||
controls.push(
|
||||
<div key="controls_error" className="mx_MessageComposer_noperm_error">
|
||||
{_t("You do not have permission to post to this room")}
|
||||
{_t("composer|no_perms_notice")}
|
||||
</div>,
|
||||
);
|
||||
}
|
||||
|
@ -649,7 +649,9 @@ export class MessageComposer extends React.Component<IProps, IState> {
|
|||
<SendButton
|
||||
key="controls_send"
|
||||
onClick={this.sendMessage}
|
||||
title={this.state.haveRecording ? _t("Send voice message") : undefined}
|
||||
title={
|
||||
this.state.haveRecording ? _t("composer|send_button_voice_message") : undefined
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
|
|
@ -258,7 +258,7 @@ function showStickersButton(props: IProps): ReactElement | null {
|
|||
className="mx_MessageComposer_button"
|
||||
iconClassName="mx_MessageComposer_stickers"
|
||||
onClick={() => props.setStickerPickerOpen(!props.isStickerPickerOpen)}
|
||||
title={props.isStickerPickerOpen ? _t("Hide stickers") : _t("common|sticker")}
|
||||
title={props.isStickerPickerOpen ? _t("composer|close_sticker_picker") : _t("common|sticker")}
|
||||
/>
|
||||
) : null;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@ function voiceRecordingButton(props: IProps, narrow: boolean): ReactElement | nu
|
|||
className="mx_MessageComposer_button"
|
||||
iconClassName="mx_MessageComposer_voiceMessage"
|
||||
onClick={props.onRecordStartEndClick}
|
||||
title={_t("Voice Message")}
|
||||
title={_t("composer|voice_message_button")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -309,8 +309,8 @@ class PollButton extends React.PureComponent<IPollButtonProps> {
|
|||
);
|
||||
if (!canSend) {
|
||||
Modal.createDialog(ErrorDialog, {
|
||||
title: _t("Permission Required"),
|
||||
description: _t("You do not have permission to start polls in this room."),
|
||||
title: _t("composer|poll_button_no_perms_title"),
|
||||
description: _t("composer|poll_button_no_perms_description"),
|
||||
});
|
||||
} else {
|
||||
const threadId =
|
||||
|
@ -338,7 +338,7 @@ class PollButton extends React.PureComponent<IPollButtonProps> {
|
|||
className="mx_MessageComposer_button"
|
||||
iconClassName="mx_MessageComposer_poll"
|
||||
onClick={this.onCreateClick}
|
||||
title={_t("Poll")}
|
||||
title={_t("composer|poll_button")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -364,7 +364,7 @@ interface WysiwygToggleButtonProps {
|
|||
}
|
||||
|
||||
function ComposerModeButton({ isRichTextEnabled, onClick }: WysiwygToggleButtonProps): JSX.Element {
|
||||
const title = isRichTextEnabled ? _t("Hide formatting") : _t("Show formatting");
|
||||
const title = isRichTextEnabled ? _t("composer|mode_plain") : _t("composer|mode_rich_text");
|
||||
|
||||
return (
|
||||
<CollapsibleButton
|
||||
|
|
|
@ -52,7 +52,7 @@ export default class MessageComposerFormatBar extends React.PureComponent<IProps
|
|||
mx_MessageComposerFormatBar_shown: this.state.visible,
|
||||
});
|
||||
return (
|
||||
<Toolbar className={classes} ref={this.formatBarRef} aria-label={_t("Formatting")}>
|
||||
<Toolbar className={classes} ref={this.formatBarRef} aria-label={_t("composer|formatting_toolbar_label")}>
|
||||
<FormatButton
|
||||
label={_t("composer|format_bold")}
|
||||
onClick={() => this.props.onAction(Formatting.Bold)}
|
||||
|
@ -61,7 +61,7 @@ export default class MessageComposerFormatBar extends React.PureComponent<IProps
|
|||
visible={this.state.visible}
|
||||
/>
|
||||
<FormatButton
|
||||
label={_t("Italics")}
|
||||
label={_t("composer|format_italics")}
|
||||
onClick={() => this.props.onAction(Formatting.Italics)}
|
||||
icon="Italic"
|
||||
shortcut={this.props.shortcuts.italics}
|
||||
|
@ -88,7 +88,7 @@ export default class MessageComposerFormatBar extends React.PureComponent<IProps
|
|||
visible={this.state.visible}
|
||||
/>
|
||||
<FormatButton
|
||||
label={_t("Insert link")}
|
||||
label={_t("composer|format_insert_link")}
|
||||
onClick={() => this.props.onAction(Formatting.InsertLink)}
|
||||
icon="InsertLink"
|
||||
shortcut={this.props.shortcuts.insert_link}
|
||||
|
|
|
@ -122,7 +122,7 @@ export default class NotificationBadge extends React.PureComponent<XOR<IProps, I
|
|||
let label: string | undefined;
|
||||
let tooltip: JSX.Element | undefined;
|
||||
if (showUnsentTooltip && this.state.showTooltip && notification.color === NotificationColor.Unsent) {
|
||||
label = _t("Message didn't send. Click for info.");
|
||||
label = _t("notifications|message_didnt_send");
|
||||
tooltip = <Tooltip className="mx_NotificationBadge_tooltip" label={label} />;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,9 @@ export function ReadReceiptGroup({
|
|||
const [{ showTooltip, hideTooltip }, tooltip] = useTooltip({
|
||||
label: (
|
||||
<>
|
||||
<div className="mx_Tooltip_title">{_t("Seen by %(count)s people", { count: readReceipts.length })}</div>
|
||||
<div className="mx_Tooltip_title">
|
||||
{_t("timeline|read_receipt_title", { count: readReceipts.length })}
|
||||
</div>
|
||||
<div className="mx_Tooltip_sub">{tooltipText}</div>
|
||||
</>
|
||||
),
|
||||
|
@ -176,7 +178,7 @@ export function ReadReceiptGroup({
|
|||
<ContextMenu menuClassName="mx_ReadReceiptGroup_popup" onFinished={closeMenu} {...aboveLeftOf(buttonRect)}>
|
||||
<AutoHideScrollbar>
|
||||
<SectionHeader className="mx_ReadReceiptGroup_title">
|
||||
{_t("Seen by %(count)s people", { count: readReceipts.length })}
|
||||
{_t("timeline|read_receipt_title", { count: readReceipts.length })}
|
||||
</SectionHeader>
|
||||
{readReceipts.map((receipt) => (
|
||||
<ReadReceiptPerson
|
||||
|
@ -193,7 +195,7 @@ export function ReadReceiptGroup({
|
|||
|
||||
return (
|
||||
<div className="mx_EventTile_msgOption">
|
||||
<div className="mx_ReadReceiptGroup" role="group" aria-label={_t("Read receipts")}>
|
||||
<div className="mx_ReadReceiptGroup" role="group" aria-label={_t("timeline|read_receipts_label")}>
|
||||
<AccessibleButton
|
||||
className="mx_ReadReceiptGroup_button"
|
||||
inputRef={button}
|
||||
|
|
|
@ -47,7 +47,7 @@ export default class ReplyPreview extends React.Component<IProps> {
|
|||
<div className="mx_ReplyPreview">
|
||||
<div className="mx_ReplyPreview_section">
|
||||
<div className="mx_ReplyPreview_header">
|
||||
<span>{_t("Replying")}</span>
|
||||
<span>{_t("composer|replying_title")}</span>
|
||||
<AccessibleButton
|
||||
className="mx_ReplyPreview_header_cancel"
|
||||
onClick={() => cancelQuoting(this.context.timelineRenderingType)}
|
||||
|
|
|
@ -81,7 +81,6 @@ interface IState {
|
|||
|
||||
export const TAG_ORDER: TagID[] = [
|
||||
DefaultTagID.Invite,
|
||||
DefaultTagID.SavedItems,
|
||||
DefaultTagID.Favourite,
|
||||
DefaultTagID.DM,
|
||||
DefaultTagID.Untagged,
|
||||
|
@ -357,8 +356,8 @@ const UntaggedAuxButton: React.FC<IAuxButtonProps> = ({ tabIndex }) => {
|
|||
onClick={openMenu}
|
||||
className="mx_RoomSublist_auxButton"
|
||||
tooltipClassName="mx_RoomSublist_addRoomTooltip"
|
||||
aria-label={_t("Add room")}
|
||||
title={_t("Add room")}
|
||||
aria-label={_t("room_list|add_room_label")}
|
||||
title={_t("room_list|add_room_label")}
|
||||
isExpanded={menuDisplayed}
|
||||
inputRef={handle}
|
||||
/>
|
||||
|
@ -382,11 +381,6 @@ const TAG_AESTHETICS: TagAestheticsMap = {
|
|||
isInvite: false,
|
||||
defaultHidden: false,
|
||||
},
|
||||
[DefaultTagID.SavedItems]: {
|
||||
sectionLabel: _td("Saved Items"),
|
||||
isInvite: false,
|
||||
defaultHidden: false,
|
||||
},
|
||||
[DefaultTagID.DM]: {
|
||||
sectionLabel: _td("common|people"),
|
||||
isInvite: false,
|
||||
|
@ -394,13 +388,13 @@ const TAG_AESTHETICS: TagAestheticsMap = {
|
|||
AuxButtonComponent: DmAuxButton,
|
||||
},
|
||||
[DefaultTagID.Untagged]: {
|
||||
sectionLabel: _td("Rooms"),
|
||||
sectionLabel: _td("common|rooms"),
|
||||
isInvite: false,
|
||||
defaultHidden: false,
|
||||
AuxButtonComponent: UntaggedAuxButton,
|
||||
},
|
||||
[DefaultTagID.LowPriority]: {
|
||||
sectionLabel: _td("Low priority"),
|
||||
sectionLabel: _td("common|low_priority"),
|
||||
isInvite: false,
|
||||
defaultHidden: false,
|
||||
},
|
||||
|
@ -412,13 +406,13 @@ const TAG_AESTHETICS: TagAestheticsMap = {
|
|||
|
||||
// TODO: Replace with archived view: https://github.com/vector-im/element-web/issues/14038
|
||||
[DefaultTagID.Archived]: {
|
||||
sectionLabel: _td("Historical"),
|
||||
sectionLabel: _td("common|historical"),
|
||||
isInvite: false,
|
||||
defaultHidden: true,
|
||||
},
|
||||
|
||||
[DefaultTagID.Suggested]: {
|
||||
sectionLabel: _td("Suggested Rooms"),
|
||||
sectionLabel: _td("room_list|suggested_rooms_heading"),
|
||||
isInvite: false,
|
||||
defaultHidden: false,
|
||||
},
|
||||
|
@ -654,7 +648,7 @@ export default class RoomList extends React.PureComponent<IProps, IState> {
|
|||
onKeyDown={onKeyDownHandler}
|
||||
className="mx_RoomList"
|
||||
role="tree"
|
||||
aria-label={_t("Rooms")}
|
||||
aria-label={_t("common|rooms")}
|
||||
ref={this.treeRef}
|
||||
>
|
||||
{sublists}
|
||||
|
|
|
@ -271,7 +271,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
|
|||
/>
|
||||
{canCreateSpaces && (
|
||||
<IconizedContextMenuOption
|
||||
label={_t("Add space")}
|
||||
label={_t("room_list|add_space_label")}
|
||||
iconClassName="mx_RoomListHeader_iconPlus"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
@ -340,7 +340,7 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
|
|||
if (canExploreRooms) {
|
||||
joinRoomOpt = (
|
||||
<IconizedContextMenuOption
|
||||
label={_t("Join public room")}
|
||||
label={_t("room_list|join_public_room_label")}
|
||||
iconClassName="mx_RoomListHeader_iconExplore"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
|
@ -379,9 +379,9 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
|
|||
.map(([type, keys]) => {
|
||||
switch (type) {
|
||||
case PendingActionType.JoinRoom:
|
||||
return _t("Currently joining %(count)s rooms", { count: keys.size });
|
||||
return _t("room_list|joining_rooms_status", { count: keys.size });
|
||||
case PendingActionType.BulkRedact:
|
||||
return _t("Currently removing messages in %(count)s rooms", { count: keys.size });
|
||||
return _t("room_list|redacting_messages_status", { count: keys.size });
|
||||
}
|
||||
})
|
||||
.join("\n");
|
||||
|
@ -400,11 +400,11 @@ const RoomListHeader: React.FC<IProps> = ({ onVisibilityChange }) => {
|
|||
contextMenuButton = (
|
||||
<ContextMenuButton
|
||||
{...commonProps}
|
||||
label={_t("%(spaceName)s menu", { spaceName: spaceName ?? activeSpace.name })}
|
||||
label={_t("room_list|space_menu_label", { spaceName: spaceName ?? activeSpace.name })}
|
||||
/>
|
||||
);
|
||||
} else {
|
||||
contextMenuButton = <ContextMenuTooltipButton {...commonProps} title={_t("Home options")} />;
|
||||
contextMenuButton = <ContextMenuTooltipButton {...commonProps} title={_t("room_list|home_menu_label")} />;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
identityAccessToken!,
|
||||
);
|
||||
if (!("mxid" in result)) {
|
||||
throw new UserFriendlyError("Unable to find user by email");
|
||||
throw new UserFriendlyError("room|error_3pid_invite_email_lookup");
|
||||
}
|
||||
this.setState({ invitedEmailMxid: result.mxid });
|
||||
} catch (err) {
|
||||
|
@ -329,9 +329,9 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
switch (messageCase) {
|
||||
case MessageCase.Joining: {
|
||||
if (this.props.oobData?.roomType || isSpace) {
|
||||
title = isSpace ? _t("Joining space…") : _t("Joining room…");
|
||||
title = isSpace ? _t("room|joining_space") : _t("room|joining_room");
|
||||
} else {
|
||||
title = _t("Joining…");
|
||||
title = _t("room|joining");
|
||||
}
|
||||
|
||||
showSpinner = true;
|
||||
|
@ -343,7 +343,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
break;
|
||||
}
|
||||
case MessageCase.Rejecting: {
|
||||
title = _t("Rejecting invite…");
|
||||
title = _t("room|rejecting");
|
||||
showSpinner = true;
|
||||
break;
|
||||
}
|
||||
|
@ -353,15 +353,15 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
ModuleRunner.instance.invoke(RoomViewLifecycle.PreviewRoomNotLoggedIn, opts, this.props.roomId);
|
||||
}
|
||||
if (opts.canJoin) {
|
||||
title = _t("Join the room to participate");
|
||||
title = _t("room|join_title");
|
||||
primaryActionLabel = _t("action|join");
|
||||
primaryActionHandler = () => {
|
||||
ModuleRunner.instance.invoke(RoomViewLifecycle.JoinFromRoomPreview, this.props.roomId);
|
||||
};
|
||||
} else {
|
||||
title = _t("Join the conversation with an account");
|
||||
title = _t("room|join_title_account");
|
||||
if (SettingsStore.getValue(UIFeature.Registration)) {
|
||||
primaryActionLabel = _t("Sign Up");
|
||||
primaryActionLabel = _t("room|join_button_account");
|
||||
primaryActionHandler = this.onRegisterClick;
|
||||
}
|
||||
secondaryActionLabel = _t("action|sign_in");
|
||||
|
@ -371,7 +371,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
footer = (
|
||||
<div>
|
||||
<Spinner w={20} h={20} />
|
||||
{_t("Loading preview")}
|
||||
{_t("room|loading_preview")}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
@ -380,16 +380,16 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
case MessageCase.Kicked: {
|
||||
const { memberName, reason } = this.getKickOrBanInfo();
|
||||
if (roomName) {
|
||||
title = _t("You were removed from %(roomName)s by %(memberName)s", { memberName, roomName });
|
||||
title = _t("room|kicked_from_room_by", { memberName, roomName });
|
||||
} else {
|
||||
title = _t("You were removed by %(memberName)s", { memberName });
|
||||
title = _t("room|kicked_by", { memberName });
|
||||
}
|
||||
subTitle = reason ? _t("Reason: %(reason)s", { reason }) : undefined;
|
||||
subTitle = reason ? _t("room|kick_reason", { reason }) : undefined;
|
||||
|
||||
if (isSpace) {
|
||||
primaryActionLabel = _t("Forget this space");
|
||||
primaryActionLabel = _t("room|forget_space");
|
||||
} else {
|
||||
primaryActionLabel = _t("Forget this room");
|
||||
primaryActionLabel = _t("room|forget_room");
|
||||
}
|
||||
primaryActionHandler = this.props.onForgetClick;
|
||||
|
||||
|
@ -397,22 +397,20 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
secondaryActionLabel = primaryActionLabel;
|
||||
secondaryActionHandler = primaryActionHandler;
|
||||
|
||||
primaryActionLabel = _t("Re-join");
|
||||
primaryActionLabel = _t("room|rejoin_button");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case MessageCase.RequestDenied: {
|
||||
title = _t("You have been denied access");
|
||||
title = _t("room|knock_denied_title");
|
||||
|
||||
subTitle = _t(
|
||||
"As you have been denied access, you cannot rejoin unless you are invited by the admin or moderator of the group.",
|
||||
);
|
||||
subTitle = _t("room|knock_denied_subtitle");
|
||||
|
||||
if (isSpace) {
|
||||
primaryActionLabel = _t("Forget this space");
|
||||
primaryActionLabel = _t("room|forget_space");
|
||||
} else {
|
||||
primaryActionLabel = _t("Forget this room");
|
||||
primaryActionLabel = _t("room|forget_room");
|
||||
}
|
||||
primaryActionHandler = this.props.onForgetClick;
|
||||
break;
|
||||
|
@ -420,44 +418,43 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
case MessageCase.Banned: {
|
||||
const { memberName, reason } = this.getKickOrBanInfo();
|
||||
if (roomName) {
|
||||
title = _t("You were banned from %(roomName)s by %(memberName)s", { memberName, roomName });
|
||||
title = _t("room|banned_from_room_by", { memberName, roomName });
|
||||
} else {
|
||||
title = _t("You were banned by %(memberName)s", { memberName });
|
||||
title = _t("room|banned_by", { memberName });
|
||||
}
|
||||
subTitle = reason ? _t("Reason: %(reason)s", { reason }) : undefined;
|
||||
subTitle = reason ? _t("room|kick_reason", { reason }) : undefined;
|
||||
if (isSpace) {
|
||||
primaryActionLabel = _t("Forget this space");
|
||||
primaryActionLabel = _t("room|forget_space");
|
||||
} else {
|
||||
primaryActionLabel = _t("Forget this room");
|
||||
primaryActionLabel = _t("room|forget_room");
|
||||
}
|
||||
primaryActionHandler = this.props.onForgetClick;
|
||||
break;
|
||||
}
|
||||
case MessageCase.OtherThreePIDError: {
|
||||
if (roomName) {
|
||||
title = _t("Something went wrong with your invite to %(roomName)s", { roomName });
|
||||
title = _t("room|3pid_invite_error_title_room", { roomName });
|
||||
} else {
|
||||
title = _t("Something went wrong with your invite.");
|
||||
title = _t("room|3pid_invite_error_title");
|
||||
}
|
||||
const joinRule = this.joinRule();
|
||||
const errCodeMessage = _t(
|
||||
"An error (%(errcode)s) was returned while trying to validate your invite. You could try to pass this information on to the person who invited you.",
|
||||
{ errcode: this.state.threePidFetchError?.errcode || _t("unknown error code") },
|
||||
);
|
||||
const errCodeMessage = _t("room|3pid_invite_error_description", {
|
||||
errcode: this.state.threePidFetchError?.errcode || _t("unknown error code"),
|
||||
});
|
||||
switch (joinRule) {
|
||||
case "invite":
|
||||
subTitle = [_t("You can only join it with a working invite."), errCodeMessage];
|
||||
primaryActionLabel = _t("Try to join anyway");
|
||||
subTitle = [_t("room|3pid_invite_error_invite_subtitle"), errCodeMessage];
|
||||
primaryActionLabel = _t("room|3pid_invite_error_invite_action");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
case "public":
|
||||
subTitle = _t("You can still join here.");
|
||||
primaryActionLabel = _t("Join the discussion");
|
||||
subTitle = _t("room|3pid_invite_error_public_subtitle");
|
||||
primaryActionLabel = _t("room|join_the_discussion");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
default:
|
||||
subTitle = errCodeMessage;
|
||||
primaryActionLabel = _t("Try to join anyway");
|
||||
primaryActionLabel = _t("room|3pid_invite_error_invite_action");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
}
|
||||
|
@ -465,56 +462,50 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
}
|
||||
case MessageCase.InvitedEmailNotFoundInAccount: {
|
||||
if (roomName) {
|
||||
title = _t(
|
||||
"This invite to %(roomName)s was sent to %(email)s which is not associated with your account",
|
||||
{
|
||||
roomName,
|
||||
email: this.props.invitedEmail,
|
||||
},
|
||||
);
|
||||
title = _t("room|3pid_invite_email_not_found_account_room", {
|
||||
roomName,
|
||||
email: this.props.invitedEmail,
|
||||
});
|
||||
} else {
|
||||
title = _t("This invite was sent to %(email)s which is not associated with your account", {
|
||||
title = _t("room|3pid_invite_email_not_found_account", {
|
||||
email: this.props.invitedEmail,
|
||||
});
|
||||
}
|
||||
|
||||
subTitle = _t(
|
||||
"Link this email with your account in Settings to receive invites directly in %(brand)s.",
|
||||
{ brand },
|
||||
);
|
||||
primaryActionLabel = _t("Join the discussion");
|
||||
subTitle = _t("room|link_email_to_receive_3pid_invite", { brand });
|
||||
primaryActionLabel = _t("room|join_the_discussion");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
}
|
||||
case MessageCase.InvitedEmailNoIdentityServer: {
|
||||
if (roomName) {
|
||||
title = _t("This invite to %(roomName)s was sent to %(email)s", {
|
||||
title = _t("room|invite_sent_to_email_room", {
|
||||
roomName,
|
||||
email: this.props.invitedEmail,
|
||||
});
|
||||
} else {
|
||||
title = _t("This invite was sent to %(email)s", { email: this.props.invitedEmail });
|
||||
title = _t("room|invite_sent_to_email", { email: this.props.invitedEmail });
|
||||
}
|
||||
|
||||
subTitle = _t("Use an identity server in Settings to receive invites directly in %(brand)s.", {
|
||||
subTitle = _t("room|3pid_invite_no_is_subtitle", {
|
||||
brand,
|
||||
});
|
||||
primaryActionLabel = _t("Join the discussion");
|
||||
primaryActionLabel = _t("room|join_the_discussion");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
}
|
||||
case MessageCase.InvitedEmailMismatch: {
|
||||
if (roomName) {
|
||||
title = _t("This invite to %(roomName)s was sent to %(email)s", {
|
||||
title = _t("room|invite_sent_to_email_room", {
|
||||
roomName,
|
||||
email: this.props.invitedEmail,
|
||||
});
|
||||
} else {
|
||||
title = _t("This invite was sent to %(email)s", { email: this.props.invitedEmail });
|
||||
title = _t("room|invite_sent_to_email", { email: this.props.invitedEmail });
|
||||
}
|
||||
|
||||
subTitle = _t("Share this email in Settings to receive invites directly in %(brand)s.", { brand });
|
||||
primaryActionLabel = _t("Join the discussion");
|
||||
subTitle = _t("room|invite_email_mismatch_suggestion", { brand });
|
||||
primaryActionLabel = _t("room|join_the_discussion");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
}
|
||||
|
@ -536,14 +527,14 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
|
||||
const isDM = this.isDMInvite();
|
||||
if (isDM) {
|
||||
title = _t("Do you want to chat with %(user)s?", {
|
||||
title = _t("room|dm_invite_title", {
|
||||
user: inviteMember?.name ?? this.props.inviterName,
|
||||
});
|
||||
subTitle = [avatar, _t("<userName/> wants to chat", {}, { userName: () => inviterElement })];
|
||||
primaryActionLabel = _t("Start chatting");
|
||||
subTitle = [avatar, _t("room|dm_invite_subtitle", {}, { userName: () => inviterElement })];
|
||||
primaryActionLabel = _t("room|dm_invite_action");
|
||||
} else {
|
||||
title = _t("Do you want to join %(roomName)s?", { roomName });
|
||||
subTitle = [avatar, _t("<userName/> invited you", {}, { userName: () => inviterElement })];
|
||||
title = _t("room|invite_title", { roomName });
|
||||
subTitle = [avatar, _t("room|invite_subtitle", {}, { userName: () => inviterElement })];
|
||||
primaryActionLabel = _t("action|accept");
|
||||
}
|
||||
|
||||
|
@ -567,7 +558,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
if (this.props.onRejectAndIgnoreClick) {
|
||||
extraComponents.push(
|
||||
<AccessibleButton kind="secondary" onClick={this.props.onRejectAndIgnoreClick} key="ignore">
|
||||
{_t("Reject & Ignore user")}
|
||||
{_t("room|invite_reject_ignore")}
|
||||
</AccessibleButton>,
|
||||
);
|
||||
}
|
||||
|
@ -575,35 +566,35 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
}
|
||||
case MessageCase.ViewingRoom: {
|
||||
if (this.props.canPreview) {
|
||||
title = _t("You're previewing %(roomName)s. Want to join it?", { roomName });
|
||||
title = _t("room|peek_join_prompt", { roomName });
|
||||
} else if (roomName) {
|
||||
title = _t("%(roomName)s can't be previewed. Do you want to join it?", { roomName });
|
||||
title = _t("room|no_peek_join_prompt", { roomName });
|
||||
} else {
|
||||
title = _t("There's no preview, would you like to join?");
|
||||
title = _t("room|no_peek_no_name_join_prompt");
|
||||
}
|
||||
primaryActionLabel = _t("Join the discussion");
|
||||
primaryActionLabel = _t("room|join_the_discussion");
|
||||
primaryActionHandler = this.props.onJoinClick;
|
||||
break;
|
||||
}
|
||||
case MessageCase.RoomNotFound: {
|
||||
if (roomName) {
|
||||
title = _t("%(roomName)s does not exist.", { roomName });
|
||||
title = _t("room|not_found_title_name", { roomName });
|
||||
} else {
|
||||
title = _t("This room or space does not exist.");
|
||||
title = _t("room|not_found_title");
|
||||
}
|
||||
subTitle = _t("Are you sure you're at the right place?");
|
||||
subTitle = _t("room|not_found_subtitle");
|
||||
break;
|
||||
}
|
||||
case MessageCase.OtherError: {
|
||||
if (roomName) {
|
||||
title = _t("%(roomName)s is not accessible at this time.", { roomName });
|
||||
title = _t("room|inaccessible_name", { roomName });
|
||||
} else {
|
||||
title = _t("This room or space is not accessible at this time.");
|
||||
title = _t("room|inaccessible");
|
||||
}
|
||||
subTitle = [
|
||||
_t("Try again later, or ask a room or space admin to check if you have access."),
|
||||
_t("room|inaccessible_subtitle_1"),
|
||||
_t(
|
||||
"%(errcode)s was returned while trying to access the room or space. If you think you're seeing this message in error, please <issueLink>submit a bug report</issueLink>.",
|
||||
"room|inaccessible_subtitle_2",
|
||||
{ errcode: String(this.props.error?.errcode) },
|
||||
{
|
||||
issueLink: (label) => (
|
||||
|
@ -622,18 +613,13 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
}
|
||||
case MessageCase.PromptAskToJoin: {
|
||||
if (roomName) {
|
||||
title = _t("Ask to join %(roomName)s?", { roomName });
|
||||
title = _t("room|knock_prompt_name", { roomName });
|
||||
} else {
|
||||
title = _t("Ask to join?");
|
||||
title = _t("room|knock_prompt");
|
||||
}
|
||||
|
||||
const avatar = <RoomAvatar room={this.props.room} oobData={this.props.oobData} />;
|
||||
subTitle = [
|
||||
avatar,
|
||||
_t(
|
||||
"You need to be granted access to this room in order to view or participate in the conversation. You can send a request to join below.",
|
||||
),
|
||||
];
|
||||
subTitle = [avatar, _t("room|knock_subtitle")];
|
||||
|
||||
reasonElement = (
|
||||
<Field
|
||||
|
@ -641,7 +627,7 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
className="mx_RoomPreviewBar_fullWidth"
|
||||
element="textarea"
|
||||
onChange={this.onChangeReason}
|
||||
placeholder={_t("Message (optional)")}
|
||||
placeholder={_t("room|knock_message_field_placeholder")}
|
||||
type="text"
|
||||
value={this.state.reason ?? ""}
|
||||
/>
|
||||
|
@ -649,22 +635,22 @@ export default class RoomPreviewBar extends React.Component<IProps, IState> {
|
|||
|
||||
primaryActionHandler = () =>
|
||||
this.props.onSubmitAskToJoin && this.props.onSubmitAskToJoin(this.state.reason);
|
||||
primaryActionLabel = _t("Request access");
|
||||
primaryActionLabel = _t("room|knock_send_action");
|
||||
|
||||
break;
|
||||
}
|
||||
case MessageCase.Knocked: {
|
||||
title = _t("Request to join sent");
|
||||
title = _t("room|knock_sent");
|
||||
|
||||
subTitle = [
|
||||
<>
|
||||
<AskToJoinIcon className="mx_Icon mx_Icon_16 mx_RoomPreviewBar_icon" />
|
||||
{_t("Your request to join is pending.")}
|
||||
{_t("room|knock_sent_subtitle")}
|
||||
</>,
|
||||
];
|
||||
|
||||
secondaryActionHandler = this.props.onCancelAskToJoin;
|
||||
secondaryActionLabel = _t("Cancel request");
|
||||
secondaryActionLabel = _t("room|knock_cancel_action");
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -173,14 +173,14 @@ const RoomPreviewCard: FC<IProps> = ({ room, onJoinButtonClicked, onRejectButton
|
|||
|
||||
let notice: string | null = null;
|
||||
if (cannotJoin) {
|
||||
notice = _t("To view %(roomName)s, you need an invite", {
|
||||
notice = _t("room|join_failed_needs_invite", {
|
||||
roomName: room.name,
|
||||
});
|
||||
} else if (isVideoRoom && !videoRoomsEnabled) {
|
||||
notice =
|
||||
myMembership === "join"
|
||||
? _t("To view, please enable video rooms in Labs first")
|
||||
: _t("To join, please enable video rooms in Labs first");
|
||||
? _t("room|view_failed_enable_video_rooms")
|
||||
: _t("room|join_failed_enable_video_rooms");
|
||||
|
||||
joinButtons = (
|
||||
<AccessibleButton kind="primary" onClick={viewLabs}>
|
||||
|
|
|
@ -559,7 +559,7 @@ export default class RoomSublist extends React.Component<IProps, IState> {
|
|||
}
|
||||
|
||||
private renderMenu(): ReactNode {
|
||||
if (this.props.tagId === DefaultTagID.Suggested || this.props.tagId === DefaultTagID.SavedItems) return null; // not sortable
|
||||
if (this.props.tagId === DefaultTagID.Suggested) return null; // not sortable
|
||||
|
||||
let contextMenu: JSX.Element | undefined;
|
||||
if (this.state.contextMenuPosition) {
|
||||
|
|
|
@ -342,7 +342,7 @@ export class RoomTile extends React.PureComponent<ClassProps, State> {
|
|||
<ContextMenuTooltipButton
|
||||
className="mx_RoomTile_menuButton"
|
||||
onClick={this.onGeneralMenuOpenClick}
|
||||
title={_t("Room options")}
|
||||
title={_t("room|context_menu|title")}
|
||||
isExpanded={!!this.state.generalMenuPosition}
|
||||
/>
|
||||
{this.state.generalMenuPosition && (
|
||||
|
|
|
@ -36,7 +36,7 @@ export const RoomTileCallSummary: FC<Props> = ({ call }) => {
|
|||
active = false;
|
||||
break;
|
||||
case ConnectionState.Connecting:
|
||||
text = _t("Joining…");
|
||||
text = _t("room|joining");
|
||||
active = true;
|
||||
break;
|
||||
case ConnectionState.Connected:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue