feat: add grouped TechLog route contracts
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
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(),
|
||||
});
|
||||
Reference in New Issue
Block a user