{"_id":"@dyst-no/translations","_rev":"6-343e6b34511fd212efe197cd4f89169b","name":"@dyst-no/translations","dist-tags":{"latest":"0.1.5"},"versions":{"0.1.0":{"name":"@dyst-no/translations","version":"0.1.0","keywords":["i18n","translations","typescript","react","react-native","zod"],"_id":"@dyst-no/translations@0.1.0","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"homepage":"https://github.com/dyst-no/translations#readme","bugs":{"url":"https://github.com/dyst-no/translations/issues"},"dist":{"shasum":"7941b1b679d381c9fc3fbac7493234947d51214d","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.0.tgz","fileCount":38,"integrity":"sha512-vFVoX0KyHG5lH45CHBJBH+cXOU2J5WeqVCLN4jEVPYfvPRzYZMueU/ant7SBTb4Y/hjho/pU84sSuxiFJJkcAw==","signatures":[{"sig":"MEUCIQCysOKn3Q9TCHwHKncZnZwAeSjV5joOsK60xnp6g1IJegIgbbTs6hKKjc9s80SyiFfbd12u5ZLfg5ztbcmFBP/K/Go=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":106613},"type":"module","exports":{"./zod":{"types":"./dist/zod/index.d.ts","import":"./dist/zod.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core.js"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server.js"},"./package.json":"./package.json","./platforms/react":{"types":"./dist/platforms/react/index.d.ts","import":"./dist/platforms/react.js"},"./platforms/react-native":{"types":"./dist/platforms/react-native/index.d.ts","import":"./dist/platforms/react-native.js"}},"gitHead":"701a00a3b6320a5eeddecca3c5c3621558f3efe7","private":false,"scripts":{"test":"tsgo --noEmit && bun test","build":"tsdown && tsc -p tsconfig.build.json","release":"node scripts/release.mjs","typecheck":"tsc --pretty false","release:major":"node scripts/release.mjs major","release:minor":"node scripts/release.mjs minor","release:patch":"node scripts/release.mjs patch","prepublishOnly":"bun run build && bun run test"},"_npmUser":{"name":"danielstelea","email":"daniel@dyst.no"},"repository":{"url":"git+https://github.com/dyst-no/translations.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeScript-first translations for server, React, and React Native.","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.5","tsdown":"^0.14.2","@types/bun":"latest","typescript":"^5.9.3","expo-sqlite":"^15.2.14","@types/react":"^19","@biomejs/biome":"2.3.2","@types/react-dom":"^19","expo-localization":"^16.0.1","@testing-library/react":"^16.3.1","@testing-library/jest-dom":"^6.9.1","@typescript/native-preview":"^7.0.0-dev.20260318.1","@happy-dom/global-registrator":"^20.3.0"},"peerDependencies":{"zod":"^4.3.5","react":"^18 || ^19","react-dom":"^18 || ^19","expo-sqlite":"^15.2.14","react-native":"^0.79.5","expo-localization":"^16.0.1"},"peerDependenciesMeta":{"zod":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"expo-localization":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/translations_0.1.0_1773842839629_0.8495332482525197","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@dyst-no/translations","version":"0.1.1","keywords":["i18n","translations","typescript","react","react-native","zod"],"_id":"@dyst-no/translations@0.1.1","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"homepage":"https://github.com/dyst-no/translations#readme","bugs":{"url":"https://github.com/dyst-no/translations/issues"},"dist":{"shasum":"2deba44c005de9227fd7fd2fdae850ae3a881a2e","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.1.tgz","fileCount":38,"integrity":"sha512-0cVF4rebQakLv+wQ9XJuJ3cEdqXVS0wN8Hqo0DsrOX7QFbR8QkLXXByy7cqQfLMbBHrF5vduqJu6hgYJdZxqVQ==","signatures":[{"sig":"MEUCIEu1aq2GfwDRXiSoRrWeyNEeSqBvKJcwlRDojORNpQ0mAiEAo5OF1j1XbEs4WyZEqLL8M7kNWUOaiGW6JcjXnFlCnN8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dyst-no%2ftranslations@0.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":106613},"type":"module","exports":{"./zod":{"types":"./dist/zod/index.d.ts","import":"./dist/zod.js"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core.js"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react.js"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server.js"},"./package.json":"./package.json","./platforms/react":{"types":"./dist/platforms/react/index.d.ts","import":"./dist/platforms/react.js"},"./platforms/react-native":{"types":"./dist/platforms/react-native/index.d.ts","import":"./dist/platforms/react-native.js"}},"gitHead":"f7046c586d3385bfb8f8f2d798bd3eb75399e215","private":false,"scripts":{"test":"tsgo --noEmit && bun test","build":"tsdown && tsc -p tsconfig.build.json","release":"node scripts/release.mjs","typecheck":"tsc --pretty false","release:major":"node scripts/release.mjs major","release:minor":"node scripts/release.mjs minor","release:patch":"node scripts/release.mjs patch","prepublishOnly":"bun run build && bun run test"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1e810a73-7d9e-4e9d-8016-9d6640319df1"}},"repository":{"url":"git+https://github.com/dyst-no/translations.git","type":"git"},"_npmVersion":"11.9.0","description":"TypeScript-first translations for server, React, and React Native.","directories":{},"_nodeVersion":"24.14.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.5","tsdown":"^0.14.2","@types/bun":"latest","typescript":"^5.9.3","expo-sqlite":"^15.2.14","@types/react":"^19","@biomejs/biome":"2.3.2","@types/react-dom":"^19","expo-localization":"^16.0.1","@testing-library/react":"^16.3.1","@testing-library/jest-dom":"^6.9.1","@typescript/native-preview":"^7.0.0-dev.20260318.1","@happy-dom/global-registrator":"^20.3.0"},"peerDependencies":{"zod":"^4.3.5","react":"^18 || ^19","react-dom":"^18 || ^19","expo-sqlite":"^15.2.14","react-native":"^0.79.5","expo-localization":"^16.0.1"},"peerDependenciesMeta":{"zod":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"expo-localization":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/translations_0.1.1_1773849073024_0.1967568522421863","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@dyst-no/translations","version":"0.1.2","keywords":["i18n","translations","typescript","react","react-native","zod"],"_id":"@dyst-no/translations@0.1.2","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"homepage":"https://github.com/dyst-no/translations#readme","bugs":{"url":"https://github.com/dyst-no/translations/issues"},"dist":{"shasum":"a48ac23b3902f614950999911b570418dc854baf","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.2.tgz","fileCount":21,"integrity":"sha512-PWt6XAVr/iWRirAFBzc8V0g/cz9znoy2ai7FiLq1tEX/tWmfPCPdYG2+C/LUIYSe75cQn4nuXmdsyRQTAH8c1w==","signatures":[{"sig":"MEQCIGG32xLq5boLkIqT4aqMvXOYce4ISTWWlN+B8sKxpKLZAiAslULxaCZ3o+AfV2YhOHSBH+0Ci5UkGsgq4ULLUNGbIw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":96912},"type":"module","exports":{"./zod":{"types":"./dist/zod.d.mts","import":"./dist/zod.mjs"},"./core":{"types":"./dist/core.d.mts","import":"./dist/core.mjs"},"./react":{"types":"./dist/react.d.mts","import":"./dist/react.mjs"},"./server":{"types":"./dist/server.d.mts","import":"./dist/server.mjs"},"./package.json":"./package.json","./platforms/react":{"types":"./dist/platforms/react.d.mts","import":"./dist/platforms/react.mjs"},"./platforms/react-native":{"types":"./dist/platforms/react-native.d.mts","import":"./dist/platforms/react-native.mjs"}},"gitHead":"603032c1be275361ea4452ffd459718ee6d527b6","private":false,"scripts":{"test":"bun run typecheck && bun test","build":"tsdown","format":"biome check --write --error-on-warnings .","release":"node scripts/release.mjs","typecheck":"tsgo --noEmit","release:major":"node scripts/release.mjs major","release:minor":"node scripts/release.mjs minor","release:patch":"node scripts/release.mjs patch","prepublishOnly":"bun run build && bun run test"},"_npmUser":{"name":"danielstelea","email":"daniel@dyst.no"},"repository":{"url":"git+https://github.com/dyst-no/translations.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeScript-first translations for server, React, and React Native.","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.5","tsdown":"^0.21.4","@types/bun":"latest","expo-sqlite":"^15.2.14","@types/react":"^19","@biomejs/biome":"2.3.2","@types/react-dom":"^19","expo-localization":"^16.0.1","@testing-library/react":"^16.3.1","@testing-library/jest-dom":"^6.9.1","@typescript/native-preview":"^7.0.0-dev.20260318.1","@happy-dom/global-registrator":"^20.3.0"},"peerDependencies":{"zod":"^4.3.5","react":"^18 || ^19","react-dom":"^18 || ^19","expo-sqlite":"^15.2.14","react-native":"^0.79.5","expo-localization":"^16.0.1"},"peerDependenciesMeta":{"zod":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"expo-localization":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/translations_0.1.2_1773854092683_0.0470979747215019","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@dyst-no/translations","version":"0.1.3","keywords":["i18n","translations","typescript","react","react-native","zod"],"_id":"@dyst-no/translations@0.1.3","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"homepage":"https://github.com/dyst-no/translations#readme","bugs":{"url":"https://github.com/dyst-no/translations/issues"},"dist":{"shasum":"7c3889750657c79076f8e8d4d152ca0a2580d330","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.3.tgz","fileCount":21,"integrity":"sha512-6QjbGItjeOTbBM/6o2pOzwa3rPkyCOGpjWFBayt1s/DWb8ZISiAdTBb9tEQTtgCcr4UgrlEeNyE+5tPQMqTz/A==","signatures":[{"sig":"MEUCIQCngj/5uuAoAaZY4Xg+eCNzyAQlfbIdvMZbYfHR4cMspwIgW8XuYR1U1ShlIo3les/HCbTTg1r51dlSMMLGMk9RBQY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":97504},"type":"module","exports":{"./zod":{"types":"./dist/zod.d.mts","import":"./dist/zod.mjs"},"./core":{"types":"./dist/core.d.mts","import":"./dist/core.mjs"},"./react":{"types":"./dist/react.d.mts","import":"./dist/react.mjs"},"./server":{"types":"./dist/server.d.mts","import":"./dist/server.mjs"},"./package.json":"./package.json","./platforms/react":{"types":"./dist/platforms/react.d.mts","import":"./dist/platforms/react.mjs"},"./platforms/react-native":{"types":"./dist/platforms/react-native.d.mts","import":"./dist/platforms/react-native.mjs"}},"gitHead":"8f867d530454e4e643cb6edd997f427119612e44","private":false,"scripts":{"test":"bun run typecheck && bun test","build":"tsdown","format":"biome check --write --error-on-warnings .","release":"node scripts/release.mjs","typecheck":"tsc --pretty false --noEmit","release:major":"node scripts/release.mjs major","release:minor":"node scripts/release.mjs minor","release:patch":"node scripts/release.mjs patch","prepublishOnly":"bun run build && bun run test"},"_npmUser":{"name":"danielstelea","email":"daniel@dyst.no"},"repository":{"url":"git+https://github.com/dyst-no/translations.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeScript-first translations for server, React, and React Native.","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.5","tsdown":"^0.21.4","@types/bun":"latest","typescript":"^5.9.3","expo-sqlite":"^15.2.14","@types/react":"^19","@biomejs/biome":"2.3.2","@types/react-dom":"^19","expo-localization":"^16.0.1","@testing-library/react":"^16.3.1","@testing-library/jest-dom":"^6.9.1","@happy-dom/global-registrator":"^20.3.0"},"peerDependencies":{"zod":"^4.3.5","react":"^18 || ^19","react-dom":"^18 || ^19","expo-sqlite":"^15.2.14","react-native":"^0.79.5","expo-localization":"^16.0.1"},"peerDependenciesMeta":{"zod":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"expo-localization":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/translations_0.1.3_1773912500017_0.9889242410742327","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@dyst-no/translations","version":"0.1.4","keywords":["i18n","translations","typescript","react","react-native","zod"],"_id":"@dyst-no/translations@0.1.4","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"homepage":"https://github.com/dyst-no/translations#readme","bugs":{"url":"https://github.com/dyst-no/translations/issues"},"dist":{"shasum":"a659ea2c9e55fee652f70186d834d1298e9c4d78","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.4.tgz","fileCount":38,"integrity":"sha512-1aKv0GJL8y4zqjelIOwtc7JH1BxcFYdE5V618igFzXYuR3deKTliuJss76Snup+eFMAXgXAcjgRByJCmiIyG6Q==","signatures":[{"sig":"MEUCIQC5HfwyrEiHZgRpTZVXo3EOp238BUPq4r6D6fsYal88fAIgYcht3SkDWVKKv8XrcvIgWzRBKRX26Ao1HlGzQSj/wcU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":109783},"type":"module","exports":{"./zod":{"types":"./dist/zod/index.d.ts","import":"./dist/zod.mjs"},"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core.mjs"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react.mjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server.mjs"},"./package.json":"./package.json","./platforms/react":{"types":"./dist/platforms/react/index.d.ts","import":"./dist/platforms/react.mjs"},"./platforms/react-native":{"types":"./dist/platforms/react-native/index.d.ts","import":"./dist/platforms/react-native.mjs"}},"gitHead":"1935e8961ee087e2aea5654e3a55cd891104d369","private":false,"scripts":{"test":"bun run typecheck && bun test","build":"tsdown && tsc -p tsconfig.build.json","format":"biome check --write --error-on-warnings .","release":"node scripts/release.mjs","typecheck":"tsc --pretty false --noEmit","release:major":"node scripts/release.mjs major","release:minor":"node scripts/release.mjs minor","release:patch":"node scripts/release.mjs patch","prepublishOnly":"bun run build && bun run test"},"_npmUser":{"name":"danielstelea","email":"daniel@dyst.no"},"repository":{"url":"git+https://github.com/dyst-no/translations.git","type":"git"},"_npmVersion":"11.6.2","description":"TypeScript-first translations for server, React, and React Native.","directories":{},"_nodeVersion":"24.12.0","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"zod":"^4.3.5","tsdown":"^0.21.4","@types/bun":"latest","typescript":"^5.9.3","expo-sqlite":"^15.2.14","@types/react":"^19","@biomejs/biome":"2.3.2","@types/react-dom":"^19","expo-localization":"^16.0.1","@testing-library/react":"^16.3.1","@testing-library/jest-dom":"^6.9.1","@happy-dom/global-registrator":"^20.3.0"},"peerDependencies":{"zod":"^4.3.5","react":"^18 || ^19","react-dom":"^18 || ^19","expo-sqlite":"^15.2.14","react-native":"^0.79.5","expo-localization":"^16.0.1"},"peerDependenciesMeta":{"zod":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"expo-localization":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/translations_0.1.4_1773913355123_0.008578647294068542","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@dyst-no/translations","version":"0.1.5","description":"TypeScript-first translations for server, React, and React Native.","keywords":["i18n","translations","typescript","react","react-native","zod"],"homepage":"https://github.com/dyst-no/translations#readme","repository":{"type":"git","url":"git+https://github.com/dyst-no/translations.git"},"bugs":{"url":"https://github.com/dyst-no/translations/issues"},"private":false,"type":"module","publishConfig":{"access":"public","provenance":true},"exports":{"./core":{"types":"./dist/core/index.d.ts","import":"./dist/core.mjs"},"./react":{"types":"./dist/react/index.d.ts","import":"./dist/react.mjs"},"./platforms/react":{"types":"./dist/platforms/react/index.d.ts","import":"./dist/platforms/react.mjs"},"./platforms/react-native":{"types":"./dist/platforms/react-native/index.d.ts","import":"./dist/platforms/react-native.mjs"},"./server":{"types":"./dist/server/index.d.ts","import":"./dist/server.mjs"},"./zod":{"types":"./dist/zod/index.d.ts","import":"./dist/zod.mjs"},"./package.json":"./package.json"},"scripts":{"build":"tsdown && tsc -p tsconfig.build.json","format":"biome check --write --error-on-warnings .","typecheck":"tsc --pretty false --noEmit","test":"bun run typecheck && bun test","release":"node scripts/release.mjs","release:patch":"node scripts/release.mjs patch","release:minor":"node scripts/release.mjs minor","release:major":"node scripts/release.mjs major","prepublishOnly":"bun run build && bun run test"},"peerDependenciesMeta":{"expo-localization":{"optional":true},"expo-sqlite":{"optional":true},"react-native":{"optional":true},"zod":{"optional":true}},"peerDependencies":{"react":"^18 || ^19","react-dom":"^18 || ^19","expo-localization":"^16.0.1","expo-sqlite":"^15.2.14","react-native":"^0.79.5","zod":"^4.3.5"},"devDependencies":{"@biomejs/biome":"2.3.2","@happy-dom/global-registrator":"^20.3.0","@testing-library/jest-dom":"^6.9.1","@testing-library/react":"^16.3.1","@types/bun":"latest","@types/react":"^19","@types/react-dom":"^19","expo-localization":"^16.0.1","expo-sqlite":"^15.2.14","tsdown":"^0.21.4","typescript":"^5.9.3","zod":"^4.3.5"},"gitHead":"c68ac6568761c78426fbb59d55ecfa1006c619ca","_id":"@dyst-no/translations@0.1.5","_nodeVersion":"24.17.0","_npmVersion":"11.13.0","dist":{"integrity":"sha512-fyx7ZZoOs2qmLVMzRikKTjsRaihBkXQ+U6j/voV++NzoPXmneJ+RVK4De6npdaOn2FWsbuuqvgfjSIS5JsJScQ==","shasum":"e505915d75c9c1d567f51010b92324826520273a","tarball":"https://registry.npmjs.org/@dyst-no/translations/-/translations-0.1.5.tgz","fileCount":38,"unpackedSize":110823,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@dyst-no%2ftranslations@0.1.5","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDSsxPogJ62AzYAtfZbcdcVHh5X/EpWrUN/4s1hcO4E8wIgbbWShmZA9aCLGX72FzIS/x8/323/nld3FGlnjrx8g9c="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:1e810a73-7d9e-4e9d-8016-9d6640319df1"}},"directories":{},"maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/translations_0.1.5_1783002232758_0.3282491034949999"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-18T14:07:19.563Z","modified":"2026-07-02T14:23:53.228Z","0.1.0":"2026-03-18T14:07:19.801Z","0.1.1":"2026-03-18T15:51:13.150Z","0.1.2":"2026-03-18T17:14:52.866Z","0.1.3":"2026-03-19T09:28:20.149Z","0.1.4":"2026-03-19T09:42:35.255Z","0.1.5":"2026-07-02T14:23:52.903Z"},"bugs":{"url":"https://github.com/dyst-no/translations/issues"},"homepage":"https://github.com/dyst-no/translations#readme","keywords":["i18n","translations","typescript","react","react-native","zod"],"repository":{"type":"git","url":"git+https://github.com/dyst-no/translations.git"},"description":"TypeScript-first translations for server, React, and React Native.","maintainers":[{"name":"danielstelea","email":"daniel@dyst.no"}],"readme":"# Translation Library\n\nA TypeScript-first translation library that works on both client and server environments with React support.\n\n## Features\n\n- **Fluent API**: Chainable translation methods with type safety\n- **Universal**: Works in React, React Native, and server environments\n- **Labels Support**: Enum/Object-based label translations\n- **Locale Detection**: Automatic locale detection with multiple strategies\n- **Type Safe**: Full TypeScript support with compile-time type checking\n\n## Installation\n\n```bash\nbun install\n```\n\n## Usage\n\n### Server\n\n```typescript\nimport { initializeTranslations, createLabel } from '@dyst-no/translations/server';\n\nenum UserRole {\n  Admin = 'admin',\n  Moderator = 'moderator',\n  User = 'user'\n}\n\nconst translations = initializeTranslations(['en', 'no'], 'en', {\n  labels: (t) => ({\n    userRole: createLabel(UserRole, {\n      [UserRole.Admin]: t('Administrator').no('Administrator'),\n      [UserRole.Moderator]: t('Moderator').no('Moderator'),\n      [UserRole.User]: t('Regular User').no('Vanlig bruker'),\n    }),\n   \n  }),\n});\n\nconst t = translations.createTranslation('en');\nconsole.log(t('Welcome back').no('Velkommen tilbake')); // \"Welcome back\"\n\nconsole.log(translations.labels.userRole(UserRole.Admin)); // \"Administrator\"\n```\n\n### React\n\n```typescript\nimport {\n  initializeTranslations,\n  TranslationProvider,\n  createLabel\n} from '@dyst-no/translations/react';\nimport { storage, defaultDetectors } from '@dyst-no/translations/platforms/react';\n// Optional: For date formatting integration\nimport { enGB as enDateFns, nb as noDateFns, type Locale, setDefaultOptions, format } from 'date-fns';\n// Optional: For validation message localization\nimport { zodEn, zodNo } from '@dyst-no/translations/zod';\nimport { z } from 'zod';\n\nenum Priority {\n  Low = 'low',\n  Medium = 'medium',\n  High = 'high'\n}\n\nconst translations = initializeTranslations(['en', 'no'], 'en', {\n  // Automatically persist locale to localStorage\n  storage: storage,\n  // Automatically detect locale from browser/navigator\n  detectors: defaultDetectors,\n  labels: (t) => ({\n    priority: createLabel(Priority, {\n      [Priority.Low]: t('Low Priority').no('Lav prioritet'),\n      [Priority.Medium]: t('Medium Priority').no('Medium prioritet'),\n      [Priority.High]: t('High Priority').no('Høy prioritet'),\n    }),\n  }),\n  onLocaleChange: (locale, t) => {\n    // Optional: Update Zod locales for validation messages\n    const ZOD_LOCALES = {\n      en: zodEn,\n      no: zodNo,\n    } satisfies Record<string, any>;\n    z.config(ZOD_LOCALES[locale]());\n\n    // Optional: Update date-fns locale for date formatting\n    const DATE_FNS_LOCALES = {\n      en: enDateFns,\n      no: noDateFns,\n    } satisfies Record<string, Locale>;\n    setDefaultOptions({ locale: DATE_FNS_LOCALES[locale] });\n\n    // Optional: Save language preference to server\n    // authClient.updateUser({ language: locale as UserLanguage });\n\n    // Optional: Show success/error messages\n    // toast.success(t('Language updated').no('Språk oppdatert'));\n  },\n});\n\nconst { useTranslation } = translations;\n\nfunction Root() {\n  return (\n    <TranslationProvider instance={translations}>\n      <App />\n    </TranslationProvider>\n  );\n}\n\nfunction App() {\n  const { t, labels, locale, changeLocale } = useTranslation();\n\n  // Optional: Date formatting that respects current locale\n  const formattedDate = format(new Date(), 'PPPP'); // Uses current date-fns locale\n\n  return (\n    <div>\n      <h1>{t('Task Manager').no('Oppgavebehandler')}</h1>\n\n      {/* Locale is automatically detected and persisted */}\n      <p>Current locale: {locale}</p>\n      <p>Formatted date: {formattedDate}</p>\n\n      <select value={locale} onChange={(e) => changeLocale(e.target.value)}>\n        <option value=\"en\">English</option>\n        <option value=\"no\">Norsk</option>\n      </select>\n\n      <div>\n        <strong>{labels.priority(Priority.High)}</strong>\n      </div>\n    </div>\n  );\n}\n```\n\n## Development\n\n```bash\n# Run tests\nbun run test\n```\n\n## Releasing\n\nPick the bump you want and release from either GitHub Actions or locally.\n\n### GitHub Actions\n\nRun the `Release` workflow manually and choose one of:\n\n- `patch` for fixes and small non-breaking updates\n- `minor` for new backward-compatible features\n- `major` for breaking changes\n\nThe workflow will build, test, bump the version you chose, copy commit messages since the previous tag into `CHANGELOG.md`, create a release commit and tag, and publish to npm.\n\n### Local release\n\n```bash\nbun run release:patch\nbun run release:minor\nbun run release:major\n```\n\nEach command builds, tests, bumps the version you chose, copies commit messages since the previous tag into `CHANGELOG.md`, creates a release commit and tag, and publishes to npm.\n","readmeFilename":"README.md"}