Migrate more strings to translation keys (#11665)
This commit is contained in:
parent
de250df520
commit
54c88c57ed
127 changed files with 6797 additions and 5825 deletions
|
@ -477,7 +477,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
const viewSourceButton = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_iconSource"
|
||||
label={_t("View source")}
|
||||
label={_t("timeline|context_menu|view_source")}
|
||||
onClick={this.onViewSourceClick}
|
||||
/>
|
||||
);
|
||||
|
@ -487,7 +487,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
unhidePreviewButton = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_iconUnhidePreview"
|
||||
label={_t("Show preview")}
|
||||
label={_t("timeline|context_menu|show_url_preview")}
|
||||
onClick={this.onUnhidePreviewClick}
|
||||
/>
|
||||
);
|
||||
|
@ -546,7 +546,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_iconLink"
|
||||
onClick={this.closeMenu}
|
||||
label={_t("Source URL")}
|
||||
label={_t("timeline|context_menu|external_url")}
|
||||
element="a"
|
||||
{
|
||||
// XXX: Typescript signature for AccessibleButton doesn't work properly for non-inputs like `a`
|
||||
|
@ -565,7 +565,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
collapseReplyChainButton = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_iconCollapse"
|
||||
label={_t("Collapse reply thread")}
|
||||
label={_t("timeline|context_menu|collapse_reply_thread")}
|
||||
onClick={this.onCollapseReplyChainClick}
|
||||
/>
|
||||
);
|
||||
|
@ -577,7 +577,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
jumpToRelatedEventButton = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_jumpToEvent"
|
||||
label={_t("View related event")}
|
||||
label={_t("timeline|context_menu|view_related_event")}
|
||||
onClick={() => this.onJumpToRelatedEventClick(relatedEventId)}
|
||||
/>
|
||||
);
|
||||
|
@ -588,7 +588,7 @@ export default class MessageContextMenu extends React.Component<IProps, IState>
|
|||
reportEventButton = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_MessageContextMenu_iconReport"
|
||||
label={_t("Report")}
|
||||
label={_t("timeline|context_menu|report")}
|
||||
onClick={this.onReportEventClick}
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -83,7 +83,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
leaveOption = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_RoomTile_iconSignOut"
|
||||
label={_t("Forget")}
|
||||
label={_t("room|context_menu|forget")}
|
||||
className="mx_IconizedContextMenu_option_red"
|
||||
onClick={onForgetRoomClick}
|
||||
/>
|
||||
|
@ -154,7 +154,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
PosthogTrackers.trackInteraction("WebRoomHeaderContextMenuFavouriteToggle", e);
|
||||
}}
|
||||
active={isFavorite}
|
||||
label={isFavorite ? _t("Favourited") : _t("Favourite")}
|
||||
label={isFavorite ? _t("room|context_menu|unfavourite") : _t("room|context_menu|favourite")}
|
||||
iconClassName="mx_RoomTile_iconStar"
|
||||
/>
|
||||
);
|
||||
|
@ -182,7 +182,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
iconClassName = "mx_RoomTile_iconNotificationsAllMessages";
|
||||
break;
|
||||
case RoomNotifState.MentionsOnly:
|
||||
notificationLabel = _t("Mentions only");
|
||||
notificationLabel = _t("room|context_menu|mentions_only");
|
||||
iconClassName = "mx_RoomTile_iconNotificationsMentionsKeywords";
|
||||
break;
|
||||
case RoomNotifState.Mute:
|
||||
|
@ -206,7 +206,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
|
||||
PosthogTrackers.trackInteraction("WebRoomHeaderContextMenuNotificationsItem", ev);
|
||||
}}
|
||||
label={_t("Notifications")}
|
||||
label={_t("notifications|enable_prompt_toast_title")}
|
||||
iconClassName={iconClassName}
|
||||
>
|
||||
<span className="mx_IconizedContextMenu_sublabel">{notificationLabel}</span>
|
||||
|
@ -247,7 +247,7 @@ const RoomContextMenu: React.FC<IProps> = ({ room, onFinished, ...props }) => {
|
|||
});
|
||||
onFinished();
|
||||
}}
|
||||
label={_t("Copy room link")}
|
||||
label={_t("room|context_menu|copy_link")}
|
||||
iconClassName="mx_RoomTile_iconCopyLink"
|
||||
/>
|
||||
);
|
||||
|
|
|
@ -111,7 +111,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
<IconizedContextMenuCheckbox
|
||||
onClick={wrapHandler((ev) => onTagRoom(ev, DefaultTagID.Favourite), onPostFavoriteClick, true)}
|
||||
active={isFavorite}
|
||||
label={isFavorite ? _t("Favourited") : _t("Favourite")}
|
||||
label={isFavorite ? _t("room|context_menu|unfavourite") : _t("room|context_menu|favourite")}
|
||||
iconClassName="mx_RoomGeneralContextMenu_iconStar"
|
||||
/>
|
||||
);
|
||||
|
@ -121,7 +121,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
<IconizedContextMenuCheckbox
|
||||
onClick={wrapHandler((ev) => onTagRoom(ev, DefaultTagID.LowPriority), onPostLowPriorityClick, true)}
|
||||
active={isLowPriority}
|
||||
label={_t("Low Priority")}
|
||||
label={_t("room|context_menu|low_priority")}
|
||||
iconClassName="mx_RoomGeneralContextMenu_iconArrowDown"
|
||||
/>
|
||||
);
|
||||
|
@ -156,7 +156,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
}),
|
||||
onPostCopyLinkClick,
|
||||
)}
|
||||
label={_t("Copy room link")}
|
||||
label={_t("room|context_menu|copy_link")}
|
||||
iconClassName="mx_RoomGeneralContextMenu_iconCopyLink"
|
||||
/>
|
||||
);
|
||||
|
@ -182,7 +182,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
leaveOption = (
|
||||
<IconizedContextMenuOption
|
||||
iconClassName="mx_RoomGeneralContextMenu_iconSignOut"
|
||||
label={_t("Forget Room")}
|
||||
label={_t("room|context_menu|forget")}
|
||||
className="mx_IconizedContextMenu_option_red"
|
||||
onClick={wrapHandler(
|
||||
() =>
|
||||
|
@ -221,7 +221,7 @@ export const RoomGeneralContextMenu: React.FC<RoomGeneralContextMenuProps> = ({
|
|||
onFinished?.();
|
||||
}}
|
||||
active={false}
|
||||
label={_t("Mark as read")}
|
||||
label={_t("room|context_menu|mark_read")}
|
||||
iconClassName="mx_RoomGeneralContextMenu_iconMarkAsRead"
|
||||
/>
|
||||
) : null;
|
||||
|
|
|
@ -52,7 +52,7 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
|
|||
|
||||
const defaultOption: JSX.Element = (
|
||||
<IconizedContextMenuRadio
|
||||
label={_t("Match default setting")}
|
||||
label={_t("room|context_menu|notifications_default")}
|
||||
active={notificationState === RoomNotifState.AllMessages}
|
||||
iconClassName="mx_RoomNotificationContextMenu_iconBell"
|
||||
onClick={wrapHandler(() => setNotificationState(RoomNotifState.AllMessages))}
|
||||
|
@ -79,7 +79,7 @@ export const RoomNotificationContextMenu: React.FC<IProps> = ({ room, onFinished
|
|||
|
||||
const muteOption: JSX.Element = (
|
||||
<IconizedContextMenuRadio
|
||||
label={_t("Mute room")}
|
||||
label={_t("room|context_menu|notifications_mute")}
|
||||
active={notificationState === RoomNotifState.Mute}
|
||||
iconClassName="mx_RoomNotificationContextMenu_iconBellCrossed"
|
||||
onClick={wrapHandler(() => setNotificationState(RoomNotifState.Mute))}
|
||||
|
|
|
@ -144,7 +144,10 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
onFinished();
|
||||
};
|
||||
streamAudioStreamButton = (
|
||||
<IconizedContextMenuOption onClick={onStreamAudioClick} label={_t("Start audio stream")} />
|
||||
<IconizedContextMenuOption
|
||||
onClick={onStreamAudioClick}
|
||||
label={_t("widget|context_menu|start_audio_stream")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -179,7 +182,9 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
onFinished();
|
||||
};
|
||||
|
||||
snapshotButton = <IconizedContextMenuOption onClick={onSnapshotClick} label={_t("Take a picture")} />;
|
||||
snapshotButton = (
|
||||
<IconizedContextMenuOption onClick={onSnapshotClick} label={_t("widget|context_menu|screenshot")} />
|
||||
);
|
||||
}
|
||||
|
||||
let deleteButton: JSX.Element | undefined;
|
||||
|
@ -190,11 +195,9 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
} else if (roomId) {
|
||||
// Show delete confirmation dialog
|
||||
Modal.createDialog(QuestionDialog, {
|
||||
title: _t("Delete Widget"),
|
||||
description: _t(
|
||||
"Deleting a widget removes it for all users in this room. Are you sure you want to delete this widget?",
|
||||
),
|
||||
button: _t("Delete widget"),
|
||||
title: _t("widget|context_menu|delete"),
|
||||
description: _t("widget|context_menu|delete_warning"),
|
||||
button: _t("widget|context_menu|delete"),
|
||||
onFinished: (confirmed) => {
|
||||
if (!confirmed) return;
|
||||
WidgetUtils.setRoomWidget(cli, roomId, app.id);
|
||||
|
@ -208,7 +211,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
deleteButton = (
|
||||
<IconizedContextMenuOption
|
||||
onClick={_onDeleteClick}
|
||||
label={userWidget ? _t("action|remove") : _t("Remove for everyone")}
|
||||
label={userWidget ? _t("action|remove") : _t("widget|context_menu|remove")}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
@ -233,7 +236,9 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
onFinished();
|
||||
};
|
||||
|
||||
revokeButton = <IconizedContextMenuOption onClick={onRevokeClick} label={_t("Revoke permissions")} />;
|
||||
revokeButton = (
|
||||
<IconizedContextMenuOption onClick={onRevokeClick} label={_t("widget|context_menu|revoke")} />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -246,7 +251,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
onFinished();
|
||||
};
|
||||
|
||||
moveLeftButton = <IconizedContextMenuOption onClick={onClick} label={_t("Move left")} />;
|
||||
moveLeftButton = <IconizedContextMenuOption onClick={onClick} label={_t("widget|context_menu|move_left")} />;
|
||||
}
|
||||
|
||||
let moveRightButton: JSX.Element | undefined;
|
||||
|
@ -257,7 +262,7 @@ export const WidgetContextMenu: React.FC<IProps> = ({
|
|||
onFinished();
|
||||
};
|
||||
|
||||
moveRightButton = <IconizedContextMenuOption onClick={onClick} label={_t("Move right")} />;
|
||||
moveRightButton = <IconizedContextMenuOption onClick={onClick} label={_t("widget|context_menu|move_right")} />;
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue