{selectedFiles.length > 0 && (
@@ -420,9 +423,9 @@ export const RoomInput = forwardRef
(
>
- {`Drop Files in "${room?.name || 'Room'}"`}
+ {`${t('Organisms.RoomCommon.drop_files')} "${room?.name || t('Organisms.RoomCommon.room')}"`}
- Drag and drop files here or click for selection dialog
+ {t('Organisms.RoomCommon.drag_and_drop')}
diff --git a/src/app/organisms/room/RoomSettings.jsx b/src/app/organisms/room/RoomSettings.jsx
index 6327734713..47e2df5a25 100644
--- a/src/app/organisms/room/RoomSettings.jsx
+++ b/src/app/organisms/room/RoomSettings.jsx
@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
import PropTypes from 'prop-types';
import './RoomSettings.scss';
+import { useTranslation } from 'react-i18next';
import { blurOnBubbling } from '../../atoms/button/script';
import initMatrix from '../../../client/initMatrix';
@@ -41,12 +42,12 @@ import { useForceUpdate } from '../../hooks/useForceUpdate';
import { confirmDialog } from '../../molecules/confirm-dialog/ConfirmDialog';
const tabText = {
- GENERAL: 'General',
- SEARCH: 'Search',
- MEMBERS: 'Members',
- EMOJIS: 'Emojis',
- PERMISSIONS: 'Permissions',
- SECURITY: 'Security',
+ GENERAL: 'Organisms.RoomSettings.General',
+ SEARCH: 'Organisms.RoomSettings.Search',
+ MEMBERS: 'Organisms.RoomSettings.Members',
+ EMOJIS: 'Organisms.RoomSettings.Emojis',
+ PERMISSIONS: 'Organisms.RoomSettings.Permissions',
+ SECURITY: 'Organisms.RoomSettings.Security',
};
const tabItems = [{
@@ -80,24 +81,26 @@ function GeneralSettings({ roomId }) {
const room = mx.getRoom(roomId);
const canInvite = room.canInvite(mx.getUserId());
+ const { t } = useTranslation();
+
return (
<>
- Options
+ {t('Organisms.RoomSettings.options')}
- Notification (Changing this will only affect you)
+ {t('Organisms.RoomSettings.notification_header')}
- Room visibility (who can join)
+ {t('Organisms.RoomSettings.visibility_header')}
- Room addresses
+ {t('Organisms.RoomSettings.address_header')}
>
@@ -129,14 +132,15 @@ GeneralSettings.propTypes = {
};
function SecuritySettings({ roomId }) {
+ const { t } = useTranslation();
return (
<>
- Encryption
+ {t('Organisms.RoomSettings.encryption_header')}
- Message history visibility
+ {t('Organisms.RoomSettings.message_history_header')}
>
@@ -150,6 +154,7 @@ function RoomSettings({ roomId }) {
const [, forceUpdate] = useForceUpdate();
const [selectedTab, setSelectedTab] = useState(tabItems[0]);
const room = initMatrix.matrixClient.getRoom(roomId);
+ const { t } = useTranslation();
const handleTabChange = (tabItem) => {
setSelectedTab(tabItem);
@@ -188,7 +193,12 @@ function RoomSettings({ roomId }) {
{`${room.name}`}
- — room settings
+
+ {' '}
+ —
+ {' '}
+ {t('Organisms.RoomSettings.room_settings_subtitle')}
+
@@ -219,4 +229,4 @@ RoomSettings.propTypes = {
};
export default RoomSettings;
-export { tabText };
+export { tabText };
\ No newline at end of file
diff --git a/src/app/organisms/room/RoomTimeline.tsx b/src/app/organisms/room/RoomTimeline.tsx
index 7e2475dd26..f6caa68d4c 100644
--- a/src/app/organisms/room/RoomTimeline.tsx
+++ b/src/app/organisms/room/RoomTimeline.tsx
@@ -1743,7 +1743,7 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
before={}
onClick={handleJumpToUnread}
>
- Jump to Unread
+ {t('Organisms.RoomCommon.jump_to_unread')}
}
onClick={handleMarkAsRead}
>
- Mark as Read
+ {t('Organisms.RoomCommon.mark_as_read')}
)}
@@ -1821,7 +1821,7 @@ export function RoomTimeline({ room, eventId, roomInputRef, editor }: RoomTimeli
before={}
onClick={handleJumpToLatest}
>
- Jump to Latest
+ {t('Organisms.RoomCommon.jump_to_latest')}
)}
diff --git a/src/app/organisms/room/RoomViewFollowing.tsx b/src/app/organisms/room/RoomViewFollowing.tsx
index 2f7a583e3f..f584e50168 100644
--- a/src/app/organisms/room/RoomViewFollowing.tsx
+++ b/src/app/organisms/room/RoomViewFollowing.tsx
@@ -14,6 +14,7 @@ import {
import { Room } from 'matrix-js-sdk';
import classNames from 'classnames';
import FocusTrap from 'focus-trap-react';
+import { useTranslation } from 'react-i18next';
import { getMemberDisplayName } from '../../utils/room';
import { getMxIdLocalPart } from '../../utils/matrix';
@@ -39,6 +40,7 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
);
const eventId = latestEvent?.getId();
+ const { t } = useTranslation();
return (
<>
@@ -77,7 +79,7 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
<>
{names[0]}
- {' is following the conversation.'}
+ {t('Organisms.RoomCommon.is_following')}
>
)}
@@ -85,11 +87,11 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
<>
{names[0]}
- {' and '}
+ {t('common.and')}
{names[1]}
- {' are following the conversation.'}
+ {t('Organisms.RoomCommon.are_following')}
>
)}
@@ -101,11 +103,11 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
{names[1]}
- {' and '}
+ {t('common.and')}
{names[2]}
- {' are following the conversation.'}
+ {t('Organisms.RoomCommon.are_following')}
>
)}
@@ -121,11 +123,11 @@ export const RoomViewFollowing = as<'div', RoomViewFollowingProps>(
{names[2]}
- {' and '}
+ {t('common.and')}
{names.length - 3} others
- {' are following the conversation.'}
+ {t('Organisms.RoomCommon.are_following')}
>
)}
diff --git a/src/app/organisms/room/message/FileContent.tsx b/src/app/organisms/room/message/FileContent.tsx
index 9c65966708..f7f52b381d 100644
--- a/src/app/organisms/room/message/FileContent.tsx
+++ b/src/app/organisms/room/message/FileContent.tsx
@@ -17,6 +17,7 @@ import {
import FileSaver from 'file-saver';
import { EncryptedAttachmentInfo } from 'browser-encrypt-attachment';
import FocusTrap from 'focus-trap-react';
+import { useTranslation } from 'react-i18next';
import { IFileInfo } from '../../../../types/matrix/common';
import { AsyncStatus, useAsyncCallback } from '../../../hooks/useAsyncCallback';
import { useMatrixClient } from '../../../hooks/useMatrixClient';
@@ -88,6 +89,8 @@ function ReadTextFile({ body, mimeType, url, encInfo }: Omit
{textState.status === AsyncStatus.Success && (
@@ -141,7 +144,7 @@ function ReadTextFile({ body, mimeType, url, encInfo }: Omit
- Open File
+ {t('Components.Files.open_file')}
)}
@@ -161,6 +164,8 @@ function ReadPdfFile({ body, mimeType, url, encInfo }: Omit
{pdfState.status === AsyncStatus.Success && (
@@ -189,7 +194,7 @@ function ReadPdfFile({ body, mimeType, url, encInfo }: Omit
)}
{pdfState.status === AsyncStatus.Error ? (
- renderErrorButton(loadPdf, 'Open PDF')
+ renderErrorButton(loadPdf, t('Components.Files.open_pdf'))
) : (
)}
@@ -226,8 +231,13 @@ function DownloadFile({ body, mimeType, url, info, encInfo }: FileContentProps)
}, [mx, url, mimeType, encInfo, body])
);
+ const { t } = useTranslation();
+
return downloadState.status === AsyncStatus.Error ? (
- renderErrorButton(download, `Retry Download (${bytesToSize(info.size ?? 0)})`)
+ renderErrorButton(
+ download,
+ `${t('Components.Files.retry_download')} (${bytesToSize(info.size ?? 0)})`
+ )
) : (
);
}