chore(web): translations in page load functions (#10260)
This commit is contained in:
@@ -1,15 +1,19 @@
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getAllPeople } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async () => {
|
||||
await authenticate();
|
||||
|
||||
const people = await getAllPeople({ withHidden: true });
|
||||
const $t = get(t);
|
||||
|
||||
return {
|
||||
people,
|
||||
meta: {
|
||||
title: 'People',
|
||||
title: $t('people'),
|
||||
},
|
||||
};
|
||||
}) satisfies PageLoad;
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { authenticate } from '$lib/utils/auth';
|
||||
import { getAssetInfoFromParam } from '$lib/utils/navigation';
|
||||
import { getPerson, getPersonStatistics } from '@immich/sdk';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import type { PageLoad } from './$types';
|
||||
|
||||
export const load = (async ({ params }) => {
|
||||
@@ -11,13 +13,14 @@ export const load = (async ({ params }) => {
|
||||
getPersonStatistics({ id: params.personId }),
|
||||
getAssetInfoFromParam(params),
|
||||
]);
|
||||
const $t = get(t);
|
||||
|
||||
return {
|
||||
person,
|
||||
statistics,
|
||||
asset,
|
||||
meta: {
|
||||
title: person.name || 'Person',
|
||||
title: person.name || $t('person'),
|
||||
},
|
||||
};
|
||||
}) satisfies PageLoad;
|
||||
|
||||
Reference in New Issue
Block a user