({
)}
>
-
{rule.name}
+
+ {t(`${rule.name?.toLowerCase().split(' ').join('_')}`)}
+
({
ruleEnabled ? '!bg-accent !text-white' : 'text-ink'
)}
>
- {ruleEnabled ? 'Enabled' : 'Disabled'}
+ {ruleEnabled ? t('enabled') : t('disabled')}
{ruleIsSystem(rule) && (
- System
+ {t('system')}
)}
diff --git a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RuleInput.tsx b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RuleInput.tsx
index 6618e46f2b50..e2efa175b478 100644
--- a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RuleInput.tsx
+++ b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RuleInput.tsx
@@ -1,7 +1,8 @@
import clsx from 'clsx';
import { ChangeEvent, ChangeEventHandler, forwardRef, memo } from 'react';
import { Input, toast } from '@sd/ui';
-import { useOperatingSystem } from '~/hooks';
+import i18n from '~/app/I18n';
+import { useLocale, useOperatingSystem } from '~/hooks';
import { usePlatform } from '~/util/Platform';
import { openDirectoryPickerDialog } from '../openDirectoryPickerDialog';
@@ -27,7 +28,7 @@ export const validateInput = (
const regex = os === 'windows' ? /^\.[^<>:"/\\|?*\u0000-\u0031]+$/ : /^\.[^/\0\s]+$/;
return {
value: regex.test(value),
- message: value ? 'Invalid extension' : 'Value required'
+ message: value ? i18n.t('invalid_extension') : i18n.t('value_required')
};
}
case 'Name': {
@@ -35,7 +36,7 @@ export const validateInput = (
const regex = os === 'windows' ? /^[^<>:"/\\|?*\u0000-\u0031]+$/ : /^[^/\0]+$/;
return {
value: regex.test(value),
- message: value ? 'Invalid name' : 'Value required'
+ message: value ? i18n.t('invalid_name') : i18n.t('value_required')
};
}
case 'Path': {
@@ -46,14 +47,14 @@ export const validateInput = (
: /^[^\0]+$/;
return {
value: regex?.test(value) || false,
- message: value ? 'Invalid path' : 'Value required'
+ message: value ? i18n.t('invalid_path') : i18n.t('value_required')
};
}
case 'Advanced': {
const regex = os === 'windows' ? /^[^<>:"\u0000-\u0031]+$/ : /^[^\0]+/;
return {
value: regex.test(value),
- message: value ? 'Invalid glob' : 'Value required'
+ message: value ? i18n.t('invalid_glob') : i18n.t('value_required')
};
}
default:
@@ -66,6 +67,7 @@ export const RuleInput = memo(
const os = useOperatingSystem(true);
const platform = usePlatform();
const isWeb = platform.platform === 'web';
+ const { t } = useLocale();
switch (props.kind) {
case 'Name':
@@ -79,7 +81,7 @@ export const RuleInput = memo(
}
}}
// TODO: The check here shouldn't be for which os the UI is running, but for which os the node is running
- placeholder="File/Directory name"
+ placeholder={t('file_directory_name')}
{...props}
/>
);
@@ -93,8 +95,8 @@ export const RuleInput = memo(
props.onBlur?.(event);
}
}}
- aria-label="Add a file extension to the current rule"
- placeholder="File extension (e.g., .mp4, .jpg, .txt)"
+ aria-label={t('add_file_extension_rule')}
+ placeholder={t('file_extension_description')}
{...props}
/>
);
@@ -148,7 +150,7 @@ export const RuleInput = memo(
props.onBlur?.(event);
}
}}
- placeholder="Glob (e.g., **/.git)"
+ placeholder={t('glob_description')}
{...props}
/>
);
diff --git a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RulesForm.tsx b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RulesForm.tsx
index cbadc5abf8b5..b3946bb1ecf8 100644
--- a/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RulesForm.tsx
+++ b/interface/app/$libraryId/settings/library/locations/IndexerRuleEditor/RulesForm.tsx
@@ -140,12 +140,12 @@ const RulesForm = ({ onSubmitted }: Props) => {
document.body
)}
- Name
+ {t('name')}
@@ -186,7 +186,7 @@ const RulesForm = ({ onSubmitted }: Props) => {
>
{selectValues.map((value) => (
- {value}
+ {t(`${value.toLowerCase()}`)}
))}
diff --git a/interface/app/$libraryId/settings/library/sync.tsx b/interface/app/$libraryId/settings/library/sync.tsx
index 6661f51086bb..37750f75171f 100644
--- a/interface/app/$libraryId/settings/library/sync.tsx
+++ b/interface/app/$libraryId/settings/library/sync.tsx
@@ -45,8 +45,8 @@ export const Component = () => {
{syncEnabled.data === false ? (
@@ -69,11 +69,11 @@ export const Component = () => {
mini
title={
<>
- Ingester
+ {t('ingester')}
>
}
- description="This process takes sync operations from P2P connections and Spacedrive Cloud and applies them to the library."
+ description={t('injester_description')}
>
{data[ACTORS.Ingest] ? (
@@ -94,6 +94,7 @@ export const Component = () => {
function SyncBackfillDialog(props: UseDialogProps & { onEnabled: () => void }) {
const form = useZodForm({ schema: z.object({}) });
const dialog = useDialog(props);
+ const {t} = useLocale();
const enableSync = useLibraryMutation(['sync.backfill'], {});
@@ -111,8 +112,8 @@ function SyncBackfillDialog(props: UseDialogProps & { onEnabled: () => void }) {
return (