Skip to content

Commit 5f334df

Browse files
committed
Add CHANGELOG entry for language flags release
1 parent 5596623 commit 5f334df

1 file changed

Lines changed: 60 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,66 @@ are written for LLM coding assistants picking up this codebase in a future
1111
session: they call out file moves, schema invariants, and gotchas that aren't
1212
obvious from the diff but matter when extending the feature.
1313

14+
## 2026-05-01 — Language flags and custom flag uploads
15+
16+
### Added
17+
18+
- Real SVG flags for standard locales (it / en / de / fr / es / nl / ru / pt)
19+
via the `country-flag-icons` package, replacing emoji that rendered as
20+
letter pairs on Windows. The flags appear in the public LanguagePicker,
21+
the admin translation tabs, and the Lingue settings page.
22+
- Custom locales (e.g. `vec`) gain an optional `flagUrl`. Admins can
23+
upload a per-locale flag image from the Lingue settings page; the
24+
upload reuses the existing R2 image pipeline (JPEG/PNG/WebP, 5 MB cap)
25+
and stores objects under `images/settings/flag-<code>-*.{ext}`. Old
26+
keys are deleted on re-upload and on remove.
27+
- New backend endpoints: `POST /admin/locale-flag/:code` and
28+
`DELETE /admin/locale-flag/:code`.
29+
- New shared UI primitive `<Flag>` (in `web/src/components/ui/Flag.tsx`)
30+
that renders, in order: a custom uploaded URL → bundled SVG for known
31+
locales → uppercase code-chip fallback.
32+
33+
### Changed
34+
35+
- `customLocales[]` items gain an optional `flagUrl` field in both
36+
`UpdateSettingsBodySchema` and the public catalog `features.customLocales`.
37+
Optional and backwards-compatible — existing rows continue to work.
38+
39+
### Breaking changes
40+
41+
None. Existing catalog consumers ignore the new `flagUrl` field.
42+
43+
### Upgrade actions
44+
45+
```bash
46+
git pull
47+
(cd backend && npx wrangler d1 migrations apply menu-db --remote)
48+
(cd backend && npm run deploy)
49+
(cd web && npm run deploy:cf)
50+
```
51+
52+
No DB migrations in this release. `customLocales[*].flagUrl` lives inside
53+
the existing `settings.custom_locales` JSON column.
54+
55+
### Migrations
56+
57+
- _none in this release_
58+
59+
### Notes for AI agents
60+
61+
- `country-flag-icons` SVG strings are imported per-file
62+
(`country-flag-icons/string/3x2/<CC>`) and converted to data URLs in
63+
`web/src/lib/locale-flags.ts`. The barrel `country-flag-icons/react/3x2`
64+
pulls every flag — keep imports per-file.
65+
- `web/src/types/country-flag-icons.d.ts` declares the per-file subpath
66+
modules; the package only ships types for the index.
67+
- Custom-flag uploads deliberately do not accept SVG (parser-level XSS).
68+
If that ever changes, sanitize before storing.
69+
- `Flag` accepts a `decorative` prop. Use it whenever the locale label
70+
text is rendered next to the flag (tabs, dropdown rows) — otherwise
71+
the accessible name double-includes the language and breaks
72+
testing-library `getByRole("button", { name: ... })` lookups.
73+
1474
## 2026-05-01 — Multi-menu and standard icons
1575

1676
### Added

0 commit comments

Comments
 (0)