Skip to content

pantoken-root / renderers/web-components/src / defineBundle

函数: defineBundle() ​

defineBundle(config): LocaleBundle

Alpha

创建并验证一个 LocaleBundle。当必填字段缺失或 locale 不是非空字符串时抛出错误。

参数 ​

config ​

LocaleBundle

返回值 ​

LocaleBundle

示例 ​

ts
export const myLocale = defineBundle({
  locale: "x-acme",
  dir: "ltr",
  label: "Acme Corp Internal",
  strings: makeStrings("en", { back: "Return" }),
});