From 3668342ca772b92b1e5a67cf5501d422f47cb905 Mon Sep 17 00:00:00 2001 From: Dylan <36567925+Airyzz@users.noreply.github.com> Date: Thu, 14 Jul 2022 19:24:19 +0930 Subject: [PATCH] Added translation to all molecules --- public/locales/en/translation.json | 333 ++++++++++++++++++ .../confirm-dialog/ConfirmDialog.jsx | 7 +- src/app/molecules/dialog/ReusableDialog.jsx | 7 +- .../following-members/FollowingMembers.jsx | 24 +- .../molecules/image-upload/ImageUpload.jsx | 9 +- .../ExportE2ERoomKeys.jsx | 17 +- .../ImportE2ERoomKeys.jsx | 19 +- src/app/molecules/media/Media.jsx | 18 +- src/app/molecules/message/Message.jsx | 61 ++-- .../molecules/popup-window/PopupWindow.jsx | 7 +- .../PowerLevelSelector.jsx | 7 +- .../molecules/room-aliases/RoomAliases.jsx | 52 +-- .../room-encryption/RoomEncryption.jsx | 17 +- .../RoomHistoryVisibility.jsx | 17 +- .../molecules/room-members/RoomMembers.jsx | 17 +- .../room-notification/RoomNotification.jsx | 15 +- .../molecules/room-options/RoomOptions.jsx | 21 +- .../room-permissions/RoomPermissions.jsx | 113 +++--- .../molecules/room-profile/RoomProfile.jsx | 35 +- src/app/molecules/room-search/RoomSearch.jsx | 25 +- src/app/molecules/room-tile/RoomTile.jsx | 5 +- .../room-visibility/RoomVisibility.jsx | 13 +- .../space-add-existing/SpaceAddExisting.jsx | 21 +- .../molecules/space-options/SpaceOptions.jsx | 23 +- src/app/molecules/sso-buttons/SSOButtons.jsx | 8 +- src/app/organisms/navigation/Selector.jsx | 7 +- src/app/organisms/room/PeopleDrawer.jsx | 19 +- src/app/organisms/room/RoomViewFloating.jsx | 9 +- src/util/matrixUtil.js | 5 + 29 files changed, 717 insertions(+), 214 deletions(-) diff --git a/public/locales/en/translation.json b/public/locales/en/translation.json index 76f1903a..8989d39a 100644 --- a/public/locales/en/translation.json +++ b/public/locales/en/translation.json @@ -334,6 +334,18 @@ "shared_power_message": "You will not be able to undo this change as you are promoting the user to have the same power level as yourself. Are you sure?", "demoting_self_message": "You will not be able to undo this change as you are demoting yourself. Are you sure?" }, + "PeopleDrawer": { + "title": "People", + "members_one": "{{count}} member", + "members_other": "{{count}} members", + "joined": "Joined", + "invited": "Invited", + "banned": "Banned", + "search_no_results": "No results found", + "view_more": "View more", + "placeholder": "Search", + "invite_tooltip": "Invite" + }, "ProfileEditor": { "remove_avatar": "Remove avatar", "remove_avatar_confirmation": "Are you sure that you want to remove your avatar?", @@ -439,5 +451,326 @@ "create_space": "Create space", "home": "Home" } + }, + "Molecules":{ + "ConfirmDialog":{ + "cancel": "Cancel" + }, + "ReusableDialog": + { + "close_tooltip": "Close" + }, + "FollowingMembers":{ + "users_following_one": "{{user_one}} is following the conversation", + "users_following_two": "{{user_one}} and {{user_two}} are following the conversation", + "users_following_three": "{{user_one}}, {{user_two}}, and {{user_three}} are following the conversation", + "users_following_other": "{{user_one}}, {{user_two}}, {{user_three}} and {{other_count}} others are following the conversation" + }, + "ImageUpload": + { + "prompt": "Upload", + "cancel": "Cancel", + "remove": "Remove" + }, + "ExportE2ERoomKeys": + { + "getting_keys": "Getting keys...", + "encrypting_keys": "Encrypting Keys...", + "password_does_not_match": "Password does not match.", + "export_success": "Successfully exported all keys.", + "export_failed": "Failed to export keys. Please try again.", + "button_text": "Export" + }, + "ImportE2ERoomKeys": + { + "decrypting_file": "Decrypting file...", + "decrypting_messages": "Decrypting messages...", + "import_success": "Successfully imported all keys", + "import_failed": "Failed tp decrypt keys. Please try again", + "import_keys_button": "Import Keys", + "decrypt_button": "Decrypt" + }, + "Media":{ + "open_new_tab": "Open in new tab", + "download": "Download", + "play_audio": "Play audio", + "play_video": "Play video" + }, + "Message": + { + "message_deleted": "*** This message has been deleted ***", + "unable_to_load_reply": "*** Unable to load reply ***", + "unknown_user": "** Unknown user **", + "edited": "(edited)", + "edit_placeholder": "Edit message", + "user_reacted_one": "{{user_one}} reacted with ", + "user_reacted_two": "{{user_one}} and {{user_two}} reacted with ", + "user_reacted_three": "{{user_one}}, {{user_two}} and {{user_three}} reacted with ", + "user_reacted_other": "{{user_one}}, {{user_two}}, {{user_three}} and {{other_count}} others reacted with ", + "add_reaction_tooltip": "Add reaction", + "reply_tooltip": "Reply", + "edit_tooltip": "Edit", + "options_header": "Options", + "options_tooltip": "Options", + "read_receipts": "Read receipts", + "view_source": "View source", + "delete_message_prompt": "Delete message", + "delete_message_confirmation": "Are you sure that you want to delete this message?", + "delete_message_button": "Delete" + }, + "PopupWindow": + { + "close_tooltip": "Back" + }, + "PowerLevelSelector": { + "placeholder": "Power level" + }, + "RoomAliases": { + "invalid_characters": "Invalid character: only letter, numbers and _- are allowed.", + "validating_alias": "validating {{alias}}...", + "alias_available": "{{alias}} is available.", + "alias_unavailable": "{{alias}} is unavailable.", + "deleting_alias": "Deleting...", + "set_main_alias": "Set as Main", + "publish_alias": "Publish", + "unpublish_alias": "Unpublish", + "delete_alias": "Delete", + "main_alias": "Main", + "publish_to_room_directory": + { + "title": "Publish to room directory", + "publish_room_message": "Publish this room to the {{homeserver}} publish directory?", + "publish_space_message": "Publish this space to the {{homeserver}} publish directory?" + }, + "published_addresses": + { + "title": "Published addresses", + "none": "No published addresses", + "no_main_address": "No main address (select one from below)", + "message_room": "Published addresses can be used by anyone on any server to join your room. To publish an address, it needs to be set as a local address first.", + "message_space": "Published addresses can be used by anyone on any server to join your space. To publish an address, it needs to be set as a local address first." + }, + "local_addresses": + { + "title": "Local addresses", + "none": "No local addresses", + "message_room": "Set local addresses for this room so users can find this room through your homeserver.", + "message_space": "Set local addresses for this space so users can find this space through your homeserver.", + "add": "Add local address", + "add_button": "Add", + "placeholder_room": "my_room_address", + "placeholder_space": "my_space_address", + "hide": "Hide local addresses", + "view": "View local addresses" + + } + }, + "RoomEncryption":{ + "encryption_public_room_message": "It is not recommended to add encryption in public room. Anyone can find and join public rooms, so anyone should be able to read messages in them.", + "encryption_message": "Once enabled, encryption for a room cannot be disabled. Messages sent in an encrypted room cannot be seen by the server, only by the participants of the room. Enabling encryption may prevent many bots and bridges from working correctly", + "encryption_cannot_be_disabled": "Once enabled, encryption cannot be disabled.", + "enable_room_encryption": "Enable room encryption", + "enable_encryption_prompt": "Enable Encryption", + "enable_encryption_button": "Enable", + "continue_button": "Continue" + + }, + "RoomHistoryVisibility": { + "world_readable": "Anyone (including guests)", + "shared": "Members (all messages)", + "invited": "Members (messages after invite)", + "joined": "Members (messages after join)", + "changes_only_affect_future": "Changes to history visibility will only apply to future messages. The visibility of existing history will have no effect." + }, + "RoomMembers": { + "search_title": "Search member", + "found_members_one": "Found — one member", + "found_members_other": "Found — {{count}} members", + "no_results": "No results found for {{term}}", + "no_members": "No members to display", + "view_more": "View more", + "joined": "Joined", + "invited": "Invited", + "banned": "Banned", + "search_placeholder": "Search for name" + }, + "RoomNotification": + { + "default": "Global", + "all_messages": "All messages", + "mentions_and_keywords": "Mentions & Keywords", + "mute": "Mute" + }, + "RoomOptions":{ + "title": "Options for {{room_name}}", + "leave": { + "title": "Leave room", + "subtitle": "Are you sure you want to leave the {{room_name}} room?", + "button_text": "Leave" + }, + "mark_as_read": "Mark as read", + "notifications_heading": "Notifications", + "invite": "Invite" + }, + "RoomPermissions": + { + "default_role": { + "name": "Default role", + "description": "Set default role for all members" + }, + "send_messages": { + "name": "Send messages", + "description": "Set minimum power level to send messages in a room" + }, + "reactions":{ + "name": "Send reactions", + "description": "Set minimum power level to send reactions in a room" + }, + "delete": { + "name": "Delete messages sent by others", + "description": "Set minumum power level to delete messages in a room" + }, + "notifications":{ + "name": "Ping room", + "description": "Set minimum power level to ping room" + }, + "manage_rooms":{ + "name": "Manage rooms in space", + "description": "Set minimum power level to manage rooms in space" + }, + "invite": { + "name": "Invite", + "description": "Set minimum power level to invite members" + }, + "kick": { + "name": "Kick", + "description": "Set minimum power level to kick members" + }, + "ban": { + "name": "Ban", + "description": "Set minimum power level to ban members" + }, + "change_avatar": { + "name": "Change avatar", + "description": "Set minimum power level to change room/space avatar" + }, + "change_name": { + "name": "Change name", + "description": "Set minimum power evel to change room/space name" + }, + "change_topic": { + "name": "Change topic", + "description": "Set minimum power level to change room/space topic" + }, + "change_settings": { + "name": "Change settings", + "description": "Set minimum power level to change settings" + }, + "change_published_address": { + "name": "Change published address", + "description": "Set minimum power level to publish and set main address" + }, + "change_permissions": { + "name": "Change permissions", + "description": "Set minimum power level to change permissions" + }, + "enable_room_encryption": { + "name": "Enable room encryption", + "description": "Set minimum power level to enable room encryption" + }, + "change_history_visibility": { + "name": "Change history visibility", + "description": "Set minimum power level to change room message history visibility" + }, + "upgrade_room": { + "name": "Upgrade room", + "description": "Set minimum power level to upgrade room" + }, + "pin_messages": { + "name": "Pin messages", + "description": "Set minimum power level to pin messages in a room" + }, + "change_acls": { + "name": "Change server ACLs", + "description": "Set minimum power level to change server ACLs" + }, + "modify_widgets": { + "name": "Modify widgets", + "description": "Set minimum power level to modify room widgets" + }, + "groups": + { + "general": "General permissions", + "manage_members": "Manage members permissions", + "room": "Room profile permissions", + "space": "Space profile permissions", + "other": "Other permissions", + "settings": "Settings permissions" + } + }, + "RoomProfile": { + "saving_room_name": "Saving room name...", + "saving_room_topic": "Saving room topic...", + "save_success": "Saved successfully", + "save_failed": "Unable to save", + "remove_avatar_title": "Remove avatar", + "remove_avatar_subtitle": "Are you sure that you want to remove room avatar?", + "remove_avatar_button": "Remove", + "permission_change_room_name": "You have permission to change room name only", + "permission_change_room_topic": "You have permission to change room topic only", + "permission_change_space_name": "You have permission to change space name only", + "permission_change_space_topic": "You have permission to change space topic only", + "name_label": "Name", + "topic_label": "Topic" + }, + "RoomSearch": { + "title": "Room search", + "placeholder": "Search for keywords", + "search_button": "Search", + "searching": "Searching room messages...", + "subtitle": "Search room messages", + "failed": "Failed to search messages", + "no_results": "No results found", + "encrypted_room": "Search does not work in encrypted room", + "load_more": "Load more", + "results_one": "{{count}} result for {{term}}", + "results_other": "{{count}} results for {{term}}" + }, + "RoomTile": { + "invited_by_user_zero": "Invited by {{inviter}} to {{id}}", + "invited_by_user_one": "Invited by {{inviter}} to {{id}} • {{member_count}} member", + "invited_by_user_other": "Invited by {{inviter}} to {{id}} • {{member_count}} members", + "invited_zero": "{{id}}", + "invited_one": "{{id}} • {{member_count}} member", + "invited_other": "{{id}} • {{member_count}} members" + }, + "RoomVisibility": { + "private": "Private (invite only)", + "restricted": "Restricted (space members can join)", + "restricted_unsupported": "Restricted (Unsupported: room required upgrade)", + "public": "Public (anyone can join)" + }, + "SpaceAddExisting": { + "adding_items_one": "Adding one item...", + "adding_items_other": "Adding {{count}} items...", + "items_selected_one": "{{count}} item selected", + "items_selected_other": "{{count}} items selected", + "search_rooms_placeholder": "Search rooms", + "no_results": "No results found", + "add_button": "Add", + "subtitle": "add existing rooms" + }, + "SpaceOptions": { + "leave_space": "Leave Space", + "leave_space_confirmation": "Are you sure that you want to leave the {{space}} space?", + "leave_space_confirm": "Leave", + "invite": "Invite", + "manage_rooms":"Manage rooms", + "settings": "Settings", + "leave": "Leave" + }, + "SSOButtons": { + "login_with": "Login with {{idp_name}}" + } } } \ No newline at end of file diff --git a/src/app/molecules/confirm-dialog/ConfirmDialog.jsx b/src/app/molecules/confirm-dialog/ConfirmDialog.jsx index 5771f2c1..da8f60e1 100644 --- a/src/app/molecules/confirm-dialog/ConfirmDialog.jsx +++ b/src/app/molecules/confirm-dialog/ConfirmDialog.jsx @@ -7,15 +7,20 @@ import { openReusableDialog } from '../../../client/action/navigation'; import Text from '../../atoms/text/Text'; import Button from '../../atoms/button/Button'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + function ConfirmDialog({ desc, actionTitle, actionType, onComplete, }) { + + const { t } = useTranslation(); return (
{desc}
- +
); diff --git a/src/app/molecules/dialog/ReusableDialog.jsx b/src/app/molecules/dialog/ReusableDialog.jsx index 7340e119..ace3b5c6 100644 --- a/src/app/molecules/dialog/ReusableDialog.jsx +++ b/src/app/molecules/dialog/ReusableDialog.jsx @@ -8,10 +8,15 @@ import Dialog from './Dialog'; import CrossIC from '../../../../public/res/ic/outlined/cross.svg'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + function ReusableDialog() { const [isOpen, setIsOpen] = useState(false); const [data, setData] = useState(null); + const { t } = useTranslation(); + useEffect(() => { const handleOpen = (title, render, afterClose) => { setIsOpen(true); @@ -38,7 +43,7 @@ function ReusableDialog() { title={data?.title || ''} onAfterClose={handleAfterClose} onRequestClose={handleRequestClose} - contentOptions={} + contentOptions={} invisibleScroll > {data?.render(handleRequestClose) ||
} diff --git a/src/app/molecules/following-members/FollowingMembers.jsx b/src/app/molecules/following-members/FollowingMembers.jsx index 65296535..81893e34 100644 --- a/src/app/molecules/following-members/FollowingMembers.jsx +++ b/src/app/molecules/following-members/FollowingMembers.jsx @@ -13,12 +13,22 @@ import TickMarkIC from '../../../../public/res/ic/outlined/tick-mark.svg'; import { getUsersActionJsx } from '../../organisms/room/common'; +import { twemojify } from '../../../util/twemojify'; + + +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + +import { Trans } from 'react-i18next'; +import { getUserDisplayName } from '../../../util/matrixUtil'; + function FollowingMembers({ roomTimeline }) { const [followingMembers, setFollowingMembers] = useState([]); const { roomId } = roomTimeline; const mx = initMatrix.matrixClient; const { roomsInput } = initMatrix; const myUserId = mx.getUserId(); + const room = mx.getRoom(roomId); const handleOnMessageSent = () => setFollowingMembers([]); @@ -47,7 +57,19 @@ function FollowingMembers({ roomTimeline }) { size="extra-small" src={TickMarkIC} /> - {getUsersActionJsx(roomId, filteredM, 'following the conversation.')} + + }} + /> + ); } diff --git a/src/app/molecules/image-upload/ImageUpload.jsx b/src/app/molecules/image-upload/ImageUpload.jsx index 69564aa5..48da76d5 100644 --- a/src/app/molecules/image-upload/ImageUpload.jsx +++ b/src/app/molecules/image-upload/ImageUpload.jsx @@ -8,12 +8,17 @@ import Text from '../../atoms/text/Text'; import Avatar from '../../atoms/avatar/Avatar'; import Spinner from '../../atoms/spinner/Spinner'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + function ImageUpload({ text, bgColor, imageSrc, onUpload, onRequestRemove, }) { const [uploadPromise, setUploadPromise] = useState(null); const uploadImageRef = useRef(null); + const { t } = useTranslation(); + async function uploadImage(e) { const file = e.target.files.item(0); if (file === null) return; @@ -53,7 +58,7 @@ function ImageUpload({ size="large" />
- {uploadPromise === null && Upload} + {uploadPromise === null && {t("Molecules.ImageUpload.prompt")}} {uploadPromise !== null && }
@@ -63,7 +68,7 @@ function ImageUpload({ type="button" onClick={uploadPromise === null ? onRequestRemove : cancelUpload} > - {uploadPromise ? 'Cancel' : 'Remove'} + {uploadPromise ? t("Molecules.ImageUpload.cancel") : t("Molecules.ImageUpload.remove")} )} diff --git a/src/app/molecules/import-export-e2e-room-keys/ExportE2ERoomKeys.jsx b/src/app/molecules/import-export-e2e-room-keys/ExportE2ERoomKeys.jsx index b7738a6a..bc223bfd 100644 --- a/src/app/molecules/import-export-e2e-room-keys/ExportE2ERoomKeys.jsx +++ b/src/app/molecules/import-export-e2e-room-keys/ExportE2ERoomKeys.jsx @@ -14,6 +14,9 @@ import Spinner from '../../atoms/spinner/Spinner'; import { useStore } from '../../hooks/useStore'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + function ExportE2ERoomKeys() { const isMountStore = useStore(); const [status, setStatus] = useState({ @@ -24,19 +27,21 @@ function ExportE2ERoomKeys() { const passwordRef = useRef(null); const confirmPasswordRef = useRef(null); + const { t } = useTranslation(); + const exportE2ERoomKeys = async () => { const password = passwordRef.current.value; if (password !== confirmPasswordRef.current.value) { setStatus({ isOngoing: false, - msg: 'Password does not match.', + msg: t("Molecules.ExportE2ERoomKeys.password_does_not_match"), type: cons.status.ERROR, }); return; } setStatus({ isOngoing: true, - msg: 'Getting keys...', + msg: t("Molecules.ExportE2ERoomKeys.getting_keys"), type: cons.status.IN_FLIGHT, }); try { @@ -44,7 +49,7 @@ function ExportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: true, - msg: 'Encrypting keys...', + msg: t("Molecules.ExportE2ERoomKeys.encrypting_keys"), type: cons.status.IN_FLIGHT, }); } @@ -56,7 +61,7 @@ function ExportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: false, - msg: 'Successfully exported all keys.', + msg: t("Molecules.ExportE2ERoomKeys.export_success"), type: cons.status.SUCCESS, }); } @@ -64,7 +69,7 @@ function ExportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: false, - msg: e.friendlyText || 'Failed to export keys. Please try again.', + msg: e.friendlyText || t("Molecules.ExportE2ERoomKeys.export_failed"), type: cons.status.ERROR, }); } @@ -83,7 +88,7 @@ function ExportE2ERoomKeys() {
{ e.preventDefault(); exportE2ERoomKeys(); }}> - +
{ status.type === cons.status.IN_FLIGHT && (
diff --git a/src/app/molecules/import-export-e2e-room-keys/ImportE2ERoomKeys.jsx b/src/app/molecules/import-export-e2e-room-keys/ImportE2ERoomKeys.jsx index b5a44b0e..66d8c04d 100644 --- a/src/app/molecules/import-export-e2e-room-keys/ImportE2ERoomKeys.jsx +++ b/src/app/molecules/import-export-e2e-room-keys/ImportE2ERoomKeys.jsx @@ -15,6 +15,9 @@ import CirclePlusIC from '../../../../public/res/ic/outlined/circle-plus.svg'; import { useStore } from '../../hooks/useStore'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + function ImportE2ERoomKeys() { const isMountStore = useStore(); const [keyFile, setKeyFile] = useState(null); @@ -24,7 +27,9 @@ function ImportE2ERoomKeys() { type: cons.status.PRE_FLIGHT, }); const inputRef = useRef(null); - const passwordRef = useRef(null); + const passwordRef = useRef(null); + + const { t } = useTranslation(); async function tryDecrypt(file, password) { try { @@ -32,7 +37,7 @@ function ImportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: true, - msg: 'Decrypting file...', + msg: t("Molecules.ImportE2ERoomKeys.decrypting_file"), type: cons.status.IN_FLIGHT, }); } @@ -41,7 +46,7 @@ function ImportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: true, - msg: 'Decrypting messages...', + msg: t("Molecules.ImportE2ERoomKeys.decrypting_messages"), type: cons.status.IN_FLIGHT, }); } @@ -49,7 +54,7 @@ function ImportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: false, - msg: 'Successfully imported all keys.', + msg: t("Molecules.ImportE2ERoomKeys.import_success"), type: cons.status.SUCCESS, }); inputRef.current.value = null; @@ -59,7 +64,7 @@ function ImportE2ERoomKeys() { if (isMountStore.getItem()) { setStatus({ isOngoing: false, - msg: e.friendlyText || 'Failed to decrypt keys. Please try again.', + msg: e.friendlyText || t("Molecules.ImportE2ERoomKeys.import_failed"), type: cons.status.ERROR, }); } @@ -114,9 +119,9 @@ function ImportE2ERoomKeys() { {keyFile.name}
)} - {keyFile === null && } + {keyFile === null && } - + { status.type === cons.status.IN_FLIGHT && (
diff --git a/src/app/molecules/media/Media.jsx b/src/app/molecules/media/Media.jsx index 6fc38517..449b6dfd 100644 --- a/src/app/molecules/media/Media.jsx +++ b/src/app/molecules/media/Media.jsx @@ -12,6 +12,9 @@ import DownloadSVG from '../../../../public/res/ic/outlined/download.svg'; import ExternalSVG from '../../../../public/res/ic/outlined/external.svg'; import PlaySVG from '../../../../public/res/ic/outlined/play.svg'; +import '../../i18n.jsx' +import { useTranslation } from 'react-i18next'; + // https://github.com/matrix-org/matrix-react-sdk/blob/a9e28db33058d1893d964ec96cd247ecc3d92fc3/src/utils/blobs.ts#L73 const ALLOWED_BLOB_MIMETYPES = [ 'image/jpeg', @@ -73,6 +76,8 @@ function FileHeader({ }) { const [url, setUrl] = useState(null); + const { t } = useTranslation(); + async function getFile() { const myUrl = await getUrl(link, type, file); setUrl(myUrl); @@ -94,7 +99,7 @@ function FileHeader({ external && ( window.open(url || link)} /> @@ -103,7 +108,7 @@ function FileHeader({ @@ -150,6 +155,7 @@ function Image({ name, width, height, link, file, type, }) { const [url, setUrl] = useState(null); + useEffect(() => { let unmounted = false; @@ -204,12 +210,14 @@ function Audio({ loadAudio(); } + const { t } = useTranslation(); + return (
{ url === null && isLoading && } - { url === null && !isLoading && } + { url === null && !isLoading && } { url !== null && ( /* eslint-disable-next-line jsx-a11y/media-has-caption */