Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Create more common_* common strings (#11439)
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy authored Aug 23, 2023
1 parent df4a221 commit aa6e365
Show file tree
Hide file tree
Showing 106 changed files with 1,121 additions and 1,069 deletions.
2 changes: 1 addition & 1 deletion src/ContentMessages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ export default class ContentMessages {
replyToEvent: MatrixEvent | undefined,
promBefore?: Promise<any>,
): Promise<void> {
const fileName = file.name || _t("Attachment");
const fileName = file.name || _t("common|attachment");
const content: Omit<IMediaEventContent, "info"> & { info: Partial<IMediaEventInfo> } = {
body: fileName,
info: {
Expand Down
4 changes: 2 additions & 2 deletions src/accessibility/KeyboardShortcuts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export const CATEGORIES: Record<CategoryName, ICategory> = {
settingNames: [KeyBindingAction.ToggleMicInCall, KeyBindingAction.ToggleWebcamInCall],
},
[CategoryName.ROOM]: {
categoryLabel: _td("Room"),
categoryLabel: _td("common|room"),
settingNames: [
KeyBindingAction.SearchInRoom,
KeyBindingAction.UploadFile,
Expand Down Expand Up @@ -303,7 +303,7 @@ export const CATEGORIES: Record<CategoryName, ICategory> = {
],
},
[CategoryName.LABS]: {
categoryLabel: _td("Labs"),
categoryLabel: _td("common|labs"),
settingNames: [KeyBindingAction.ToggleHiddenEventVisibility],
},
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/RoomSearchView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const RoomSearchView = forwardRef<ScrollPanel, Props>(
ret.push(
<li key={mxEv.getId() + "-room"}>
<h2>
{_t("Room")}: {room.name}
{_t("common|room")}: {room.name}
</h2>
</li>,
);
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/ThreadPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export const ThreadPanelHeader: React.FC<{
return (
<div className="mx_BaseCard_header_title">
<Heading size="4" className="mx_BaseCard_header_title_heading">
{_t("Threads")}
{_t("common|threads")}
</Heading>
{!empty && (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/ThreadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
return (
<div className="mx_BaseCard_header_title">
<Heading size="4" className="mx_BaseCard_header_title_heading">
{_t("Thread")}
{_t("common|thread")}
</Heading>
<ThreadListContextMenu mxEvent={this.props.mxEvent} permalinkCreator={this.props.permalinkCreator} />
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/structures/UserMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
homeButton = (
<IconizedContextMenuOption
iconClassName="mx_UserMenu_iconHome"
label={_t("Home")}
label={_t("common|home")}
onClick={this.onHomeClick}
/>
);
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/beta/BetaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ export const BetaPill: React.FC<IBetaPillProps> = ({
}
onClick={onClick}
>
{_t("Beta")}
{_t("common|beta")}
</AccessibleTooltipButton>
);
}

return <span className="mx_BetaCard_betaPill">{_t("Beta")}</span>;
return <span className="mx_BetaCard_betaPill">{_t("common|beta")}</span>;
};

const BetaCard: React.FC<IProps> = ({ title: titleOverride, featureId }) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/context_menus/SpaceContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ const SpaceContextMenu: React.FC<IProps> = ({ space, hideHeader, onFinished, ...
<IconizedContextMenuOption
data-testid="new-room-option"
iconClassName="mx_SpacePanel_iconPlus"
label={_t("Room")}
label={_t("common|room")}
onClick={onNewRoomClick}
/>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/CreateRoomDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ export default class CreateRoomDialog extends React.Component<IProps, IState> {
<div className="mx_Dialog_content">
<Field
ref={this.nameField}
label={_t("Name")}
label={_t("common|name")}
onChange={this.onNameChange}
onValidate={this.onNameValidate}
value={this.state.name}
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/DevtoolsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ enum Category {
}

const categoryLabels: Record<Category, TranslationKey> = {
[Category.Room]: _td("Room"),
[Category.Room]: _td("common|room"),
[Category.Other]: _td("Other"),
};

Expand Down Expand Up @@ -106,7 +106,7 @@ const DevtoolsDialog: React.FC<IProps> = ({ roomId, threadRootId, onFinished })
</div>
))}
<div>
<h3>{_t("Options")}</h3>
<h3>{_t("common|options")}</h3>
<SettingsFlag name="developerMode" level={SettingLevel.ACCOUNT} />
<SettingsFlag name="showHiddenEventsInTimeline" level={SettingLevel.DEVICE} />
<SettingsFlag name="enableWidgetScreenshots" level={SettingLevel.ACCOUNT} />
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/ExportDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ const ExportDialog: React.FC<IProps> = ({ room, onFinished }) => {
// Display cancel warning
return (
<BaseDialog
title={_t("Warning")}
title={_t("common|warning")}
className="mx_ExportDialog"
contentId="mx_Dialog_content"
onFinished={onFinished}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/dialogs/SpacePreferencesDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ const SpacePreferencesDialog: React.FC<IProps> = ({ space, initialTabId, onFinis
const tabs: NonEmptyArray<Tab<SpacePreferenceTab>> = [
new Tab(
SpacePreferenceTab.Appearance,
_td("Appearance"),
_td("common|appearance"),
"mx_SpacePreferencesDialog_appearanceIcon",
<SpacePreferencesAppearanceTab space={space} />,
),
Expand Down
4 changes: 2 additions & 2 deletions src/components/views/dialogs/UserSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
tabs.push(
new Tab(
UserTab.Appearance,
_td("Appearance"),
_td("common|appearance"),
"mx_UserSettingsDialog_appearanceIcon",
<AppearanceUserSettingsTab />,
"UserSettingsAppearance",
Expand Down Expand Up @@ -168,7 +168,7 @@ export default class UserSettingsDialog extends React.Component<IProps, IState>
tabs.push(
new Tab(
UserTab.Labs,
_td("Labs"),
_td("common|labs"),
"mx_UserSettingsDialog_labsIcon",
<LabsUserSettingsTab />,
"UserSettingsLabs",
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/elements/AppTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,7 @@ export default class AppTile extends React.Component<IProps, IState> {
{this.state.hasContextMenuOptions && (
<ContextMenuButton
className="mx_AppTileMenuBar_widgets_button"
label={_t("Options")}
label={_t("common|options")}
isExpanded={this.state.menuDisplayed}
inputRef={this.contextMenuButton}
onClick={this.onContextMenuClick}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/elements/ImageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ export default class ImageView extends React.Component<IProps, IState> {
contextMenuButton = (
<ContextMenuTooltipButton
className="mx_ImageView_button mx_ImageView_button_more"
title={_t("Options")}
title={_t("common|options")}
onClick={this.onOpenContextMenu}
inputRef={this.contextMenuButton}
isExpanded={this.state.contextMenuDisplayed}
Expand Down
8 changes: 6 additions & 2 deletions src/components/views/elements/ServerPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,13 @@ const ServerPicker: React.FC<IProps> = ({ title, dialogTitle, serverConfig, onSe

return (
<div className="mx_ServerPicker">
<h2>{title || _t("Homeserver")}</h2>
<h2>{title || _t("common|homeserver")}</h2>
{!disableCustomUrls ? (
<AccessibleButton className="mx_ServerPicker_help" onClick={onHelpClick} aria-label={_t("Help")} />
<AccessibleButton
className="mx_ServerPicker_help"
onClick={onHelpClick}
aria-label={_t("common|help")}
/>
) : null}
<span className="mx_ServerPicker_server" title={typeof serverName === "string" ? serverName : undefined}>
{serverName}
Expand Down
8 changes: 4 additions & 4 deletions src/components/views/messages/MFileBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
}

private get fileName(): string {
return this.content.body && this.content.body.length > 0 ? this.content.body : _t("Attachment");
return this.content.body && this.content.body.length > 0 ? this.content.body : _t("common|attachment");
}

private get linkText(): string {
Expand Down Expand Up @@ -205,9 +205,9 @@ export default class MFileBody extends React.Component<IProps, IState> {
placeholder = (
<AccessibleButton className="mx_MediaBody mx_MFileBody_info" onClick={this.onPlaceholderClick}>
<span className="mx_MFileBody_info_icon" />
<TextWithTooltip tooltip={presentableTextForFile(this.content, _t("Attachment"), true)}>
<TextWithTooltip tooltip={presentableTextForFile(this.content, _t("common|attachment"), true)}>
<span className="mx_MFileBody_info_filename">
{presentableTextForFile(this.content, _t("Attachment"), true, true)}
{presentableTextForFile(this.content, _t("common|attachment"), true, true)}
</span>
</TextWithTooltip>
</AccessibleButton>
Expand Down Expand Up @@ -284,7 +284,7 @@ export default class MFileBody extends React.Component<IProps, IState> {
*/}
<iframe
aria-hidden
title={presentableTextForFile(this.content, _t("Attachment"), true, true)}
title={presentableTextForFile(this.content, _t("common|attachment"), true, true)}
src={url}
onLoad={() => this.downloadFile(this.fileName, this.linkText)}
ref={this.iframe}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/messages/MImageBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default class MImageBody extends React.Component<IBodyProps, IState> {
if (!httpUrl) return;
const params: Omit<ComponentProps<typeof ImageView>, "onFinished"> = {
src: httpUrl,
name: content.body && content.body.length > 0 ? content.body : _t("Attachment"),
name: content.body && content.body.length > 0 ? content.body : _t("common|attachment"),
mxEvent: this.props.mxEvent,
permalinkCreator: this.props.permalinkCreator,
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/messages/MessageActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const OptionsButton: React.FC<IOptionsButtonProps> = ({
<React.Fragment>
<ContextMenuTooltipButton
className="mx_MessageActionBar_iconButton mx_MessageActionBar_optionsButton"
title={_t("Options")}
title={_t("common|options")}
onClick={onOptionsClick}
onContextMenu={onOptionsClick}
isExpanded={menuDisplayed}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default class LegacyRoomHeaderButtons extends HeaderButtons<IProps> {
key={RightPanelPhases.ThreadPanel}
name="threadsButton"
data-testid="threadsButton"
title={_t("Threads")}
title={_t("common|threads")}
onClick={this.onThreadsPanelClicked}
isHighlighted={this.isPhase(LegacyRoomHeaderButtons.THREAD_PHASES)}
isUnread={this.state.threadNotificationColor > NotificationColor.None}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/right_panel/RoomSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ const AppRow: React.FC<IAppRowProps> = ({ app, room }) => {
className="mx_RoomSummaryCard_app_options"
isExpanded={menuDisplayed}
onClick={openMenu}
title={_t("Options")}
title={_t("common|options")}
/>
)}

Expand Down
2 changes: 1 addition & 1 deletion src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ export const UserOptionsSection: React.FC<{

return (
<div className="mx_UserInfo_container">
<h3>{_t("Options")}</h3>
<h3>{_t("common|options")}</h3>
<div>
{directMessageButton}
{readReceiptButton}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/right_panel/WidgetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const WidgetCard: React.FC<IProps> = ({ room, widgetId, onClose }) => {
inputRef={handle}
onClick={openMenu}
isExpanded={menuDisplayed}
label={_t("Options")}
label={_t("common|options")}
/>
{contextMenu}
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/MessageComposerButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ const UploadButton: React.FC = () => {
className="mx_MessageComposer_button"
iconClassName="mx_MessageComposer_upload"
onClick={onClick}
title={_t("Attachment")}
title={_t("common|attachment")}
/>
);
};
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ const TAG_AESTHETICS: TagAestheticsMap = {
defaultHidden: false,
},
[DefaultTagID.Favourite]: {
sectionLabel: _td("Favourites"),
sectionLabel: _td("common|favourites"),
isInvite: false,
defaultHidden: false,
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/rooms/RoomSublist.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ export default class RoomSublist extends React.Component<IProps, IState> {
<React.Fragment>
<hr />
<fieldset>
<legend className="mx_RoomSublist_contextMenu_title">{_t("Appearance")}</legend>
<legend className="mx_RoomSublist_contextMenu_title">{_t("common|appearance")}</legend>
<StyledMenuItemCheckbox
onClose={this.onCloseMenu}
onChange={this.onUnreadFirstChanged}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/JoinRuleSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ const JoinRuleSettings: React.FC<JoinRuleSettingsProps> = ({
},
{
value: JoinRule.Public,
label: _t("Public"),
label: _t("common|public"),
description: (
<>
{_t("Anyone can find and join.")}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/ThemeChoicePanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ export default class ThemeChoicePanel extends React.Component<IProps, IState> {

const orderedThemes = getOrderedThemes();
return (
<SettingsSubsection heading={_t("Theme")} data-testid="mx_ThemeChoicePanel">
<SettingsSubsection heading={_t("common|theme")} data-testid="mx_ThemeChoicePanel">
{systemThemeSection}
<div className="mx_ThemeChoicePanel_themeSelectors" data-testid="theme-choice-panel-selectors">
<StyledRadioGroup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const CurrentDeviceSectionHeading: React.FC<CurrentDeviceSectionHeadingProps> =
<SettingsSubsectionHeading heading={_t("Current session")}>
<KebabContextMenu
disabled={disabled}
title={_t("Options")}
title={_t("common|options")}
options={menuOptions}
data-testid="current-session-menu"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/settings/devices/DeviceDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const DeviceDetails: React.FC<Props> = ({
id: "application",
heading: _t("Application"),
values: [
{ label: _t("Name"), value: device.appName },
{ label: _t("common|name"), value: device.appName },
{ label: _t("Version"), value: device.appVersion },
{ label: _t("URL"), value: device.url },
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const OtherSessionsSectionHeading: React.FC<Props> = ({
{!!menuOptions.length && (
<KebabContextMenu
disabled={disabled}
title={_t("Options")}
title={_t("common|options")}
options={menuOptions}
data-testid="other-sessions-menu"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ export default class GeneralUserSettingsTab extends React.Component<IProps, ISta
height="18"
// override icon default values
aria-hidden={false}
aria-label={_t("Warning")}
aria-label={_t("common|warning")}
/>
) : null;
const heading = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const SidebarUserSettingsTab: React.FC = () => {
>
<SettingsSubsectionText>
<HomeIcon />
{_t("Home")}
{_t("common|home")}
</SettingsSubsectionText>
<SettingsSubsectionText>
{_t("Home is useful for getting an overview of everything.")}
Expand All @@ -106,7 +106,7 @@ const SidebarUserSettingsTab: React.FC = () => {
>
<SettingsSubsectionText>
<FavoriteIcon />
{_t("Favourites")}
{_t("common|favourites")}
</SettingsSubsectionText>
<SettingsSubsectionText>
{_t("Group all your favourite rooms and people in one place.")}
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/spaces/QuickSettingsButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const QuickSettingsButton: React.FC<{
onChange={onMetaSpaceChangeFactory(MetaSpace.Favourites, "WebQuickSettingsPinToSidebarCheckbox")}
>
<FavoriteIcon className="mx_QuickSettingsButton_icon" />
{_t("Favourites")}
{_t("common|favourites")}
</StyledCheckbox>
<StyledCheckbox
className="mx_QuickSettingsButton_peopleCheckbox"
Expand Down
2 changes: 1 addition & 1 deletion src/components/views/spaces/QuickThemeSwitcher.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const QuickThemeSwitcher: React.FC<Props> = ({ requestClose }) => {

return (
<div className="mx_QuickThemeSwitcher">
<h4 className="mx_QuickThemeSwitcher_heading">{_t("Theme")}</h4>
<h4 className="mx_QuickThemeSwitcher_heading">{_t("common|theme")}</h4>
<Dropdown
id="mx_QuickSettingsButton_themePickerDropdown"
onOptionChange={onOptionChange}
Expand Down
Loading

0 comments on commit aa6e365

Please sign in to comment.