mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2026-08-24 05:04:33 +00:00
feat(i18n): translate labels, and keep brand names out of it
name and title were translated at render time but never machine-filled, on the grounds that no backend tells the menu label "Pictures" from the brand "Mastodon". That left the visible half of a card in English. They are filled now, and the two key sets collapse into one. The brands need somewhere to be named instead. app/i18n/keep.txt lists them, one per line, and every entry is stored as itself in every target language: no request, and never over an entry written by hand. --keep adds one-off strings, --keep-file points elsewhere. The shipped list holds the 43 product names that appear as name: or title: in config.sample.yaml. Generic labels — Pictures, Imprint, Settings, Certificates — are deliberately absent, and so are Cybermaster, Polymath and Yachtmaster, which read as brand or as job title depending on who is asking. Two of these behaviours first shipped unguarded. A test that protected a string and asserted the hand-written value survived passed either way, because a run where nothing is missing reports "complete" and never writes; and nothing exercised main(), so the keep file could stop being read without a failure. Both are covered. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
23
README.md
23
README.md
@@ -171,10 +171,25 @@ make i18n
|
||||
This fills the interface strings of the languages that ship no catalogue as
|
||||
well. Existing entries are never overwritten, and a string the shipped
|
||||
catalogue already covers is never requested, so corrections you make by hand
|
||||
survive later runs. Only prose (`description`, `text`, `warning`, `info`, `subtitel`) is
|
||||
filled automatically; `name` and `title` are left to you, because a machine
|
||||
cannot tell the menu label "Pictures" from the brand "Mastodon". Write those
|
||||
into the content catalogue yourself when you want them translated.
|
||||
survive later runs.
|
||||
|
||||
`name`, `title`, `description`, `text`, `warning`, `info` and `subtitel` are
|
||||
translated; `url`, `link_text`, `identifier` and icon classes never are.
|
||||
|
||||
A machine cannot tell the menu label "Pictures" from the brand "Mastodon", so
|
||||
list the brands in `app/i18n/keep.txt`, one per line — they are then stored as
|
||||
themselves in every language and cost no request:
|
||||
|
||||
```
|
||||
# Strings utils/i18n_sync.py stores as themselves instead of translating.
|
||||
Mastodon
|
||||
Nextcloud
|
||||
freelancermap.de
|
||||
```
|
||||
|
||||
Add one-off entries with `--keep Foo Bar`, or point somewhere else with
|
||||
`--keep-file`. A protected string never replaces an entry you already wrote by
|
||||
hand.
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user