diff --git a/interface/ErrorFallback.tsx b/interface/ErrorFallback.tsx
index 4fd76d01b17e..237db090cf85 100644
--- a/interface/ErrorFallback.tsx
+++ b/interface/ErrorFallback.tsx
@@ -9,7 +9,7 @@ import { useDebugState } from '@sd/client';
import { Button, Dialogs } from '@sd/ui';
import { showAlertDialog } from './components';
-import { useOperatingSystem, useTheme } from './hooks';
+import { useLocale, useOperatingSystem, useTheme } from './hooks';
import { usePlatform } from './util/Platform';
const sentryBrowserLazy = import('@sentry/browser');
@@ -75,6 +75,8 @@ export function ErrorPage({
localStorage.getItem(RENDERING_ERROR_LOCAL_STORAGE_KEY)
);
+ const { t } = useLocale();
+
// If the user is on a page and the user presses "Reset" on the error boundary, it may crash in rendering causing the user to get stuck on the error page.
// If it crashes again, we redirect them instead of infinitely crashing.
useEffect(() => {
@@ -91,9 +93,9 @@ export function ErrorPage({
const resetHandler = () => {
showAlertDialog({
- title: 'Reset',
- value: 'Are you sure you want to reset Spacedrive? Your database will be deleted.',
- label: 'Confirm',
+ title: t('reset'),
+ value: t('reset_confirmation'),
+ label: t('confirm'),
cancelBtn: true,
onSubmit: () => {
localStorage.clear();
@@ -116,8 +118,8 @@ export function ErrorPage({
}
>
APP CRASHED
-{t('app_crashed')}
+{message}@@ -125,7 +127,7 @@ export function ErrorPage({
- We detected you may have created your library with an older version of - Spacedrive. Please reset it to continue using the app! -
-- {' '} - YOU WILL LOSE ANY EXISTING SPACEDRIVE DATA! + {t('reset_to_continue')}
+{t('reset_warning')}
No apps available
+{t('no_apps_available')}
)} > ); diff --git a/interface/app/$libraryId/Explorer/CopyAsPath.tsx b/interface/app/$libraryId/Explorer/CopyAsPath.tsx index ab8c2d193eec..9b15b6e08d9c 100644 --- a/interface/app/$libraryId/Explorer/CopyAsPath.tsx +++ b/interface/app/$libraryId/Explorer/CopyAsPath.tsx @@ -27,7 +27,7 @@ export const CopyAsPathBase = ( } catch (error) { toast.error({ title: t('failed_to_copy_file_path'), - body: `Error: ${error}.` + body: t('error_message', { error }) }); } }} diff --git a/interface/app/$libraryId/Explorer/DismissibleNotice.tsx b/interface/app/$libraryId/Explorer/DismissibleNotice.tsx index eab622efdadd..7e93accfac3e 100644 --- a/interface/app/$libraryId/Explorer/DismissibleNotice.tsx +++ b/interface/app/$libraryId/Explorer/DismissibleNotice.tsx @@ -50,7 +50,7 @@ const notices = { }, media: { key: 'mediaView', - title: 'Media View', + title: i18n.t('media_view'), description: i18n.t('media_view_notice_description'), icon:- Please select an emoji + {t('please_select_emoji')}
)} diff --git a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/LibrariesDropdown.tsx b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/LibrariesDropdown.tsx index 66873dbc5ba9..56cdb0a7ac23 100644 --- a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/LibrariesDropdown.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/LibrariesDropdown.tsx @@ -28,7 +28,11 @@ export default () => { )} > - {libraries.isLoading ? 'Loading...' : library ? library.config.name : ' '} + {libraries.isLoading + ? `${t('loading')}...` + : library + ? library.config.name + : ' '} } diff --git a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/SeeMore.tsx b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/SeeMore.tsx index 0716dab58052..03072bcbe49d 100644 --- a/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/SeeMore.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/SidebarLayout/SeeMore.tsx @@ -1,4 +1,5 @@ import { Children, PropsWithChildren, useState } from 'react'; +import { useLocale } from '~/hooks'; export const SEE_MORE_COUNT = 5; @@ -11,6 +12,7 @@ export function SeeMore({ children, limit = SEE_MORE_COUNT }: Props) { const childrenArray = Children.toArray(children); + const { t } = useLocale(); return ( <> {childrenArray.map((child, index) => (seeMore || index < limit ? child : null))} @@ -19,7 +21,7 @@ export function SeeMore({ children, limit = SEE_MORE_COUNT }: Props) { onClick={() => setSeeMore(!seeMore)} className="mb-1 ml-2 mt-0.5 cursor-pointer text-center text-tiny font-semibold text-ink-faint/50 transition hover:text-accent" > - See {seeMore ? 'less' : 'more'} + {seeMore ? `${t('see_less')}` : `${t('see_more')}`} )} > diff --git a/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx b/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx index 803fa6b8fdad..3688adc4b63a 100644 --- a/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/sections/Locations/ContextMenu.tsx @@ -43,7 +43,7 @@ export const ContextMenu = ({ )); } } catch (error) { - toast.error(`${error}`); + toast.error(t('error_message', { error })); } }} icon={Plus} diff --git a/interface/app/$libraryId/Layout/Sidebar/sections/Tools/index.tsx b/interface/app/$libraryId/Layout/Sidebar/sections/Tools/index.tsx index b8d89ec366f9..ab33152db5ef 100644 --- a/interface/app/$libraryId/Layout/Sidebar/sections/Tools/index.tsx +++ b/interface/app/$libraryId/Layout/Sidebar/sections/Tools/index.tsx @@ -35,7 +35,7 @@ export default function ToolsSection() { className={`max-w relative flex w-full grow flex-row items-center gap-0.5 truncate rounded border border-transparent ${os === 'macOS' ? 'bg-opacity-90' : ''} px-2 py-1 text-sm font-medium text-sidebar-inkDull outline-none ring-0 ring-inset ring-transparent ring-offset-0 focus:ring-1 focus:ring-accent focus:ring-offset-0`} onClick={() => { platform.openTrashInOsExplorer?.(); - toast.info('Opening Trash'); + toast.info(t('opening_trash')); }} >- File '{data.files[0]}' from '{data.peer_name}' -
+{t('file_from', { file: data.files[0], name: data.peer_name })}
{/* TODO: This will be removed in the future for now it's just a hack */} {platform.saveFilePickerDialog ? null : ( ) => { toast.info( @@ -106,7 +107,7 @@ export function useSpacedropProgressToast() { id: data.id, duration: Infinity, cancel: { - label: 'Cancel', + label: t('cancel'), onClick() { cancelSpacedrop.mutate(data.id); } diff --git a/interface/app/$libraryId/overview/FileKindStats.tsx b/interface/app/$libraryId/overview/FileKindStats.tsx index 57ed1c51fea8..6a4c19b2cd84 100644 --- a/interface/app/$libraryId/overview/FileKindStats.tsx +++ b/interface/app/$libraryId/overview/FileKindStats.tsx @@ -4,6 +4,9 @@ import { useRef } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { formatNumber, SearchFilterArgs, useLibraryQuery } from '@sd/client'; import { Icon } from '~/components'; +import { useLocale } from '~/hooks'; + +import { translateKindName } from '../Explorer/util'; export default () => { const ref = useRef- {formatNumber(items)} Item{(items > 1 || items === 0) && 's'} + {formatNumber(items)}{' '} + {items > 1 || items === 0 ? `${t('items')}` : `${t('item')}`}
)}- For library '{backup.library_name}' + {t('for_library', { name: backup.library_name })}
{errors.name?.message}
} -{listIndexerRules.isError - ? 'Error while retriving indexer rules' - : 'No indexer rules available'} + ? `${t('indexer_rules_error')}` + : `${t('indexer_rules_not_available')}`}
)}- Error creating the IPv4 and IPv6 listeners. Please check your firewall - settings! -
+{t('ipv4_ipv6_listeners_error')}
{listeners.data.ipv4.error}
Error creating the IPv4 listeners. Please check your firewall settings!
+{t('ipv4_listeners_error')}
{listeners.data.ipv4.error}
Error creating the IPv6 listeners. Please check your firewall settings!
+{t('ipv6_listeners_error')}
{listeners.data.ipv6.error}