Fall back to related languages for missing translations
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 42/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- sqlite, typescript
- Área
- backend, internationalization
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- TypeScript
- Estrellas
- 1.8k
- Forks
- 149
- Merge medio
- 2 d 7 h
- PR fusionados (30 d)
- 14
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de michael/editable
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
michael/editable#195 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
michael/editable#181 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 20/100
Los mantenedores suelen responder en 2 días
-
Introduce snippets/examplesAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
Los mantenedores suelen responder en 2 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
Los mantenedores suelen responder en 2 días
Todos los issues de michael/editable
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
db-ux-design-system/core-web#8613 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
bug:new
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
callstackincubator/simlock#934 ·
Los mantenedores suelen responder en 1 día
-
Log page not working after errorAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gchq/LD-Explorer#286 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
foxglove/mcap#1907 · 1 comentario ·
Los mantenedores suelen responder en 1 día