@ankhorage/orchestrator-module-expo-localization

中文文档
0.7.3发布于 2026/10/12MITTypeScriptES Module构建来源已验证近 30 天下载 6414

Expo localization module for @ankhorage/orchestrator.

原始使用文档
文档目录5 节
  1. 🎯 What you get
  2. Usage
  3. Authoring host contribution
  4. Optional admin view
  5. Why this exists

orchestrator-module-expo-localization

Adds localization support to Expo apps.

🎯 What you get

  • Localization setup instantly
  • No boilerplate
  • Fully reversible

Usage

import { createOrchestrator } from '@ankhorage/orchestrator';
import { expoLocalizationModule } from '@ankhorage/orchestrator-module-expo-localization';

const orchestrator = createOrchestrator({
  modules: [expoLocalizationModule],
  projectRoot: '/path/to/project',
});

await orchestrator.installModule('expo-localization', { config: {} });

The Orchestrator ledger is the canonical lifecycle and configuration source. Updating an existing installation uses reconfigureModule(), which also removes outputs recorded by an earlier module version before generating the canonical src/modules/localization namespace.

The ledger configuration contains only lifecycle settings (locales and defaultLocale). Translation dictionaries are module-owned domain resources at src/modules/localization/locales/{locale}.json. These files are the single writable dictionary source and are imported directly by the generated runtime; they are not mirrored into ledger config. Use the package APIs for ordinary dictionary edits without reinstalling or reconfiguring the module.

Missing locale resource files load as empty dictionaries. Invalid files fail explicitly. Writes are atomic and keys are sorted so runtime and source-control output remain deterministic. Existing translations ledger data is accepted only as a one-time seed when a canonical locale file does not yet exist; normalized config never writes dictionaries back to the ledger.

Package-neutral helpers for locale rules and translatable-field discovery are exported from the root package. Discovery accepts manifest-shaped nodes and component metadata from the caller, so the module has no Studio component-registry dependency.

Authoring host contribution

Generic authoring hosts can import the package-owned contribution without adding Studio, ZORA, or React to the module root:

import { expoLocalizationHostContribution } from '@ankhorage/orchestrator-module-expo-localization/host';

Its serializable admin schema continues to describe lifecycle configuration. The sibling adminRuntime is server-side and conforms to the generic single-entry host contract: execute(context, { operation, input }). The host treats the operation string, payload, validation, and result as opaque module-owned data.

The package exports EXPO_LOCALIZATION_ADMIN_OPERATIONS as the canonical operation IDs. Locale and default-locale operations use the injected lifecycle reconfiguration boundary. Dictionary operations write canonical locale JSON directly, so ordinary translation edits never reinstall or reconfigure the module. The load operation derives translatable fields, missing translations, search, and filters from module-owned domain APIs. The link operation validates eligibility from injected component metadata and uses the generic manifest mutation callback; new keys are seeded in the configured default-locale dictionary without overwriting an existing translation.

Optional admin view

React/ZORA authoring hosts can render the package-owned administration surface from the optional ./admin-view subpath. The view receives only an opaque executor and an optional project-change callback; Localization operation IDs and result semantics remain inside this package.

import {
  ExpoLocalizationAdminView,
  expoLocalizationAdminViewContribution,
} from '@ankhorage/orchestrator-module-expo-localization/admin-view';

The view covers locale/default-locale management, canonical dictionary create/update/delete, metadata-driven translatable-field search/filtering and linking, and missing-translation state. React and ZORA are optional peer dependencies and are not dependencies of the root or ./host entrypoints.

Why this exists

Standardizes localization setup across apps.

版本与发布记录

@ankhorage/orchestrator-module-expo-localization 共发布 26 个版本,首次发布于 2026/04/22;过去 12 个月发布了 26 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.7.3latest2026/10/1224 天前
0.7.22026/10/1125 天前
0.7.12026/10/1027 天前
0.7.02026/10/0928 天前
0.6.102026/10/031 个月前
0.6.92026/09/181 个月前

关于 @ankhorage/orchestrator-module-expo-localization 的常见问题

@ankhorage/orchestrator-module-expo-localization 是什么?

Expo localization module for @ankhorage/orchestrator.

如何安装 @ankhorage/orchestrator-module-expo-localization?

在项目目录运行 npm install @ankhorage/orchestrator-module-expo-localization,或使用 pnpm add / yarn add / bun add。

@ankhorage/orchestrator-module-expo-localization 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@ankhorage/orchestrator-module-expo-localization 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@ankhorage/orchestrator-module-expo-localization 可以商用吗?

@ankhorage/orchestrator-module-expo-localization 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@ankhorage/orchestrator-module-expo-localization 的下载量有多少?

根据 npm 官方下载统计,@ankhorage/orchestrator-module-expo-localization 在 2026/10/06 – 2026/11/04 这 30 天内被下载 6,414 次,日均约 214 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@ankhorage/orchestrator-module-expo-localization 还在维护吗?

最新版本 0.7.3 发布于 2026/10/12(24 天前);至今共发布 26 个版本,其中过去 12 个月发布了 26 个;首次发布于 2026/04/22。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。