UNPKG

@intlayer/core

Version:

Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.

29 lines (27 loc) 880 B
const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs'); let __intlayer_types = require("@intlayer/types"); //#region src/transpiler/translation/translation.ts /** * * Function intended to be used to build intlayer dictionaries. * * Get the content of a translation based on the locale. * * Usage: * * ```ts * translation<string>({ * "en": "Hello", * "fr": "Bonjour", * // ... any other available locale * }) * ``` * * Using TypeScript: * - this function require each locale to be defined if defined in the project configuration. * - If a locale is missing, it will make each existing locale optional and raise an error if the locale is not found. */ const translation = (content) => (0, __intlayer_types.formatNodeType)(__intlayer_types.NodeType.Translation, content); //#endregion exports.t = translation; //# sourceMappingURL=translation.cjs.map