Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .changeset/yaml-first-translations.md

This file was deleted.

7 changes: 7 additions & 0 deletions examples/bilingual/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @edoxen/browser-example-bilingual

## 0.0.18

### Patch Changes

- Updated dependencies [5501082]
- @edoxen/browser@0.10.0

## 0.0.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/bilingual/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edoxen/browser-example-bilingual",
"version": "0.0.17",
"version": "0.0.18",
"private": true,
"type": "module",
"description": "Bilingual @edoxen/browser example — EN + FR content via per-field LocalizedString.",
Expand Down
7 changes: 7 additions & 0 deletions examples/minimal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @edoxen/browser-example-minimal

## 0.0.18

### Patch Changes

- Updated dependencies [5501082]
- @edoxen/browser@0.10.0

## 0.0.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edoxen/browser-example-minimal",
"version": "0.0.17",
"version": "0.0.18",
"private": true,
"type": "module",
"description": "Minimal @edoxen/browser example — single-locale, decisions-only.",
Expand Down
7 changes: 7 additions & 0 deletions examples/multibody/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @edoxen/browser-example-multibody

## 0.0.18

### Patch Changes

- Updated dependencies [5501082]
- @edoxen/browser@0.10.0

## 0.0.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/multibody/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edoxen/browser-example-multibody",
"version": "0.0.17",
"version": "0.0.18",
"private": true,
"type": "module",
"description": "Multi-body @edoxen/browser example — CIML + Conference + DC badges.",
Expand Down
7 changes: 7 additions & 0 deletions examples/standalone/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @edoxen/browser-example-standalone

## 0.0.18

### Patch Changes

- Updated dependencies [5501082]
- @edoxen/browser@0.10.0

## 0.0.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/standalone/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edoxen/browser-example-standalone",
"version": "0.0.17",
"version": "0.0.18",
"private": true,
"type": "module",
"description": "Standalone-mode @edoxen/browser showcase — no astro.config: edoxen.config.ts + data + src/styles/override.css theming demo.",
Expand Down
24 changes: 24 additions & 0 deletions packages/browser/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,29 @@
# @edoxen/browser

## 0.10.0

### Minor Changes

- 5501082: YAML-first translations.

Translators work in YAML, not JS literals. The runtime i18n table now ships as six per-locale YAML files (`src/i18n/strings/<locale>.yaml`) parsed at build time via Vite's `?raw` import + the `yaml` package. Consumer overrides gain a symmetric loader.

### Added

- `loadYamlTranslations(yamlString)` helper, exported from `@edoxen/browser`. Parses a YAML mapping of `'key': 'value'` pairs into a frozen `UiStrings` record. Throws clearly on non-mapping input, ignores non-string values, returns `{}` for empty input.
- `src/i18n/load-translations.spec.ts` — six tests covering happy path, unicode/quote escaping, empty input, malformed input, freeze guarantee.

### Changed

- `src/i18n/strings/{eng,fra,zho,spa,ara,rus}.yaml` — built-in locale tables extracted from the TS literal that used to live inline in `ui.ts`. Same keys, same values, just YAML. Translators can read these as worked examples.
- `src/i18n/ui.ts` — `STRINGS` const now references `BUILTIN_STRINGS` (loaded from YAML); the 557-line inline table is gone. `loadYamlTranslations` is re-exported for consumers.
- `src/virtual.d.ts` — declares `*.yaml?raw` and `*.yml?raw` modules so TypeScript accepts Vite's raw YAML imports.
- README §Custom translations rewritten to make YAML the primary path: Option A (file-based, recommended) loads via `readFileSync` + `loadYamlTranslations`; Option B (inline literals) still works for small overrides. Includes YAML escaping rules (`'` doubling inside single-quoted scalars, or backslash escapes in double-quoted).

### Migration notes for consumers

No breaking changes — inline `uiStrings: { fra: {...} }` literals still work. Consumers who want file-based translations can adopt the new helper without touching existing config. Built-in English + French values are unchanged.

## 0.9.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@edoxen/browser",
"version": "0.9.0",
"version": "0.10.0",
"description": "Astro-based browser for edoxen YAML data — drop in your data and ship a resolutions archive site.",
"type": "module",
"license": "BSD-2-Clause",
Expand Down
Loading