i18n
Feature-scoped translations — ‘Hallo’ and ‘Hello’ in the same app.
What it shows
Section titled “What it shows”r.translations()for multi-language feature keys
Source
Section titled “Source”Feature entry point: src/feature.ts.
cd samples/recipes/i18nbun testSource code
Section titled “Source code”The feature entry point — embedded straight from the source file, so the code here is exactly what runs. Multi-file samples keep their remaining files next to it on GitHub (link below):
// i18n Sample// Shows: r.translations() for multi-language feature keys
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
export const greetingFeature = defineFeature("greeting", (r) => { r.translations({ keys: { "greeting.welcome": { de: "Willkommen", en: "Welcome", fr: "Bienvenue", }, "greeting.goodbye": { de: "Auf Wiedersehen", en: "Goodbye", fr: "Au revoir", }, "greeting.hello_name": { de: "Hallo, {name}!", en: "Hello, {name}!", fr: "Bonjour, {name}!", }, }, });});
export const errorFeature = defineFeature("errors", (r) => { r.translations({ keys: { "errors.not_found": { de: "Nicht gefunden", en: "Not found", }, "errors.access_denied": { de: "Zugriff verweigert", en: "Access denied", }, }, });});📄 On GitHub: samples/recipes/i18n/src/feature.ts