{"_id":"@act-spec/adapter-i18n","name":"@act-spec/adapter-i18n","dist-tags":{"rc":"0.2.0-rc.1","latest":"0.2.0-rc.1"},"versions":{"0.2.0-rc.1":{"name":"@act-spec/adapter-i18n","version":"0.2.0-rc.1","description":"PRD-207 i18n adapter (next-intl, react-intl, i18next) for the ACT (Agent Content Tree) v0.1 reference implementation. Reads message catalogs per the configured i18n library, emits PRD-200 partial nodes carrying PRD-104 i18n metadata (`metadata.locale`, `m","license":"Apache-2.0","author":{"name":"Jeremy Forsythe","email":"jeremy@act-spec.org"},"homepage":"https://act-spec.org","bugs":{"url":"https://github.com/act-spec/act/issues"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/act-spec/act.git","directory":"packages/adapter-i18n"},"dependencies":{"ajv":"^8.17.1","ajv-formats":"^3.0.1","@act-spec/adapter-framework":"0.2.0-rc.1","@act-spec/core":"0.2.0-rc.1","@act-spec/validator":"0.2.0-rc.1"},"devDependencies":{"@vitest/coverage-v8":"^2.1.9","tsx":"^4.19.2","typescript":"^5.6.3","vitest":"^2.1.4","@act-spec/adapter-contentful":"0.2.0-rc.1"},"scripts":{"build":"tsc -p tsconfig.json","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage","lint":"eslint src","typecheck":"tsc -p tsconfig.json --noEmit","conformance":"tsx conformance.ts"},"_id":"@act-spec/adapter-i18n@0.2.0-rc.1","_integrity":"sha512-ZGXRRjm+0IaJQqpv6dilVxeCCFogMoA67z4GYnB/WjTxdqQe8ebsJues2yiYTZQogwZNGONABEG5DlfGh0dRFA==","_resolved":"/private/var/folders/yp/y7frhcvj70jgr6b8g633lghr0000gn/T/706c4536e7020e45f6581024d4e38af4/act-spec-adapter-i18n-0.2.0-rc.1.tgz","_from":"file:act-spec-adapter-i18n-0.2.0-rc.1.tgz","_nodeVersion":"22.19.0","_npmVersion":"11.6.0","dist":{"integrity":"sha512-ZGXRRjm+0IaJQqpv6dilVxeCCFogMoA67z4GYnB/WjTxdqQe8ebsJues2yiYTZQogwZNGONABEG5DlfGh0dRFA==","shasum":"20292a76ec8873ae3fc4e084399e700721ad1810","tarball":"https://registry.npmjs.org/@act-spec/adapter-i18n/-/adapter-i18n-0.2.0-rc.1.tgz","fileCount":51,"unpackedSize":222613,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB0d3FIzwOKEORE++iGmiVAajAVcQNwrsGfx+eGDLjLGAiArxw9d251rKNsL8mNXQCKu1zonb7JFUpEOrPz28MtSsg=="}]},"_npmUser":{"name":"jdforsythe","email":"jdforsythe@gmail.com"},"directories":{},"maintainers":[{"name":"jdforsythe","email":"jdforsythe@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/adapter-i18n_0.2.0-rc.1_1777915287357_0.7044403820589862"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-04T17:21:27.193Z","0.2.0-rc.1":"2026-05-04T17:21:27.546Z","modified":"2026-05-04T17:21:27.766Z"},"maintainers":[{"name":"jdforsythe","email":"jdforsythe@gmail.com"}],"description":"PRD-207 i18n adapter (next-intl, react-intl, i18next) for the ACT (Agent Content Tree) v0.1 reference implementation. Reads message catalogs per the configured i18n library, emits PRD-200 partial nodes carrying PRD-104 i18n metadata (`metadata.locale`, `m","homepage":"https://act-spec.org","repository":{"type":"git","url":"git+https://github.com/act-spec/act.git","directory":"packages/adapter-i18n"},"author":{"name":"Jeremy Forsythe","email":"jeremy@act-spec.org"},"bugs":{"url":"https://github.com/act-spec/act/issues"},"license":"Apache-2.0","readme":"# @act-spec/adapter-i18n\n\ni18n adapter for ACT (Agent Content Tree). Reads message catalogs for the\nconfigured i18n library (`next-intl`, `react-intl`, `i18next`) from the\nfilesystem and emits partial nodes carrying ACT i18n metadata\n(`metadata.locale`, `metadata.translations`, `metadata.translation_status`,\n`metadata.fallback_from`) keyed against IDs that a primary content adapter\n(markdown, Contentful, programmatic, etc.) emits.\n\nThe adapter declares `precedence: \"fallback\"` so the primary adapter's\nscalar fields survive the merge step. Filesystem fixtures only — no live\ni18n service calls.\n\n## Status\n\nACT v0.1 internal hand-test candidate. Public release lands at v0.2.\n\n## Install\n\nUnpublished in v0.1. Consume via the workspace:\n\n```jsonc\n// package.json\n{ \"dependencies\": { \"@act-spec/adapter-i18n\": \"workspace:*\" } }\n```\n\n## Usage\n\n```ts\nimport { createI18nAdapter } from '@act-spec/adapter-i18n';\n\nconst adapter = createI18nAdapter({\n  config: {\n    library: 'next-intl',\n    messagesDir: './messages',\n    locales: { available: ['en', 'fr', 'de'], default: 'en' },\n    targetLevel: 'strict',\n  },\n});\n```\n\nThe adapter requires `targetLevel: \"strict\"` and at least two locales.\nCatalog detection is exposed standalone for tests and tooling:\n\n```ts\nimport { detectLibraryLayout, loadLocaleCatalog } from '@act-spec/adapter-i18n';\n\nconst layout = await detectLibraryLayout('./messages', 'next-intl');\nconst catalog = await loadLocaleCatalog(layout, 'fr');\n```\n\n## Conformance / what's tested\n\nEvery public API has a citing test in `src/i18n.test.ts`, covering\nlibrary-layout detection (`next-intl`/`react-intl`/`i18next`), BCP-47\nnormalization, fallback derivation, and the merge precedence contract\nagainst the Contentful adapter. The conformance gate runs\n`@act-spec/validator` against the bundled fixtures.\n\n```bash\npnpm -F @act-spec/adapter-i18n conformance\n```\n\n## Configuration (selected)\n\n| Option | Default | Notes |\n| --- | --- | --- |\n| `library` | (required) | One of `'next-intl' \\| 'react-intl' \\| 'i18next'`. |\n| `messagesDir` | (required) | Path to the i18n catalog directory. |\n| `locales.available` | (required) | Minimum two locales. |\n| `locales.default` | (required) | Default locale; used for `fallback_from`. |\n| `targetLevel` | (required) | Must be `'strict'`. |\n| `concurrency` | `4` | Adapter framework parallelism. |\n\n## Compatibility\n\nComposes with any primary adapter that emits stable IDs. Tested against\n`@act-spec/adapter-contentful` (used as a dev-dependency in tests).\n\n## Links\n\n- Adapter framework: [`@act-spec/adapter-framework`](../adapter-framework)\n- Repository: <https://github.com/act-spec/act>\n","readmeFilename":"README.md","_rev":"1-9ac9235d9cbe786e45d827c8ccd0ee96"}