Files
tech-log-frontend/src/features/tech-log/contracts/tech-log-message-catalog.ts
T

25 lines
740 B
TypeScript

import {
TECH_LOG_ROUTE_REGISTRY,
type TechLogRouteId,
} from "./tech-log-route-contract.ts";
export type TechLogRouteMessageKey =
| `route.${TechLogRouteId}.title`
| `route.${TechLogRouteId}.navigation`;
function createCatalog(): Readonly<Record<TechLogRouteMessageKey, string>> {
return Object.freeze(
Object.fromEntries(
Object.values(TECH_LOG_ROUTE_REGISTRY).flatMap((definition) => [
[`route.${definition.routeId}.title`, definition.title],
[`route.${definition.routeId}.navigation`, definition.title],
]),
),
) as Readonly<Record<TechLogRouteMessageKey, string>>;
}
export const TECH_LOG_MESSAGE_CATALOGS = Object.freeze({
"ko-KR": createCatalog(),
"en-US": createCatalog(),
});