Fall back to related languages for missing translations
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 42/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- sqlite, typescript
- Ambito
- backend, internationalization
Direzione di ricerca
Start with src/app/server_translations.ts, the main implementation file named in the issue. Trace how translations are read, saved, and revisioned, then identify the editor and migration entry points for the remaining requirements. Done means fallback follows LANGUAGES order, inherited values are handled correctly on save, revisions detect fallback edits, the editor identifies inherited text, and the one-time cleanup is complete.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
Regional variants of a language (e.g. de-AT and de-DE) are translated independently. Every text has to be stored redundantly in each variant, and the variants can silently drift apart when only one is updated.
Proposal
When a text has no translation in the requested language, fall back to the other languages with the same base code before using the main language. The chain is derived automatically from the LANGUAGES order, so no configuration is needed:
de-AT→ otherde-*languages (inLANGUAGESorder) → main language- Example with
LANGUAGES="en,de-DE,de-AT":de-AT→de-DE→en
A variant then only stores what actually differs (e.g. "Jänner", "Servus" in de-AT); everything else is inherited from its siblings. Listing languages in the right order controls preference (e.g. put de-DE before de-AT if de-CH should prefer it).
Implementation notes
- Reading: overlay the fallback languages' translations first, then the requested language's own translations. Fallback works per text/media property, as translations already do, so a page may mix sources.
- Saving: compare edits against the inherited view, not the main language. Otherwise untouched inherited text gets copied into the variant on the first save. Text equal to the inherited value removes the variant's override (consistent with today's "equal to the original removes the translation").
- Versions: the translation revision must include the fallback languages' rows, so editing
de-DEmarks an opende-ATeditor as stale. - Editor: in translation mode, indicate which texts are inherited from a fallback language and which are overridden.
- Migration: one-time cleanup that removes variant values identical to their fallback.
Trade-offs
- A variant can no longer deliberately show the main-language text while a sibling has a translation (it would fall back to the sibling).
- Overrides don't follow later changes in the fallback language. That's usually intended, but could go stale unnoticed. A "fallback changed" indicator could be a follow-up.
Most of the change would live in src/app/server_translations.ts.
- Lingua principale
- TypeScript
- Stelle
- 1.8k
- Fork
- 149
- Merge medio
- 2g 7h
- PR unite (30g)
- 14
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di michael/editable
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
michael/editable#195 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
michael/editable#181 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
I maintainer di solito rispondono entro 2 giorni
-
Introduce snippets/examplesAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di michael/editable
Issue simili
-
数据界面的横向滚动条缺失Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
zilliztech/attu#1037 ·
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
openclaw/openclaw#181212 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
apify/apify-mcp-server#1684 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/data-liberation-agent#953 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
siteboon/claudecodeui#1642 ·
I maintainer di solito rispondono entro 5 giorni