Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Fall back to related languages for missing translations

Abierto
#215 0 comentarios 0 reacciones 0 asignados Ver en GitHub

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

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 → other de-* languages (in LANGUAGES order) → 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-DE marks an open de-AT editor 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

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de michael/editable

Todos los issues de michael/editable

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.