chore(web): translations in page load functions (#10260)
This commit is contained in:
@@ -2,12 +2,15 @@ import { getAssetThumbnailUrl, setSharedLink } from '$lib/utils';
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getMySharedLink, isHttpError } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
const { key } = params;
|
||||
await authenticate({ public: true });
|
||||
const asset = await getAssetInfoFromParam(params);
|
||||
const $t = get(t);
|
||||
|
||||
try {
|
||||
const sharedLink = await getMySharedLink({ key });
|
||||
@@ -20,8 +23,8 @@ export const load = (async ({ params }) => {
|
||||
asset,
|
||||
key,
|
||||
meta: {
|
||||
title: sharedLink.album ? sharedLink.album.albumName : 'Public Share',
|
||||
description: sharedLink.description || `${assetCount} shared photos & videos.`,
|
||||
title: sharedLink.album ? sharedLink.album.albumName : $t('public_share'),
|
||||
description: sharedLink.description || $t('shared_photos_and_videos_count', { values: { assetCount } }),
|
||||
imageUrl: assetId ? getAssetThumbnailUrl(assetId) : '/feature-panel.png',
|
||||
},
|
||||
};
|
||||
@@ -31,7 +34,7 @@ export const load = (async ({ params }) => {
|
||||
passwordRequired: true,
|
||||
sharedLinkKey: key,
|
||||
meta: {
|
||||
title: 'Password Required',
|
||||
title: $t('password_required'),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user