Vercel/src/i18n/state/index.ts
Sam Becker b3972a6032
Date-based photo sets (#276)
* Add 'recents' and 'years' categories

* Add recents and years visibility config

* Add fundamental recent/year queries

* Display initial date-based data in sidebar

* Adjust recents data type

* Remove date rage from sidebar footer

* Reformat recents/years in sidebar

* Organize years in grid

* Rename date -> year

* Add year-based views

* Split sidebar years into rows

* Add years to cmdk menu

* Localize 'years'

* Create /recents views

* Enable recents share modals

* Fix recents og image

* Statically optimize /recents image

* Don't statically optimize /recents page

* Update i18n

* Add recents to cmdk

* Suppress spinner for year badges

* Refactor sidebar height calculation

* Add recents to sitemap
2025-06-28 11:48:48 -05:00

54 lines
2.0 KiB
TypeScript

import { I18N } from '..';
export type AppTextState = ReturnType<typeof generateAppTextState>;
export const generateAppTextState = (i18n: I18N) => {
return {
...i18n,
category: {
...i18n.category,
yearTitle: (year: string) =>
i18n.category.yearTitle.replace('{{year}}', year),
yearShare: (year: string) =>
i18n.category.yearShare.replace('{{year}}', year),
cameraTitle: (camera: string) =>
i18n.category.cameraTitle.replace('{{camera}}', camera),
cameraShare: (camera: string) =>
i18n.category.cameraShare.replace('{{camera}}', camera),
taggedPhrase: (tag: string) =>
i18n.category.taggedPhrase.replace('{{tag}}', tag),
recipeShare: (recipe: string) =>
i18n.category.recipeShare.replace('{{recipe}}', recipe),
filmShare: (film: string) =>
i18n.category.filmShare.replace('{{film}}', film),
focalLengthTitle: (focal: string) =>
i18n.category.focalLengthTitle.replace('{{focal}}', focal),
focalLengthShare: (focal: string) =>
i18n.category.focalLengthShare.replace('{{focal}}', focal),
recentSubhead: (distance: string) =>
i18n.category.recentSubhead.replace('{{distance}}', distance),
},
admin: {
...i18n.admin,
deleteConfirm: (photoTitle: string) =>
i18n.admin.deleteConfirm.replace('{{photoTitle}}', photoTitle),
},
misc: {
...i18n.misc,
copyPhrase: (label: string) =>
i18n.misc.copyPhrase.replace('{{label}}', label),
},
utility: {
...i18n.utility,
paginate: (index: number, count: number) =>
i18n.utility.paginate
.replace('{{index}}', index.toString())
.replace('{{count}}', count.toString()),
paginateAction: (index: number, count: number, action: string) =>
i18n.utility.paginateAction
.replace('{{index}}', index.toString())
.replace('{{count}}', count.toString())
.replace('{{action}}', action),
},
};
};