{"_id":"@atzentis/edu-locales","name":"@atzentis/edu-locales","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@atzentis/edu-locales","version":"0.2.0","description":"Language packs for @atzentis/edu-react and @atzentis/edu-expo","keywords":["atzentis","edu","locales","localization","i18n"],"license":"MIT","author":{"name":"Atzentis","email":"dev@atzentis.com","url":"https://atzentis.com"},"homepage":"https://github.com/atzentis/atzentis-edu-sdk/tree/main/packages/locales#readme","repository":{"type":"git","url":"git+https://github.com/atzentis/atzentis-edu-sdk.git","directory":"packages/locales"},"type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"},"./en":{"import":"./dist/en/index.js","types":"./dist/en/index.d.ts"},"./el":{"import":"./dist/el/index.js","types":"./dist/el/index.d.ts"},"./de":{"import":"./dist/de/index.js","types":"./dist/de/index.d.ts"}},"sideEffects":false,"devDependencies":{"tsup":"^8.3.0","typescript":"^5.7.0","vitest":"^2.1.0"},"scripts":{"build":"tsup","dev":"tsup --watch","type-check":"tsc --noEmit","test":"vitest run"},"_id":"@atzentis/edu-locales@0.2.0","bugs":{"url":"https://github.com/atzentis/atzentis-edu-sdk/issues"},"_integrity":"sha512-Yz67za5zoK+eKgJHwb0Bo1qdJvO/20rQo0klaqVUWSu1KqZl/sf2POyqnWvVoKtlbvfpVH/RzXWU8N73otOsXw==","_resolved":"/tmp/8bd59047320329f1bcf2cf2be302fdc3/atzentis-edu-locales-0.2.0.tgz","_from":"file:atzentis-edu-locales-0.2.0.tgz","_nodeVersion":"22.22.3","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Yz67za5zoK+eKgJHwb0Bo1qdJvO/20rQo0klaqVUWSu1KqZl/sf2POyqnWvVoKtlbvfpVH/RzXWU8N73otOsXw==","shasum":"6884d0202829286815c74f375cd5a512638bec63","tarball":"https://registry.npmjs.org/@atzentis/edu-locales/-/edu-locales-0.2.0.tgz","fileCount":11,"unpackedSize":121467,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDjwDXgHaFajvD0TbRg9hCIXUIHHrpwJNZK+cq3t7jq2wIgC6F/AY1WHT+wx1rTHlhKgg6ASSAo9CGIj2HIQUeym1k="}]},"_npmUser":{"name":"vassilibo","email":"vassilibo@outlook.com"},"directories":{},"maintainers":[{"name":"vassilibo","email":"vassilibo@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/edu-locales_0.2.0_1781141365558_0.5033181489517962"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-11T01:29:25.397Z","0.2.0":"2026-06-11T01:29:25.823Z","modified":"2026-06-11T01:29:26.019Z"},"maintainers":[{"name":"vassilibo","email":"vassilibo@outlook.com"}],"description":"Language packs for @atzentis/edu-react and @atzentis/edu-expo","homepage":"https://github.com/atzentis/atzentis-edu-sdk/tree/main/packages/locales#readme","keywords":["atzentis","edu","locales","localization","i18n"],"repository":{"type":"git","url":"git+https://github.com/atzentis/atzentis-edu-sdk.git","directory":"packages/locales"},"author":{"name":"Atzentis","email":"dev@atzentis.com","url":"https://atzentis.com"},"bugs":{"url":"https://github.com/atzentis/atzentis-edu-sdk/issues"},"license":"MIT","readme":"# @atzentis/edu-locales\n\nType-safe i18n locale packs for `@atzentis/edu-react` and `@atzentis/edu-expo`.\n\nCovers 12 educational domains in English (EN), German (DE), and Greek (EL).\n\n## Installation\n\n```bash\nnpm install @atzentis/edu-locales\n# or\nbun add @atzentis/edu-locales\n```\n\nZero runtime dependencies. Tree-shakeable ESM.\n\n## Convention: Flat SCREAMING_SNAKE Keys\n\nAll keys use SCREAMING_SNAKE_CASE and are globally unique across the entire locale object.\nThe aggregate `EduLocalization` type is a flat TypeScript intersection — no nested namespaces.\n\nKeys are disambiguated by a domain prefix:\n\n| Domain prefix | Example keys |\n|---|---|\n| _(none)_ — universal labels | `CANCEL`, `SAVE`, `LOADING`, `ERROR` |\n| `TOOLS_` | `TOOLS_TITLE`, `TOOLS_EXECUTE`, `TOOLS_NO_RESULTS` |\n| `TUTOR_` | `TUTOR_TITLE`, `TUTOR_SEND`, `TUTOR_WELCOME` |\n| `SPACES_` | `SPACES_TITLE`, `SPACES_CREATE`, `SPACES_EMPTY` |\n| `MC_` | `MC_TITLE`, `MC_OVERVIEW`, `MC_PENDING_SUBMISSIONS` |\n| `SM_` | `SM_FLASHCARDS_TITLE`, `SM_QUIZ_TITLE`, `SM_UNDO` |\n| `ANNOTATION_` | `ANNOTATION_TITLE`, `ANNOTATION_ADD_COMMENT` |\n| `EXAMINER_` | `EXAMINER_TITLE`, `EXAMINER_START_GRADING` |\n| `EXAMS_` | `EXAMS_TITLE`, `EXAMS_CREATE`, `EXAMS_PASSED` |\n| `GRADING_` | `GRADING_TITLE`, `GRADING_FINAL`, `GRADING_OUT_OF` |\n| `A11Y_` | `A11Y_TITLE`, `A11Y_TTS`, `A11Y_TRANSLATE_TO` |\n| `ANALYTICS_` | `ANALYTICS_TITLE`, `ANALYTICS_USAGE_TITLE` |\n\n## Usage\n\n### Import the full locale\n\n```ts\nimport en from \"@atzentis/edu-locales/en\";\nimport de from \"@atzentis/edu-locales/de\";\nimport el from \"@atzentis/edu-locales/el\";\n\nconsole.log(en.TOOLS_EXECUTE);       // \"Execute\"\nconsole.log(de.GRADING_FINAL);       // \"Abschlussnote\"\nconsole.log(el.EXAMS_PASSED);        // \"Επιτυχία\"\n```\n\n### TypeScript — typed access\n\n```ts\nimport type { EduLocalization } from \"@atzentis/edu-locales\";\nimport en from \"@atzentis/edu-locales/en\";\n\nconst locale: EduLocalization = en;\n\n// Type-safe flat key access\nconst label = locale.GRADING_OUT_OF;\n// => \"Grade: {{grade}} / {{max}}\"\n```\n\n### Interpolation\n\nString values use `{{placeholder}}` tokens. Substitute with your i18n helper:\n\n```ts\nfunction t(template: string, vars: Record<string, string | number>): string {\n  return template.replace(/\\{\\{(\\w+)\\}\\}/g, (_, key) => String(vars[key] ?? key));\n}\n\nt(en.GRADING_OUT_OF, { grade: 18, max: 20 });\n// => \"Grade: 18 / 20\"\n\nt(de.EXAMS_DURATION, { duration: 90 });\n// => \"Dauer: 90 Min.\"\n```\n\n### React i18next\n\n```ts\nimport en from \"@atzentis/edu-locales/en\";\n\ni18n.init({\n  resources: { en: { translation: en } },\n  lng: \"en\",\n});\n\n// In component:\n// t(\"GRADING_FINAL\") => \"Final Grade\"\n```\n\n### Tree-shaking — import only what you need\n\n```ts\n// Only loads the EN bundle (~10 KB)\nimport en from \"@atzentis/edu-locales/en\";\n```\n\n## The 12 Domains\n\n| Key prefix | Interface | Description |\n|---|---|---|\n| _(no prefix)_ | `CommonKeys` | Universal UI labels (CANCEL, SAVE, LOADING, …) |\n| `TOOLS_` | `ToolsKeys` | AI tool execution labels and errors |\n| `TUTOR_` | `TutorKeys` | AI tutor chat labels and accessibility strings |\n| `SPACES_` | `SpacesKeys` | Learning space CRUD and sidekick announcements |\n| `MC_` | `MissionControlKeys` | Dashboard overview and alert labels |\n| `SM_` | `SmartModulesKeys` | Flashcard, quiz, and whiteboard labels |\n| `ANNOTATION_` | `AnnotationKeys` | Highlight, comment, voice note, video annotation |\n| `EXAMINER_` | `ExaminerKeys` | Grading stages, scoring, and report labels |\n| `EXAMS_` | `ExamsKeys` | Exam catalog, scheduling, and submission labels |\n| `GRADING_` | `GradingKeys` | Quiz, essay, speaking, and final grade labels |\n| `A11Y_` | `AccessibilityKeys` | TTS, dictionary, and translation labels |\n| `ANALYTICS_` | `AnalyticsKeys` | Usage, engagement, and ROI metric labels |\n\n## Grading System Notes\n\n- **Greek system**: 0–20 scale, passing grade >= 10. Panhellenic exams (Πανελλήνιες) for Grade 12 only.\n- **German system**: 1.0–6.0 scale (1.0 = best), passing grade <= 4.0. MSA at Grade 10, Abitur at Grade 12.\n\nLocale strings are system-agnostic. Grade values and formatting are handled by the host application.\n\n## Type Architecture\n\nEach domain has a `{Domain}Keys` interface in `src/types/{domain}.types.ts`.\nThe aggregate is defined as a flat TypeScript intersection:\n\n```ts\nexport type EduLocalization = AccessibilityKeys &\n  AnalyticsKeys &\n  AnnotationKeys &\n  CommonKeys &\n  ExaminerKeys &\n  ExamsKeys &\n  GradingKeys &\n  MissionControlKeys &\n  SmartModulesKeys &\n  SpacesKeys &\n  ToolsKeys &\n  TutorKeys;\n```\n\nBecause every key is globally unique, this intersection is collision-free and the TS compiler\nenforces completeness of every locale pack via the `: EduLocalization` annotation on each\nlocale index file.\n\n## Adding a New Locale\n\n1. Create `src/{code}/` directory with one file per domain (e.g. `src/fr/common.ts`).\n2. Each file exports `export const {domainCamel}: {Domain}Keys = { ... }`.\n3. Create `src/{code}/index.ts` combining all 12 domains:\n   ```ts\n   const fr: EduLocalization = { ...common, ...tools, /* ... */ };\n   export default fr;\n   ```\n4. Add the entry to `tsup.config.ts` and the `exports` map in `package.json`.\n5. Run `bunx tsc --noEmit` — missing or mistyped keys surface as compile errors.\n6. Run `bunx vitest run` — parity tests confirm key-set equality with EN.\n\n## License\n\nMIT — Atzentis &lt;dev@atzentis.com&gt;\n","readmeFilename":"README.md","_rev":"1-c2f1269be544da12830b322382d31179"}