Provides bilingual string lookup, route-prefix helpers, and translation pairing for content collections.
- Defines
Lang = 'de' | 'en'and the flat translation dictionary. t(key, lang)resolves UI copy with a German fallback.langPrefix(lang)maps German to''and English to'/en'.langSwitchUrl(path, lang)adds or removes the English prefix for structurally identical routes.
buildDeMap()strips thede/prefix and maps German entries by canonical English ID.getLocalizedEntry()chooses German fields/body/slug when requested and available, otherwise English data.getDeSlug()resolves alternate-language detail URLs.
English entry IDs act as translation keys. Route generation, homepage lists, collection indexes, and detail pages all rely on matching filenames across collections. Localized urlSlug values affect public German URLs but not pair identity.