From c58148af355c3856810d894363d7c3be81463348 Mon Sep 17 00:00:00 2001 From: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com> Date: Mon, 1 Jul 2024 00:29:10 +0200 Subject: [PATCH] feat(web): add more translations (#10700) * feat(web): add more translations * formatting --- .../admin-page/delete-confirm-dialogue.svelte | 2 +- .../settings/auth/auth-settings.svelte | 2 +- .../library-settings/library-settings.svelte | 2 +- .../settings/map-settings/map-settings.svelte | 17 +++++++----- .../supported-datetime-panel.svelte | 6 ++--- .../detail-panel-description.svelte | 2 +- .../asset-viewer/panorama-viewer.svelte | 3 ++- .../faces-page/person-side-panel.svelte | 14 +++++----- .../shared-components/status-box.svelte | 7 ++++- .../upload-asset-preview.svelte | 4 +-- .../shared-components/user-avatar.svelte | 3 ++- .../version-announcement-box.svelte | 2 +- .../user-settings-page/device-card.svelte | 2 +- web/src/lib/i18n/en.json | 26 ++++++++++++++++++- web/src/lib/stores/assets.store.ts | 6 +++-- web/src/lib/utils/file-uploader.ts | 15 ++++++----- .../[[assetId=id]]/+page.svelte | 4 +-- .../[[assetId=id]]/+page.svelte | 8 +++--- web/src/routes/+layout.svelte | 2 +- .../routes/admin/user-management/+page.svelte | 16 ++++-------- 20 files changed, 90 insertions(+), 53 deletions(-) diff --git a/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte b/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte index 6bc02046c5..e8490339a6 100644 --- a/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte +++ b/web/src/lib/components/admin-page/delete-confirm-dialogue.svelte @@ -74,7 +74,7 @@
{ diff --git a/web/src/lib/components/admin-page/settings/auth/auth-settings.svelte b/web/src/lib/components/admin-page/settings/auth/auth-settings.svelte index a259dfb9b6..59cc5a9f45 100644 --- a/web/src/lib/components/admin-page/settings/auth/auth-settings.svelte +++ b/web/src/lib/components/admin-page/settings/auth/auth-settings.svelte @@ -51,7 +51,7 @@ >
-

Are you sure you want to disable all login methods? Login will be completely disabled.

+

{$t('admin.authentication_settings_disable_all')}

- Manage {$t('admin.map_reverse_geocoding')} settings + + + {message} + +

diff --git a/web/src/lib/components/admin-page/settings/storage-template/supported-datetime-panel.svelte b/web/src/lib/components/admin-page/settings/storage-template/supported-datetime-panel.svelte index e505f035de..10f22c1805 100644 --- a/web/src/lib/components/admin-page/settings/storage-template/supported-datetime-panel.svelte +++ b/web/src/lib/components/admin-page/settings/storage-template/supported-datetime-panel.svelte @@ -12,13 +12,13 @@
-

DATE & TIME

+

{$t('date_and_time').toUpperCase()}

-

Asset's creation timestamp is used for the datetime information

-

Sample time 2022-02-03T04:56:05.250

+

{$t('admin.storage_template_date_time_description')}

+

{$t('admin.storage_template_date_time_sample', { values: { date: '2022-02-03T04:56:05.250' } })}

diff --git a/web/src/lib/components/asset-viewer/detail-panel-description.svelte b/web/src/lib/components/asset-viewer/detail-panel-description.svelte index 5a5bd61439..b916733476 100644 --- a/web/src/lib/components/asset-viewer/detail-panel-description.svelte +++ b/web/src/lib/components/asset-viewer/detail-panel-description.svelte @@ -18,7 +18,7 @@ await updateAsset({ id: asset.id, updateAssetDto: { description: newDescription } }); notificationController.show({ type: NotificationType.Info, - message: 'Asset description has been updated', + message: $t('asset_description_updated'), }); } catch (error) { handleError(error, $t('cannot_update_the_description')); diff --git a/web/src/lib/components/asset-viewer/panorama-viewer.svelte b/web/src/lib/components/asset-viewer/panorama-viewer.svelte index c913e69bc8..71ed4b8997 100644 --- a/web/src/lib/components/asset-viewer/panorama-viewer.svelte +++ b/web/src/lib/components/asset-viewer/panorama-viewer.svelte @@ -4,6 +4,7 @@ import type { AdapterConstructor, PluginConstructor } from '@photo-sphere-viewer/core'; import { fade } from 'svelte/transition'; import LoadingSpinner from '../shared-components/loading-spinner.svelte'; + import { t } from 'svelte-i18n'; export let asset: Pick; const photoSphereConfigs = @@ -35,6 +36,6 @@ {:then [data, module, adapter, plugins, navbar]} {:catch} - Failed to load asset + {$t('errors.failed_to_load_asset')} {/await}
diff --git a/web/src/lib/components/faces-page/person-side-panel.svelte b/web/src/lib/components/faces-page/person-side-panel.svelte index 103f3f9a6b..735e6ff654 100644 --- a/web/src/lib/components/faces-page/person-side-panel.svelte +++ b/web/src/lib/components/faces-page/person-side-panel.svelte @@ -209,7 +209,7 @@
{:else} {#each peopleWithFaces as face, index} - {@const personName = face.person ? face.person?.name : 'Unassigned'} + {@const personName = face.person ? face.person?.name : $t('face_unassigned')}
{personName} + {personName} {/if}

{/if} @@ -322,7 +322,7 @@
- +
{/if}
diff --git a/web/src/lib/components/shared-components/status-box.svelte b/web/src/lib/components/shared-components/status-box.svelte index cd13b3d251..6427f1e08c 100644 --- a/web/src/lib/components/shared-components/status-box.svelte +++ b/web/src/lib/components/shared-components/status-box.svelte @@ -57,7 +57,12 @@
diff --git a/web/src/lib/components/shared-components/upload-asset-preview.svelte b/web/src/lib/components/shared-components/upload-asset-preview.svelte index a970ca2d4c..d3f12555c7 100644 --- a/web/src/lib/components/shared-components/upload-asset-preview.svelte +++ b/web/src/lib/components/shared-components/upload-asset-preview.svelte @@ -67,7 +67,7 @@ {:else if uploadAsset.state === UploadState.DUPLICATED}

- Skipped + {$t('asset_skipped')} {#if uploadAsset.message} ({uploadAsset.message}) {/if} @@ -75,7 +75,7 @@ {:else if uploadAsset.state === UploadState.DONE}

- Uploaded + {$t('asset_uploaded')} {#if uploadAsset.message} ({uploadAsset.message}) {/if} diff --git a/web/src/lib/components/shared-components/user-avatar.svelte b/web/src/lib/components/shared-components/user-avatar.svelte index 02f4ca93f2..0cb8ee9f77 100644 --- a/web/src/lib/components/shared-components/user-avatar.svelte +++ b/web/src/lib/components/shared-components/user-avatar.svelte @@ -5,6 +5,7 @@ @@ -57,7 +59,7 @@

{$t('password_required')}
- Please enter the password to view this page. + {$t('sharing_enter_password')}
diff --git a/web/src/routes/+layout.svelte b/web/src/routes/+layout.svelte index 7fabc86e85..fbbc58664d 100644 --- a/web/src/routes/+layout.svelte +++ b/web/src/routes/+layout.svelte @@ -78,7 +78,7 @@ try { await loadConfig(); } catch (error) { - handleError(error, 'Unable to connect to server'); + handleError(error, $t('errors.unable_to_connect_to_server')); } }); diff --git a/web/src/routes/admin/user-management/+page.svelte b/web/src/routes/admin/user-management/+page.svelte index 6168a07366..4e8c6a1488 100644 --- a/web/src/routes/admin/user-management/+page.svelte +++ b/web/src/routes/admin/user-management/+page.svelte @@ -59,16 +59,8 @@ return websocketEvents.on('on_user_delete', onDeleteSuccess); }); - const deleteDateFormat: Intl.DateTimeFormatOptions = { - month: 'long', - day: 'numeric', - year: 'numeric', - }; - - const getDeleteDate = (deletedAt: string): string => { - return DateTime.fromISO(deletedAt) - .plus({ days: $serverConfig.userDeleteDelay }) - .toLocaleString(deleteDateFormat, { locale: $locale }); + const getDeleteDate = (deletedAt: string): Date => { + return DateTime.fromISO(deletedAt).plus({ days: $serverConfig.userDeleteDelay }).toJSDate(); }; const onUserCreated = async () => { @@ -245,7 +237,9 @@ {#if immichUser.deletedAt && immichUser.status === UserStatus.Deleted} restoreUserHandler(immichUser)}