chore(web): another missing translations (#10274)

* chore(web): another missing translations

* unused removed

* more keys

* lint fix

* test fixed

* dynamic translation fix

* fixes

* people search translation

* params fixed

* keep filter setting fix

* lint fix

* $t fixes

* Update web/src/lib/i18n/en.json

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>

* another missing

* activity translation

* link sharing translations

* expiration dropdown fix - didn't work localized

* notification title

* device logout

* search results

* reset to default

* unsaved change

* select from computer

* selected

* select-2

* select-3

* unmerge

* pluralize, force icu message

* Update web/src/lib/components/asset-viewer/asset-viewer.svelte

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>

* review fixes

* remove user

* plural fixes

* ffmpeg settings

* fixes

* error title

* plural fixes

* onboarding

* change password

* more more

* console log fix

* another

* api key desc

* map marker

* format fix

* key fix

* asset-utils

* utils

* misc

---------

Co-authored-by: Michel Heusschen <59014050+michelheusschen@users.noreply.github.com>
This commit is contained in:
waclaw66 2024-06-24 15:50:01 +02:00 committed by GitHub
parent df9e074304
commit dd2c7400a6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
90 changed files with 635 additions and 322 deletions

View file

@ -8,6 +8,7 @@
import { isTenMinutesApart } from '$lib/utils/timesince';
import {
ReactionType,
Type,
createActivity,
deleteActivity,
getActivities,
@ -41,7 +42,7 @@
const diff = dateTime.diffNow().shiftTo(...units);
const unit = units.find((unit) => diff.get(unit) !== 0) || 'second';
const relativeFormatter = new Intl.RelativeTimeFormat('en', {
const relativeFormatter = new Intl.RelativeTimeFormat($locale, {
numeric: 'auto',
});
return relativeFormatter.format(Math.trunc(diff.as(unit)), unit);
@ -115,8 +116,13 @@
} else {
dispatch('deleteComment');
}
const deleteMessages: Record<Type, string> = {
[Type.Comment]: $t('comment_deleted'),
[Type.Like]: $t('like_deleted'),
};
notificationController.show({
message: `${reaction.type} deleted`,
message: deleteMessages[reaction.type],
type: NotificationType.Info,
});
} catch (error) {
@ -216,7 +222,12 @@
<div class="text-red-600"><Icon path={mdiHeart} size={20} /></div>
<div class="w-full" title={`${reaction.user.name} (${reaction.user.email})`}>
{`${reaction.user.name} liked ${assetType ? `this ${getAssetType(assetType).toLowerCase()}` : 'it'}`}
{$t('user_liked', {
values: {
user: reaction.user.name,
type: assetType ? getAssetType(assetType).toLowerCase() : null,
},
})}
</div>
{#if assetId === undefined && reaction.assetId}
<a

View file

@ -1,10 +1,11 @@
<script lang="ts">
import type { AlbumResponseDto } from '@immich/sdk';
import { t } from 'svelte-i18n';
export let album: AlbumResponseDto;
</script>
<span>{album.assetCount} items</span>
<span>{$t('items_count', { values: { count: album.assetCount } })}</span>
{#if album.shared}
<span>• Shared</span>
<span>• {$t('shared')}</span>
{/if}

View file

@ -225,18 +225,18 @@
<MenuOption
icon={mdiDatabaseRefreshOutline}
onClick={() => onJobClick(AssetJobName.RefreshMetadata)}
text={getAssetJobName(AssetJobName.RefreshMetadata)}
text={$getAssetJobName(AssetJobName.RefreshMetadata)}
/>
<MenuOption
icon={mdiImageRefreshOutline}
onClick={() => onJobClick(AssetJobName.RegenerateThumbnail)}
text={getAssetJobName(AssetJobName.RegenerateThumbnail)}
text={$getAssetJobName(AssetJobName.RegenerateThumbnail)}
/>
{#if asset.type === AssetTypeEnum.Video}
<MenuOption
icon={mdiCogRefreshOutline}
onClick={() => onJobClick(AssetJobName.TranscodeVideo)}
text={getAssetJobName(AssetJobName.TranscodeVideo)}
text={$getAssetJobName(AssetJobName.TranscodeVideo)}
/>
{/if}
{/if}

View file

@ -162,7 +162,7 @@
reactions = [...reactions, isLiked];
}
} catch (error) {
handleError(error, "Can't change favorite for asset");
handleError(error, $t('errors.unable_to_change_favorite'));
}
}
};
@ -189,7 +189,7 @@
const { comments } = await getActivityStatistics({ assetId: asset.id, albumId: album.id });
numberOfComments = comments;
} catch (error) {
handleError(error, "Can't get number of comments");
handleError(error, $t('errors.unable_to_get_comments_number'));
}
}
};
@ -395,10 +395,10 @@
notificationController.show({
type: NotificationType.Info,
message: asset.isFavorite ? `Added to favorites` : `Removed from favorites`,
message: asset.isFavorite ? $t('added_to_favorites') : $t('removed_from_favorites'),
});
} catch (error) {
handleError(error, `Unable to ${asset.isFavorite ? `add asset to` : `remove asset from`} favorites`);
handleError(error, $t('errors.unable_to_add_remove_favorites', { values: { favorite: asset.isFavorite } }));
}
};
@ -429,7 +429,7 @@
notificationController.show({
type: NotificationType.Info,
message: `Restored asset`,
message: $t('restored_asset'),
});
} catch (error) {
handleError(error, $t('errors.unable_to_restore_assets'));
@ -446,9 +446,9 @@
const handleRunJob = async (name: AssetJobName) => {
try {
await runAssetJobs({ assetJobsDto: { assetIds: [asset.id], name } });
notificationController.show({ type: NotificationType.Info, message: getAssetJobMessage(name) });
notificationController.show({ type: NotificationType.Info, message: $getAssetJobMessage(name) });
} catch (error) {
handleError(error, `Unable to submit job`);
handleError(error, $t('errors.unable_to_submit_job'));
}
};
@ -528,7 +528,7 @@
timeout: 1500,
});
} catch (error) {
handleError(error, 'Unable to update album cover');
handleError(error, $t('errors.unable_to_update_album_cover'));
}
};

View file

@ -153,8 +153,7 @@
<div class="rounded-t bg-red-500 px-4 py-2 font-bold text-white">{$t('asset_offline')}</div>
<div class="rounded-b border border-t-0 border-red-400 bg-red-100 px-4 py-3 text-red-700">
<p>
This asset is offline. Immich can not access its file location. Please ensure the asset is available and
then rescan the library.
{$t('asset_offline_description')}
</p>
</div>
</div>
@ -170,8 +169,8 @@
<div class="flex gap-2 items-center">
{#if unassignedFaces.length > 0}
<Icon
ariaLabel="Asset has unassigned faces"
title="Asset has unassigned faces"
ariaLabel={$t('asset_has_unassigned_faces')}
title={$t('asset_has_unassigned_faces')}
color="currentColor"
path={mdiAccountOff}
size="24"
@ -243,11 +242,11 @@
)}
>
{#if ageInMonths <= 11}
Age {ageInMonths} months
{$t('age_months', { values: { months: ageInMonths } })}
{:else if ageInMonths > 12 && ageInMonths <= 23}
Age 1 year, {ageInMonths - 12} months
{$t('age_year_months', { values: { months: ageInMonths - 12 } })}
{:else}
Age {age}
{$t('age_years', { values: { years: age } })}
{/if}
</p>
{/if}
@ -452,7 +451,7 @@
target="_blank"
class="font-medium text-immich-primary"
>
Open in OpenStreetMap
{$t('open_in_openstreetmap')}
</a>
</div>
</svelte:fragment>