{"_id":"@makerkit/i18n","_rev":"3-4ddac020042caa8f53aca223b675415c","name":"@makerkit/i18n","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.0-stage":{"name":"@makerkit/i18n","version":"0.0.0-stage","_id":"@makerkit/i18n@0.0.0-stage","stub":true,"maintainers":[{"name":"makerkit","email":"info@makerkit.dev"}],"dist":{"shasum":"e584f326e19a9ecb1e8a76fc8ca2d1b0961d94cf","tarball":"https://registry.npmjs.org/@makerkit/i18n/-/i18n-0.0.0-stage.tgz","fileCount":2,"integrity":"sha512-0gCRIAGyY/yg+5i4AQ6Z648wvhrmXKVc9x6vxgHvbEogmF+LwtAkf/+YVXA0osMC0uRnb7NXujqRW/zMwVOMuw==","signatures":[{"sig":"MEUCIQCeK1w9nsxojcwlCQzHpuxys3A/um7Y1+z5VgqHiQZoFQIgDmPnj6YDDESLQ8Pc/+grXs8VZrMyOjThYpJmyWsTkhI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":336},"_npmUser":{"name":"makerkit","email":"info@makerkit.dev"},"description":"Temporary package placeholder for staged publishing","directories":{}},"0.0.0":{"name":"@makerkit/i18n","version":"0.0.0","keywords":["ai-agents","i18n","i18next","mcp","next-intl","translations"],"license":"MIT","_id":"@makerkit/i18n@0.0.0","maintainers":[{"name":"makerkit","email":"info@makerkit.dev"}],"homepage":"https://github.com/makerkit/makerkit#readme","bugs":{"url":"https://github.com/makerkit/makerkit/issues"},"dist":{"shasum":"e1a9aadb8b9a86d41845f6564e74b414996e1ecf","tarball":"https://registry.npmjs.org/@makerkit/i18n/-/i18n-0.0.0.tgz","fileCount":37,"integrity":"sha512-qjiS8koypq2h+xjY6g9wD7qr7JdOGx/V3FGz+op8oW3Nuf/zJrOMYyoLird/TSTD9QtUciK2JPJSNgOFum2RVg==","signatures":[{"sig":"MEUCIQDA9sh8maNG4l+idU97ZMgJlUMOzW5/d7piEQ7WUI5VuQIgSxEQJ/JUGiegnRGcXY77GIX9P9Qp1OXH1/h/pk5BD2M=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCICa7J0v8EXPV5T96X2Ceak3sIrqjqbe7fswSrZjktfmiAiB+mX1+i7Vi+e9RqulkNDfdnN0cUVOWFj2mPXuKOsWFyw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":136676},"main":"./index.js","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./mcp":{"types":"./mcp.d.ts","import":"./mcp.mjs","require":"./mcp.js"},"./node":{"types":"./node.d.ts","import":"./node.mjs","require":"./node.js"}},"gitHead":"4963f46e641f462521064f8246facfe4cbee0d93","scripts":{"test":"vitest run","build":"tsdown && node ../../scripts/prepare-dist.mjs","typecheck":"tsc --noEmit -p tsconfig.lib.json && tsc --noEmit -p tsconfig.spec.json"},"_npmUser":{"name":"makerkit","email":"info@makerkit.dev"},"repository":{"url":"git+https://github.com/makerkit/makerkit.git","type":"git","directory":"packages/i18n"},"_npmVersion":"10.9.0","description":"Lets coding agents read and edit JSON translation files stored as <locale>/<namespace>.json (i18next, next-i18next, next-intl with namespace files): list, update, stats, add and remove locales and namespaces.","directories":{},"_nodeVersion":"25.6.1","dependencies":{"zod":"^3.25.0 || ^4.0.0"},"publishConfig":{"access":"public","directory":"dist","linkDirectory":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"catalog:","vite":"catalog:","tsdown":"catalog:","vitest":"catalog:","typescript":"catalog:","@types/node":"catalog:","@modelcontextprotocol/sdk":"catalog:"},"peerDependencies":{"@modelcontextprotocol/sdk":"^1.32.0"},"peerDependenciesMeta":{"@modelcontextprotocol/sdk":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/i18n_0.0.0_1792069059497_0.32504489928195257","host":"s3://npm-registry-packages-npm-production"}},"0.0.1":{"_id":"@makerkit/i18n@0.0.1","bugs":{"url":"https://github.com/makerkit/makerkit/issues"},"dist":{"shasum":"19e2c9c509ca3d3b9f970528aae8e3cc12b067ac","tarball":"https://registry.npmjs.org/@makerkit/i18n/-/i18n-0.0.1.tgz","fileCount":15,"integrity":"sha512-8u1Jt74SYvuxFD15AGLDxPmyxl1xEIkx1gZOCwII1DGDydaDZgIjXti5NvJbxKHFgHkCp33+/8Iom8A+y1dQJg==","signatures":[{"sig":"MEUCICtbHBx9dcIyXkjjBVOBs4eBsEbSR+fGKZPiLXpRfzGXAiEAjkaPRKr14OFNkYes+yC7zQ4XgeC7BA99buWU9fYFaZY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEqZ1ijpoE6gODdK6ec/S/4OWI/ll7I7MQnI7kwjyWc1AiBXZlCvHGD0Yi/AT2tTjrI5HmnoHosBUynTytwKJ5buhw=="}],"unpackedSize":66105},"main":"./index.js","name":"@makerkit/i18n","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.js"},"./mcp":{"types":"./mcp.d.ts","import":"./mcp.mjs","require":"./mcp.js"},"./node":{"types":"./node.d.ts","import":"./node.mjs","require":"./node.js"}},"gitHead":"4963f46e641f462521064f8246facfe4cbee0d93","license":"MIT","version":"0.0.1","_npmUser":{"name":"makerkit","email":"info@makerkit.dev"},"homepage":"https://github.com/makerkit/makerkit#readme","keywords":["ai-agents","i18n","i18next","mcp","next-intl","translations"],"repository":{"url":"git+https://github.com/makerkit/makerkit.git","type":"git","directory":"packages/i18n"},"_npmVersion":"10.9.0","description":"Lets coding agents read and edit JSON translation files stored as <locale>/<namespace>.json (i18next, next-i18next, next-intl with namespace files): list, update, stats, add and remove locales and namespaces.","directories":{},"maintainers":[{"name":"makerkit","email":"info@makerkit.dev"}],"_nodeVersion":"25.6.1","dependencies":{"zod":"^3.25.0 || ^4.0.0"},"_hasShrinkwrap":false,"peerDependencies":{"@modelcontextprotocol/sdk":"^1.32.0"},"peerDependenciesMeta":{"@modelcontextprotocol/sdk":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/i18n_0.0.1_1792069283183_0.7792223816371935"}}},"time":{"created":"2026-10-15T12:53:21.987Z","modified":"2026-10-15T13:01:23.461Z","0.0.0-stage":"2026-10-15T12:53:21.987Z","0.0.0":"2026-10-15T12:57:39.584Z","0.0.1":"2026-10-15T13:01:23.272Z"},"bugs":{"url":"https://github.com/makerkit/makerkit/issues"},"license":"MIT","homepage":"https://github.com/makerkit/makerkit#readme","keywords":["ai-agents","i18n","i18next","mcp","next-intl","translations"],"repository":{"url":"git+https://github.com/makerkit/makerkit.git","type":"git","directory":"packages/i18n"},"description":"Lets coding agents read and edit JSON translation files stored as <locale>/<namespace>.json (i18next, next-i18next, next-intl with namespace files): list, update, stats, add and remove locales and namespaces.","maintainers":[{"name":"makerkit","email":"info@makerkit.dev"}],"readme":"# @makerkit/i18n\n\nLets coding agents read and edit JSON translation files: list every key in every locale, set a value, check how much of each locale is translated, and add or remove locales and namespaces.\n\nIt works with projects that keep one folder per locale and one JSON file per namespace:\n\n```\npublic/locales/\n  en/\n    common.json\n    auth.json\n  de/\n    common.json\n    auth.json\n```\n\nThis is the layout used by i18next and next-i18next, and by next-intl projects that split messages into namespace files. A single file per locale (`messages/en.json`) is not supported.\n\nNested JSON objects are read as dot-separated keys: `{ \"header\": { \"title\": \"Home\" } }` is the key `header.title`.\n\n## Tools\n\n| Tool | What it does |\n|---|---|\n| `translations_list` | Every locale, namespace and key with its value; `base_locale` is the reference locale |\n| `translations_update` | Sets one key in one locale and namespace; missing parent groups are created |\n| `translations_stats` | Per-locale count of translated and missing keys, compared with the base locale |\n| `translations_add_namespace` | Creates an empty namespace file in every locale |\n| `translations_add_locale` | Creates a locale folder with an empty file for every existing namespace |\n| `translations_remove_namespace` | Deletes a namespace file from every locale |\n| `translations_remove_locale` | Deletes a locale folder and its files (the base locale cannot be removed) |\n\nLocale and namespace names that contain path separators or `..` are rejected, so the tools only touch files inside the messages directory. Keys such as `__proto__` are rejected too.\n\n## Use from code\n\n```ts\nimport { createTranslationsService } from '@makerkit/i18n';\nimport { createI18nDeps } from '@makerkit/i18n/node';\n\nconst translations = createTranslationsService(createI18nDeps(process.cwd()));\n\nconst { coverage } = await translations.stats();\n\nawait translations.update({\n  locale: 'de',\n  namespace: 'common',\n  key: 'header.title',\n  value: 'Startseite',\n});\n```\n\n### Settings\n\n```ts\ncreateI18nDeps(root, {\n  settings: {\n    messagesDir: 'apps/web/i18n/messages', // default: public/locales\n    baseLocale: 'en', // default: the first locale alphabetically\n    indent: 2, // default\n  },\n});\n```\n\n- `messagesDir`: the folder that contains the locale folders. Absolute, or relative to the root path.\n- `baseLocale`: the locale that coverage is measured against and that `translations_remove_locale` refuses to delete. When it is not set, or that folder does not exist, the first locale in alphabetical order is used.\n- `indent`: indentation for written files. Files are written as JSON with a trailing newline.\n\n## Add the tools to an MCP server\n\nRequires `@modelcontextprotocol/sdk`.\n\n```ts\nimport { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { createTranslationsService } from '@makerkit/i18n';\nimport { registerI18nTools } from '@makerkit/i18n/mcp';\nimport { createI18nDeps } from '@makerkit/i18n/node';\n\nconst server = new McpServer({ name: 'i18n', version: '1.0.0' });\n\nregisterI18nTools(\n  server,\n  createTranslationsService(createI18nDeps(process.cwd())),\n);\n```\n\nPass `{ prefix: 'my_' }` as a third argument to prefix the tool names.\n\n## License\n\nMIT\n","readmeFilename":"README.md"}