feat(web): translations (#9854)

* 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 <danieldietzler@users.noreply.github.com>

* 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 <admin@example.com>
Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
Co-authored-by: Daniel Dietzler <mail@ddietzler.dev>
This commit is contained in:
Manic-87
2024-06-04 21:53:00 +02:00
committed by GitHub
parent a2bccf23c9
commit f446bc8caa
177 changed files with 2779 additions and 1017 deletions
+16 -15
View File
@@ -34,6 +34,7 @@
import { clearQueryParam } from '$lib/utils/navigation';
import SearchPeople from '$lib/components/faces-page/people-search.svelte';
import LinkButton from '$lib/components/elements/buttons/link-button.svelte';
import { t } from 'svelte-i18n';
export let data: PageData;
@@ -204,11 +205,11 @@
}
countTotalPeople--;
notificationController.show({
message: 'Merge people successfully',
message: $t('merge_people_successfully'),
type: NotificationType.Info,
});
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
if (personToBeMergedIn.name !== personName && edittingPerson.id === personToBeMergedIn.id) {
/*
@@ -227,14 +228,14 @@
}
}
notificationController.show({
message: 'Change name successfully',
message: $t('change_name_successfully'),
type: NotificationType.Info,
});
// trigger reactivity
people = people;
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
}
};
@@ -274,11 +275,11 @@
showChangeNameModal = false;
countHiddenPeople++;
notificationController.show({
message: 'Changed visibility successfully',
message: $t('changed_visibility_successfully'),
type: NotificationType.Info,
});
} catch (error) {
handleError(error, 'Unable to hide person');
handleError(error, $t('unable_to_hide_person'));
}
};
@@ -349,7 +350,7 @@
type: NotificationType.Info,
});
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
};
@@ -372,11 +373,11 @@
return person;
});
notificationController.show({
message: 'Change name successfully',
message: $t('change_name_successfully'),
type: NotificationType.Info,
});
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
};
@@ -399,7 +400,7 @@
{/if}
<UserPageLayout
title="People"
title={$t('people')}
description={countVisiblePeople === 0 && !searchName ? undefined : `(${countVisiblePeople.toLocaleString($locale)})`}
>
<svelte:fragment slot="buttons">
@@ -409,7 +410,7 @@
<div class="w-40 lg:w-80 h-10">
<SearchPeople
type="searchBar"
placeholder="Search people"
placeholder={$t('search_people')}
onReset={onResetSearchBar}
onSearch={handleSearch}
bind:searchName
@@ -453,10 +454,10 @@
{/if}
{#if showChangeNameModal}
<FullScreenModal title="Change name" onClose={() => (showChangeNameModal = false)}>
<FullScreenModal title={$t('change_name')} onClose={() => (showChangeNameModal = false)}>
<form on:submit|preventDefault={submitNameChange} autocomplete="off" id="change-name-form">
<div class="flex flex-col gap-2">
<label class="immich-form-label" for="name">Name</label>
<label class="immich-form-label" for="name">{$t('name')}</label>
<input
class="immich-form-input"
id="name"
@@ -473,9 +474,9 @@
fullwidth
on:click={() => {
showChangeNameModal = false;
}}>Cancel</Button
}}>{$t('cancel')}</Button
>
<Button type="submit" fullwidth form="change-name-form">Ok</Button>
<Button type="submit" fullwidth form="change-name-form">{$t('ok')}</Button>
</svelte:fragment>
</FullScreenModal>
{/if}
@@ -56,6 +56,7 @@
import { onMount } from 'svelte';
import type { PageData } from './$types';
import { listNavigation } from '$lib/actions/list-navigation';
import { t } from 'svelte-i18n';
export let data: PageData;
@@ -182,13 +183,13 @@
});
notificationController.show({
message: 'Changed visibility successfully',
message: $t('changed_visibility_successfully'),
type: NotificationType.Info,
});
await goto(previousRoute, { replaceState: true });
} catch (error) {
handleError(error, 'Unable to hide person');
handleError(error, $t('unable_to_hide_person'));
}
};
@@ -208,7 +209,7 @@
await updatePerson({ id: data.person.id, personUpdateDto: { featureFaceAssetId: asset.id } });
notificationController.show({ message: 'Feature photo updated', type: NotificationType.Info });
notificationController.show({ message: $t('feature_photo_updated'), type: NotificationType.Info });
assetInteractionStore.clearMultiselect();
viewMode = ViewMode.VIEW_ASSETS;
@@ -224,7 +225,7 @@
mergePersonDto: { ids: [personToMerge.id] },
});
notificationController.show({
message: 'Merge people successfully',
message: $t('merge_people_successfully'),
type: NotificationType.Info,
});
people = people.filter((person: PersonResponseDto) => person.id !== personToMerge.id);
@@ -235,7 +236,7 @@
}
await goto(`${AppRoute.PEOPLE}/${personToBeMergedIn.id}`, { replaceState: true });
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
};
@@ -257,11 +258,11 @@
await updatePerson({ id: data.person.id, personUpdateDto: { name: personName } });
notificationController.show({
message: 'Change name successfully',
message: $t('change_name_successfully'),
type: NotificationType.Info,
});
} catch (error) {
handleError(error, 'Unable to save name');
handleError(error, $t('unable_to_save_name'));
}
};
@@ -379,14 +380,18 @@
<AssetSelectControlBar assets={$selectedAssets} clearSelect={() => assetInteractionStore.clearMultiselect()}>
<CreateSharedLink />
<SelectAllAssets {assetStore} {assetInteractionStore} />
<AssetSelectContextMenu icon={mdiPlus} title="Add to...">
<AssetSelectContextMenu icon={mdiPlus} title={$t('add_to')}>
<AddToAlbum />
<AddToAlbum shared />
</AssetSelectContextMenu>
<FavoriteAction removeFavorite={isAllFavorite} onFavorite={() => assetStore.triggerUpdate()} />
<AssetSelectContextMenu icon={mdiDotsVertical} title="Add">
<AssetSelectContextMenu icon={mdiDotsVertical} title={$t('add')}>
<DownloadAction menuItem filename="{data.person.name || 'immich'}.zip" />
<MenuOption icon={mdiAccountMultipleCheckOutline} text="Fix incorrect match" on:click={handleReassignAssets} />
<MenuOption
icon={mdiAccountMultipleCheckOutline}
text={$t('fix_incorrect_match')}
on:click={handleReassignAssets}
/>
<ChangeDate menuItem />
<ChangeLocation menuItem />
<ArchiveAction menuItem unarchive={isAllArchive} onArchive={(assetIds) => $assetStore.removeAssets(assetIds)} />
@@ -397,24 +402,24 @@
{#if viewMode === ViewMode.VIEW_ASSETS || viewMode === ViewMode.SUGGEST_MERGE || viewMode === ViewMode.BIRTH_DATE}
<ControlAppBar showBackButton backIcon={mdiArrowLeft} on:close={() => goto(previousRoute)}>
<svelte:fragment slot="trailing">
<AssetSelectContextMenu icon={mdiDotsVertical} title="Menu">
<AssetSelectContextMenu icon={mdiDotsVertical} title={$t('menu')}>
<MenuOption
text="Select featured photo"
text={$t('select_featured_photo')}
icon={mdiAccountBoxOutline}
on:click={() => (viewMode = ViewMode.SELECT_PERSON)}
/>
<MenuOption
text={data.person.isHidden ? 'Unhide person' : 'Hide person'}
text={data.person.isHidden ? $t('unhide_person') : $t('hide_person')}
icon={data.person.isHidden ? mdiEyeOutline : mdiEyeOffOutline}
on:click={() => toggleHidePerson()}
/>
<MenuOption
text="Set date of birth"
text={$t('set_date_of_birth')}
icon={mdiCalendarEditOutline}
on:click={() => (viewMode = ViewMode.BIRTH_DATE)}
/>
<MenuOption
text="Merge people"
text={$t('merge_people')}
icon={mdiAccountMultipleCheckOutline}
on:click={() => (viewMode = ViewMode.MERGE_PEOPLE)}
/>
@@ -425,7 +430,7 @@
{#if viewMode === ViewMode.SELECT_PERSON}
<ControlAppBar on:close={() => (viewMode = ViewMode.VIEW_ASSETS)}>
<svelte:fragment slot="leading">Select featured photo</svelte:fragment>
<svelte:fragment slot="leading">{$t('select_featured_photo')}</svelte:fragment>
</ControlAppBar>
{/if}
{/if}
@@ -466,7 +471,7 @@
<button
type="button"
class="flex items-center justify-center"
title="Edit name"
title={$t('edit_name')}
on:click={() => (isEditingName = true)}
>
<ImageThumbnail
@@ -486,7 +491,7 @@
{`${numberOfAssets} asset${s(numberOfAssets)}`}
</p>
{:else}
<p class="font-medium">Add a name</p>
<p class="font-medium">{$t('add_a_name')}</p>
<p class="text-sm text-gray-500 dark:text-immich-gray">Find them fast by name with search</p>
{/if}
</div>