{"id":50559090,"url":"https://github.com/srcdev/srcdev-nuxt-i18n","last_synced_at":"2026-06-04T10:30:23.618Z","repository":{"id":351431586,"uuid":"1210969872","full_name":"srcdev/srcdev-nuxt-i18n","owner":"srcdev","description":null,"archived":false,"fork":false,"pushed_at":"2026-04-15T00:16:30.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-15T02:26:32.460Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/srcdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-15T00:13:34.000Z","updated_at":"2026-04-15T00:16:34.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/srcdev/srcdev-nuxt-i18n","commit_stats":null,"previous_names":["srcdev/srcdev-nuxt-i18n"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/srcdev/srcdev-nuxt-i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srcdev%2Fsrcdev-nuxt-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srcdev%2Fsrcdev-nuxt-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srcdev%2Fsrcdev-nuxt-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srcdev%2Fsrcdev-nuxt-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/srcdev","download_url":"https://codeload.github.com/srcdev/srcdev-nuxt-i18n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/srcdev%2Fsrcdev-nuxt-i18n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33901305,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T10:30:22.771Z","updated_at":"2026-06-04T10:30:23.610Z","avatar_url":"https://github.com/srcdev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# srcdev-nuxt-i18n\n\nA standalone [Nuxt layer](https://nuxt.com/docs/getting-started/layers) providing i18n infrastructure for SRCDEV apps. Consuming apps get locale switching, RTL support, and reusable error translations out of the box via Nuxt's `extends` mechanism.\n\n## What's included\n\n- **`@nuxtjs/i18n` v10** configured with 3 locales: `en-GB` (LTR), `zh-CN` (LTR), `ar-YE` (RTL)\n- **`useRawLocaleData\u003cT\u003e(path, defaultValue?)`** — hydration-safe locale data composable with AST normalisation\n- **`useMarkdown()`** — markdown-it renderer; external links get `target=\"_blank\" rel=\"noopener noreferrer\"`\n- **Base translations** — `global.siteName` (blank, override in consuming app) and reusable `errors.*` keys (404, 500, serverError, general, actions, help, contact)\n- **Build script** — merges modular JSON source files into compiled `.ts` locale files\n\n## Usage\n\n### 1. Install peer dependencies in your consuming app\n\n```bash\nnpm install @nuxtjs/i18n@10.2.1 markdown-it\n```\n\n### 2. Extend the layer\n\n```ts\n// nuxt.config.ts\nexport default defineNuxtConfig({\n  extends: [\"../srcdev-nuxt-i18n\"], // local path, or npm package name once published\n})\n```\n\n### 3. Override `global.siteName`\n\nCreate a locale source file in your consuming app:\n\n```json\n// i18n-source/locales/global/en-GB.json\n{ \"global\": { \"siteName\": \"Your App Name\" } }\n```\n\n## Repo structure\n\n```\nsrcdev-nuxt-i18n/\n├── package.json\n├── nuxt.config.ts                  ← i18n module config, 3 locales\n├── tsconfig.json\n├── scripts/\n│   └── build-i18n.mjs              ← merge JSON → .ts, supports --watch\n├── composables/\n│   ├── useRawLocaleData.ts         ← useRawLocaleData\u003cT\u003e(path, defaultValue?)\n│   └── useMarkdown.ts              ← useMarkdown() → { renderMarkdown(text) }\n├── i18n-source/\n│   └── locales/\n│       └── global/\n│           ├── en-GB.json          ← edit these to change source translations\n│           ├── zh-CN.json\n│           └── ar-YE.json\n└── i18n/\n    └── locales/\n        ├── en-GB.ts                ← committed generated files (do not edit)\n        ├── zh-CN.ts\n        └── ar-YE.ts\n```\n\n## Build commands\n\n```bash\nnpm run build:i18n        # regenerate i18n/locales/*.ts from i18n-source JSON\nnpm run build:i18n:watch  # same, with file watching for dev\n```\n\n## Notes\n\n- `langDir` in `nuxt.config.ts` resolves relative to the layer root, so it works correctly when consumed via `extends`\n- Generated `.ts` locale files are committed — consuming apps do not need to run the build script\n- RTL support (`ar-YE`) requires CSS in the consuming app (`:dir(rtl)` or `[dir=\"rtl\"]` selectors) — not provided by this layer\n- Extracted from `srcdev-design-system`, which remains the canonical reference for original patterns and decisions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrcdev%2Fsrcdev-nuxt-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsrcdev%2Fsrcdev-nuxt-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsrcdev%2Fsrcdev-nuxt-i18n/lists"}