{"_id":"@aioha/i18n-keys","_rev":"2-36d36713631bec5001d92aafb225358d","name":"@aioha/i18n-keys","dist-tags":{"latest":"1.0.1"},"versions":{"1.0.0":{"name":"@aioha/i18n-keys","version":"1.0.0","keywords":["aioha","i18n","icu","hive"],"author":{"name":"techcoderx"},"license":"MIT","_id":"@aioha/i18n-keys@1.0.0","maintainers":[{"name":"techcoderx","email":"npmpkgs@techcoderx.com"}],"homepage":"https://aioha.dev","bugs":{"url":"https://github.com/aioha-hive/i18n-keys/issues"},"dist":{"shasum":"9f9167c07335bf2daa8415f52105381348969f06","tarball":"https://registry.npmjs.org/@aioha/i18n-keys/-/i18n-keys-1.0.0.tgz","fileCount":59,"integrity":"sha512-v4tj1tZcGAdsgIMfbd3G+inwn81KxU5mNZgPR2n3KEKmG+n2if5EvkwhKBC3yjFCbHVQrQwMLDpoY/nPjmID1Q==","signatures":[{"sig":"MEQCIDaGbpT/JX6x1CTMdc9qTLMI99/Tt+pGiOWoofGzuQMuAiBnv9iAYl9u6v60fqZI/XR1gKkpHNlDHBEXPMWCutHiaQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87803},"main":"build/index.js","type":"module","_from":"file:aioha-i18n-keys-1.0.0.tgz","types":"build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js"},"./locales/en":{"types":"./build/locales/en.d.ts","import":"./build/locales/en.js"},"./locales/*.json":"./build/locales/*.json"},"scripts":{"build":"tsc -p tsconfig.build.json && cp src/locales/*.json build/locales/","check":"node scripts/check-catalog.js","clean":"rm -rf build","prepublish":"pnpm run clean && pnpm run build && pnpm run check"},"_npmUser":{"name":"techcoderx","email":"npmpkgs@techcoderx.com"},"_resolved":"/private/var/folders/4k/c2bh71lj5yl46624214xzpv40000gn/T/1d0d7d003d8ba4c3dce2cdcd25f3db8f/aioha-i18n-keys-1.0.0.tgz","_integrity":"sha512-v4tj1tZcGAdsgIMfbd3G+inwn81KxU5mNZgPR2n3KEKmG+n2if5EvkwhKBC3yjFCbHVQrQwMLDpoY/nPjmID1Q==","repository":{"url":"git+https://github.com/aioha-hive/i18n-keys.git"},"_npmVersion":"10.9.2","description":"Canonical message IDs, English defaults, and Messages adapter interface for the Aioha UI packages.","directories":{},"_nodeVersion":"22.15.0","dependencies":{"intl-messageformat":"^11.2.1"},"_hasShrinkwrap":false,"devDependencies":{"typescript":"^5.8.3"},"_npmOperationalInternal":{"tmp":"tmp/i18n-keys_1.0.0_1776951559811_0.33667068207567996","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@aioha/i18n-keys","version":"1.0.1","description":"Canonical message IDs, English defaults, and Messages adapter interface for the Aioha UI packages.","type":"module","main":"build/index.js","types":"build/index.d.ts","exports":{".":{"types":"./build/index.d.ts","import":"./build/index.js"},"./locales/en":{"types":"./build/locales/en.d.ts","import":"./build/locales/en.js"},"./locales/*.json":"./build/locales/*.json"},"keywords":["aioha","i18n","icu","hive"],"author":{"name":"techcoderx"},"license":"MIT","homepage":"https://aioha.dev","repository":{"url":"git+https://github.com/aioha-hive/i18n-keys.git"},"dependencies":{"intl-messageformat":"^11.2.1"},"devDependencies":{"typescript":"^5.8.3"},"scripts":{"clean":"rm -rf build","build":"tsc -p tsconfig.build.json && cp src/locales/*.json build/locales/","check":"node scripts/check-catalog.js","prepublish":"pnpm run clean && pnpm run build && pnpm run check"},"_id":"@aioha/i18n-keys@1.0.1","bugs":{"url":"https://github.com/aioha-hive/i18n-keys/issues"},"_integrity":"sha512-76wjNdK0EyU+qIYNsUbDi817bTLCeT/6pvZhPU+B5EWDjsCgOPnmCU/LmrGdbaCcgo6JMGhBOjRng8KC6GVrkQ==","_resolved":"/private/var/folders/4k/c2bh71lj5yl46624214xzpv40000gn/T/80553ffdf6cc60a836181755e53ce8cf/aioha-i18n-keys-1.0.1.tgz","_from":"file:aioha-i18n-keys-1.0.1.tgz","_nodeVersion":"22.15.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-76wjNdK0EyU+qIYNsUbDi817bTLCeT/6pvZhPU+B5EWDjsCgOPnmCU/LmrGdbaCcgo6JMGhBOjRng8KC6GVrkQ==","shasum":"b2ebb71a703e3536dd75e34381ab6ac4e85e9693","tarball":"https://registry.npmjs.org/@aioha/i18n-keys/-/i18n-keys-1.0.1.tgz","fileCount":59,"unpackedSize":98918,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFBqOhrR0uYrctTl/ZEAdfNfUudoOa5v+AVWmeNdD70KAiBAty+l7Ctvu4igQ8/mUokRc3eslegBKbLSFWYD2Ha0IQ=="}]},"_npmUser":{"name":"techcoderx","email":"npmpkgs@techcoderx.com"},"directories":{},"maintainers":[{"name":"techcoderx","email":"npmpkgs@techcoderx.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/i18n-keys_1.0.1_1777793767457_0.3345574615078397"},"_hasShrinkwrap":false}},"time":{"created":"2026-04-23T13:39:19.690Z","modified":"2026-05-03T07:36:07.717Z","1.0.0":"2026-04-23T13:39:19.952Z","1.0.1":"2026-05-03T07:36:07.607Z"},"bugs":{"url":"https://github.com/aioha-hive/i18n-keys/issues"},"author":{"name":"techcoderx"},"license":"MIT","homepage":"https://aioha.dev","keywords":["aioha","i18n","icu","hive"],"repository":{"url":"git+https://github.com/aioha-hive/i18n-keys.git"},"description":"Canonical message IDs, English defaults, and Messages adapter interface for the Aioha UI packages.","maintainers":[{"name":"techcoderx","email":"npmpkgs@techcoderx.com"}],"readme":"# @aioha/i18n-keys\n\nCanonical message IDs, English defaults, ICU-ready catalog, and a framework-neutral `Messages` adapter interface shared by `@aioha/react-ui` and `@aioha/lit-ui`.\n\n## Install\n\n```sh\npnpm add @aioha/i18n-keys\n```\n\n## Quick start\n\n```ts\nimport { createDefaultMessages } from '@aioha/i18n-keys'\n\nconst messages = createDefaultMessages({ initialLocale: 'en' })\nmessages.t('wallet.connect') // \"Connect Wallet\"\nmessages.t('auth.oneClick.failed', { error: 'timeout' }) // \"Failed to login with one click: timeout\"\n```\n\nPass the `messages` instance as a prop (React) or context (Lit) to an Aioha modal to override any strings via your preferred i18n stack (react-intl, lingui, etc.) — implement the `Messages` interface and hand it in.\n\n## The `Messages` interface\n\n```ts\ninterface Messages {\n  t(id: MessageId, vars?: Record<string, string | number>): string\n  getLocale(): string\n  setLocale(locale: string): void | Promise<void>\n  getDir(): 'ltr' | 'rtl'\n  subscribe(listener: () => void): () => void\n}\n```\n\nThe default implementation uses `intl-messageformat` (FormatJS) for ICU, so plurals and selects work out of the box:\n\n```icu\n{count, plural, one {# account} other {# accounts}}\n```\n\n## Loading locales on demand\n\nOnly `en` (and the pseudo-locale `en-XA`) is bundled into the default `Messages` instance. The package ships JSON catalogs for additional locales that consumers load on demand:\n\n| Locale | |\n|---|---|\n| `ar` | Arabic (RTL) |\n| `de` | German |\n| `en` | English (bundled) |\n| `es` | Spanish |\n| `fr` | French |\n| `hi` | Hindi |\n| `hr` | Croatian |\n| `it` | Italian |\n| `ja` | Japanese |\n| `ko` | Korean |\n| `ms` | Malay |\n| `pl` | Polish |\n| `pt` | Portuguese |\n| `ru` | Russian |\n| `zh-CN` | Chinese (Simplified) |\n| `zh-TW` | Chinese (Traditional) |\n\n```ts\nawait messages.loadLocale('fr', (lng) =>\n  import(`@aioha/i18n-keys/build/locales/${lng}.json`).then((m) => m.default)\n)\nmessages.setLocale('fr')\n```\n\n## Pseudo-locale\n\n`en-XA` is generated at init time by wrapping every English value in `[!! ... !!]` with accented characters. Use it to catch hardcoded strings, truncation, and concatenation bugs without needing translators:\n\n```ts\nmessages.setLocale('en-XA')\nmessages.t('wallet.connect') // \"[!! Çóññéçt Wállét !!]\"\n```\n\nICU placeholders (`{error}`, `{count, plural, ...}`) are preserved.\n\n## RTL detection\n\n`messages.getDir()` returns `'rtl'` for Arabic, Hebrew, Persian, Urdu, and similar — either from the runtime's `Intl.Locale.textInfo.direction` or a built-in language list fallback.\n\n## Message IDs\n\n| ID | English default | Variables |\n|---|---|---|\n| `action.back` | Back | |\n| `action.cancel` | Cancel | |\n| `action.done` | Done | |\n| `action.edit` | Edit | |\n| `action.proceed` | Proceed | |\n| `action.stop` | Stop | |\n| `auth.device.approval` | Please approve login request on the device. | |\n| `auth.hiveauth.instruction` | Scan the QR code using a HiveAuth-compatible mobile app. | |\n| `auth.hiveauth.openLink` | Open HiveAuth payload link | |\n| `auth.oneClick.failed` | Failed to login with one click: {error} | `error` |\n| `auth.oneClick.logging` | Logging you in with one click... | |\n| `auth.oneClick.redirecting` | Redirecting back to Aioha app... | |\n| `auth.username.label` | Hive Username | |\n| `auth.username.placeholder` | Enter Hive Username | |\n| `modal.close` | Close modal | |\n| `modal.loading` | Loading... | |\n| `user.addAccount` | Add Account | |\n| `user.addAccountBtn` | Add account | |\n| `user.avatarAlt` | {user}'s avatar | `user` |\n| `user.loginAs` | Login as {username} | `username` |\n| `user.logout` | Logout | |\n| `user.removeAccount` | Remove account | |\n| `user.removeConfirm` | Remove {user} | `user` |\n| `user.switch` | Switch User | |\n| `user.switchTo` | Switch to {user} | `user` |\n| `user.viewExplorer` | View In Explorer | |\n| `wallet.badge.popular` | Popular | |\n| `wallet.badge.snap` | Hive Snap | |\n| `wallet.connect` | Connect Wallet | |\n| `wallet.connectEthereum` | Connect Ethereum Wallet | |\n| `wallet.connectInstruction` | Connect with one of our available Hive wallet providers. | |\n| `wallet.ethInstruction` | Complete the connection in the wallet popup. | |\n| `wallet.helpLink` | Need help connecting a wallet? | |\n| `wallet.provider.other` | Other Wallet | |\n| `wallet.provider.viewOnly` | View Only | |\n| `wallet.sectionEthereum` | Ethereum | |\n| `wallet.sectionHive` | Hive | |\n| `wallet.selectType` | Select a wallet type to connect. | |\n\n## Catalog version\n\nThe catalog is versioned. Bump `CATALOG_VERSION` on any key add / remove / rename. Translators use it to detect required re-reviews.\n\n```ts\nimport { CATALOG_VERSION } from '@aioha/i18n-keys'\nconsole.log(CATALOG_VERSION) // 1\n```\n","readmeFilename":"README.md"}