Skip to content

Commit

Permalink
feat(web): translations (#9854)
Browse files Browse the repository at this point in the history
* First test

* Added translation using Weblate (French)

* Translated using Weblate (German)

Currently translated at 100.0% (4 of 4 strings)

Translation: immich/web
Translate-URL: http://familie-mach.net/projects/immich/web/de/

* Translated using Weblate (French)

Currently translated at 100.0% (4 of 4 strings)

Translation: immich/web
Translate-URL: http://familie-mach.net/projects/immich/web/fr/

* Further testing

* Further testing

* Translated using Weblate (German)

Currently translated at 100.0% (18 of 18 strings)

Translation: immich/web
Translate-URL: http://familie-mach.net/projects/immich/web/de/

* Further work

* Update string file.

* More strings

* Automatically changed strings

* Add automatically translated german file for testing purposes

* Fix merge-face-selector component

* Make server stats strings uppercase

* Fix uppercase string

* Fix some strings in jobs-panel

* Fix lower and uppercase strings. Add a few additional string. Fix a few unnecessary replacements

* Update german test translations

* Fix typo in locales file

* Change string keys

* Extract more strings

* Extract and replace some more strings

* Update testtranslationfile

* Change translation keys

* Fix rebase errors

* Fix one more rebase error

* Remove german translation file

* Co-authored-by: Daniel Dietzler <[email protected]>

* chore: clean up translations

* chore: add new line

* fix formatting

* chore: fixes

* fix: loading and tests

---------

Co-authored-by: root <root@Blacki>
Co-authored-by: admin <[email protected]>
Co-authored-by: Jason Rasmussen <[email protected]>
Co-authored-by: Daniel Dietzler <[email protected]>
  • Loading branch information
5 people authored Jun 4, 2024
1 parent a2bccf2 commit f446bc8
Show file tree
Hide file tree
Showing 177 changed files with 2,779 additions and 1,017 deletions.
635 changes: 625 additions & 10 deletions web/package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
"luxon": "^3.4.4",
"socket.io-client": "^4.7.4",
"svelte-local-storage-store": "^0.6.4",
"svelte-i18n": "^4.0.0",
"svelte-maplibre": "^0.9.0",
"thumbhash": "^0.1.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import { serverConfig } from '$lib/stores/server-config.store';
import { createEventDispatcher } from 'svelte';
import Checkbox from '$lib/components/elements/checkbox.svelte';
import { t } from 'svelte-i18n';
export let user: UserResponseDto;
Expand All @@ -31,7 +32,7 @@
dispatch('success');
}
} catch (error) {
handleError(error, 'Unable to delete user');
handleError(error, $t('errors.unable_to_delete_user'));
dispatch('fail');
}
};
Expand All @@ -43,8 +44,8 @@
</script>

<ConfirmDialog
title="Delete user"
confirmText={forceDelete ? 'Permanently Delete' : 'Delete'}
title={$t('delete_user')}
confirmText={forceDelete ? $t('permanently_delete') : $t('delete')}
onConfirm={handleDeleteUser}
onCancel={() => dispatch('cancel')}
disabled={deleteButtonDisabled}
Expand Down
11 changes: 6 additions & 5 deletions web/src/lib/components/admin-page/jobs/job-tile.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import JobTileButton from './job-tile-button.svelte';
import JobTileStatus from './job-tile-status.svelte';
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
import { t } from 'svelte-i18n';
export let title: string;
export let subtitle: string | undefined;
Expand Down Expand Up @@ -43,9 +44,9 @@
>
<div class="flex w-full flex-col">
{#if queueStatus.isPaused}
<JobTileStatus color="warning">Paused</JobTileStatus>
<JobTileStatus color="warning">{$t('paused')}</JobTileStatus>
{:else if queueStatus.isActive}
<JobTileStatus color="success">Active</JobTileStatus>
<JobTileStatus color="success">{$t('active')}</JobTileStatus>
{/if}
<div class="flex flex-col gap-2 p-5 sm:p-7 md:p-9">
<div class="flex items-center gap-4 text-xl font-semibold text-immich-primary dark:text-immich-dark-primary">
Expand All @@ -63,7 +64,7 @@
<CircleIconButton
color="primary"
icon={mdiClose}
title="Clear message"
title={$t('clear_message')}
size="12"
padding="1"
on:click={() => dispatch('command', { command: JobCommand.ClearFailed, force: false })}
Expand Down Expand Up @@ -95,7 +96,7 @@
<div
class="{commonClasses} rounded-t-lg bg-immich-primary text-white dark:bg-immich-dark-primary dark:text-immich-dark-gray sm:rounded-l-lg sm:rounded-r-none"
>
<p>Active</p>
<p>{$t('active')}</p>
<p class="text-2xl">
{jobCounts.active.toLocaleString($locale)}
</p>
Expand All @@ -107,7 +108,7 @@
<p class="text-2xl">
{waitingCount.toLocaleString($locale)}
</p>
<p>Waiting</p>
<p>{$t('waiting')}</p>
</div>
</div>
</div>
Expand Down
29 changes: 15 additions & 14 deletions web/src/lib/components/admin-page/jobs/jobs-panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import JobTile from './job-tile.svelte';
import StorageMigrationDescription from './storage-migration-description.svelte';
import { dialogController } from '$lib/components/shared-components/dialog/dialog';
import { t } from 'svelte-i18n';
export let jobs: AllJobStatusResponseDto;
Expand Down Expand Up @@ -60,38 +61,38 @@
[JobName.ThumbnailGeneration]: {
icon: mdiFileJpgBox,
title: getJobName(JobName.ThumbnailGeneration),
subtitle: 'Generate large, small and blurred thumbnails for each asset, as well as thumbnails for each person',
subtitle: $t('thumbnail_generation_job_description'),
},
[JobName.MetadataExtraction]: {
icon: mdiTable,
title: getJobName(JobName.MetadataExtraction),
subtitle: 'Extract metadata information from each asset, such as GPS and resolution',
subtitle: $t('metadata_extraction_job_description'),
},
[JobName.Library]: {
icon: mdiLibraryShelves,
title: getJobName(JobName.Library),
subtitle: 'Perform library tasks',
allText: 'ALL',
missingText: 'REFRESH',
subtitle: $t('perform_library_tasks'),
allText: $t('all').toUpperCase(),
missingText: $t('refresh').toUpperCase(),
},
[JobName.Sidecar]: {
title: getJobName(JobName.Sidecar),
icon: mdiFileXmlBox,
subtitle: 'Discover or synchronize sidecar metadata from the filesystem',
allText: 'SYNC',
missingText: 'DISCOVER',
subtitle: $t('sidecar_job_description'),
allText: $t('sync').toUpperCase(),
missingText: $t('discover').toUpperCase(),
disabled: !$featureFlags.sidecar,
},
[JobName.SmartSearch]: {
icon: mdiImageSearch,
title: getJobName(JobName.SmartSearch),
subtitle: 'Run machine learning on assets to support smart search',
subtitle: $t('smart_search_job_description'),
disabled: !$featureFlags.smartSearch,
},
[JobName.DuplicateDetection]: {
icon: mdiContentDuplicate,
title: getJobName(JobName.DuplicateDetection),
subtitle: 'Run machine learning on assets to detect similar images. Relies on Smart Search',
subtitle: $t('duplicate_detection_job_description'),
disabled: !$featureFlags.duplicateDetection,
},
[JobName.FaceDetection]: {
Expand All @@ -113,7 +114,7 @@
[JobName.VideoConversion]: {
icon: mdiVideo,
title: getJobName(JobName.VideoConversion),
subtitle: 'Transcode videos for wider compatibility with browsers and devices',
subtitle: $t('video_conversion_job_description'),
},
[JobName.StorageTemplateMigration]: {
icon: mdiFolderMove,
Expand All @@ -124,7 +125,7 @@
[JobName.Migration]: {
icon: mdiFolderMove,
title: getJobName(JobName.Migration),
subtitle: 'Migrate thumbnails for assets and faces to the latest folder structure',
subtitle: $t('migration_job_description'),
allowForceCommand: false,
},
};
Expand Down Expand Up @@ -159,8 +160,8 @@
{title}
{disabled}
{subtitle}
allText={allText || 'ALL'}
missingText={missingText || 'MISSING'}
allText={allText || $t('all').toUpperCase()}
missingText={missingText || $t('missing').toUpperCase()}
{allowForceCommand}
{jobCounts}
{queueStatus}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
import { AppRoute } from '$lib/constants';
import { t } from 'svelte-i18n';
</script>

Apply the current
<a href="{AppRoute.ADMIN_SETTINGS}?open=storageTemplate" class="text-immich-primary dark:text-immich-dark-primary"
>Storage template</a
>{$t('storage_template_settings')}</a
>
to previously uploaded assets
7 changes: 4 additions & 3 deletions web/src/lib/components/admin-page/restore-dialogue.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import { handleError } from '$lib/utils/handle-error';
import { restoreUserAdmin, type UserResponseDto } from '@immich/sdk';
import { createEventDispatcher } from 'svelte';
import { t } from 'svelte-i18n';
export let user: UserResponseDto;
Expand All @@ -21,15 +22,15 @@
dispatch('fail');
}
} catch (error) {
handleError(error, 'Unable to restore user');
handleError(error, $t('errors.unable_to_restore_user'));
dispatch('fail');
}
};
</script>

<ConfirmDialog
title="Restore user"
confirmText="Continue"
title={$t('restore_user')}
confirmText={$t('continue')}
confirmColor="green"
onConfirm={handleRestoreUser}
onCancel={() => dispatch('cancel')}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import type { ServerStatsResponseDto } from '@immich/sdk';
import { mdiCameraIris, mdiChartPie, mdiPlayCircle } from '@mdi/js';
import StatsCard from './stats-card.svelte';
import { t } from 'svelte-i18n';
export let stats: ServerStatsResponseDto = {
photos: 0,
Expand All @@ -27,19 +28,19 @@

<div class="flex flex-col gap-5">
<div>
<p class="text-sm dark:text-immich-dark-fg">TOTAL USAGE</p>
<p class="text-sm dark:text-immich-dark-fg">{$t('total_usage').toUpperCase()}</p>

<div class="mt-5 hidden justify-between lg:flex">
<StatsCard icon={mdiCameraIris} title="PHOTOS" value={stats.photos} />
<StatsCard icon={mdiPlayCircle} title="VIDEOS" value={stats.videos} />
<StatsCard icon={mdiChartPie} title="STORAGE" value={statsUsage} unit={statsUsageUnit} />
<StatsCard icon={mdiCameraIris} title={$t('photos').toUpperCase()} value={stats.photos} />
<StatsCard icon={mdiPlayCircle} title={$t('videos').toUpperCase()} value={stats.videos} />
<StatsCard icon={mdiChartPie} title={$t('storage').toUpperCase()} value={statsUsage} unit={statsUsageUnit} />
</div>
<div class="mt-5 flex lg:hidden">
<div class="flex flex-col justify-between rounded-3xl bg-immich-gray p-5 dark:bg-immich-dark-gray">
<div class="flex flex-wrap gap-x-12">
<div class="flex place-items-center gap-4 text-immich-primary dark:text-immich-dark-primary">
<Icon path={mdiCameraIris} size="25" />
<p>PHOTOS</p>
<p>{$t('photos').toUpperCase()}</p>
</div>

<div class="relative text-center font-mono text-2xl font-semibold">
Expand All @@ -51,7 +52,7 @@
<div class="flex flex-wrap gap-x-12">
<div class="flex place-items-center gap-4 text-immich-primary dark:text-immich-dark-primary">
<Icon path={mdiPlayCircle} size="25" />
<p>VIDEOS</p>
<p>{$t('videos').toUpperCase()}</p>
</div>

<div class="relative text-center font-mono text-2xl font-semibold">
Expand All @@ -63,7 +64,7 @@
<div class="flex flex-wrap gap-x-7">
<div class="flex place-items-center gap-4 text-immich-primary dark:text-immich-dark-primary">
<Icon path={mdiChartPie} size="25" />
<p>STORAGE</p>
<p>{$t('storage').toUpperCase()}</p>
</div>

<div class="relative flex text-center font-mono text-2xl font-semibold">
Expand All @@ -78,16 +79,16 @@
</div>

<div>
<p class="text-sm dark:text-immich-dark-fg">USER USAGE DETAIL</p>
<p class="text-sm dark:text-immich-dark-fg">{$t('user_usage_detail').toUpperCase()}</p>
<table class="mt-5 w-full text-left">
<thead
class="mb-4 flex h-12 w-full rounded-md border bg-gray-50 text-immich-primary dark:border-immich-dark-gray dark:bg-immich-dark-gray dark:text-immich-dark-primary"
>
<tr class="flex w-full place-items-center">
<th class="w-1/4 text-center text-sm font-medium">User</th>
<th class="w-1/4 text-center text-sm font-medium">Photos</th>
<th class="w-1/4 text-center text-sm font-medium">Videos</th>
<th class="w-1/4 text-center text-sm font-medium">Usage</th>
<th class="w-1/4 text-center text-sm font-medium">{$t('user')}</th>
<th class="w-1/4 text-center text-sm font-medium">{$t('photos')}</th>
<th class="w-1/4 text-center text-sm font-medium">{$t('videos')}</th>
<th class="w-1/4 text-center text-sm font-medium">{$t('usage')}</th>
</tr>
</thead>
<tbody
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import { cloneDeep } from 'lodash-es';
import { createEventDispatcher, onMount } from 'svelte';
import type { SettingsEventType } from './admin-settings';
import { t } from 'svelte-i18n';
export let config: SystemConfigDto;
Expand All @@ -34,13 +35,13 @@
config = cloneDeep(newConfig);
savedConfig = cloneDeep(newConfig);
notificationController.show({ message: 'Settings saved', type: NotificationType.Info });
notificationController.show({ message: $t('settings_saved'), type: NotificationType.Info });
await loadConfig();
dispatch('save');
} catch (error) {
handleError(error, 'Unable to save settings');
handleError(error, $t('errors.unable_to_save_settings'));
}
};
Expand All @@ -63,7 +64,7 @@
}
notificationController.show({
message: 'Reset settings to default',
message: $t('reset_settings_to_default'),
type: NotificationType.Info,
});
};
Expand Down
Loading

0 comments on commit f446bc8

Please sign in to comment.