Skip to content

feat(formatos): libros guía de los archivos de idioma como libro - #38

Merged
Consterna merged 1 commit into
mainfrom
feat/segmentacion
Nov 16, 2026
Merged

Consterna merged 1 commit into
mainfrom
feat/segmentacion

Conversation

@Consterna

Copy link
Copy Markdown
Owner

Primera parte de la ola 7 del plan de calidad (segmentación): los libros guía que viven en los archivos de idioma.

Qué cambia

Los libros guía se traducen como libro. Desde Patchouli 1.20 casi todos los libros usan claves de idioma ("i18n": true), igual que Modonomicon, y la app los mandaba al motor como textos de interfaz.

  • mods.es_clave_de_libro reconoce sus claves («…book…», «…guide…», «…lexicon…»…). Quedan fuera los nombres de objetos y los textos de menús, configuración y tooltips.
  • Esas claves van con ámbito «libro», con el título de la entrada y el texto anterior como contexto (con_vecindad).
  • Pieza.ambito permite que un módulo tenga textos de más de un ámbito. base.por_ambito y pendientes_de hacen que el proceso, el análisis, «Qué cambió» y el paquete traduzcan y cuenten cada ámbito por separado.
  • La revisión de misiones y libros incluye también estos libros.

El tono de libro ya no dice «Escribe de forma clara y natural». La frase empujaba a reescribir en vez de traducir. Vale para todos los libros guía, también los de Patchouli en JSON.

Medición

Gemini 3.8 Flash, banco de 116 textos de libros, dos corridas por condición (US$ 0,15).

Condición chrF (corridas 1 y 2)
Como interfaz (lo que pasaba con las claves de idioma) 68,3 · 67,6
Como libro, con la frase 66,6 · 67,6
Como libro, sin la frase (ahora) 68,8 · 68,3
  • Contra el tono anterior: +1,45 (IC 95 %: +0,80 a +2,12).
  • Contra traducirlos como interfaz: +0,60 (IC −0,03 a +1,28), no se distingue del ruido.

Verificación

scripts/verificar.py completo: 1372 pruebas pasan, cobertura del 94 %. Las pruebas nuevas están en tests/test_libros_por_clave.py.

Lo que queda de la ola 7

Los componentes JSON como frase entera y las descripciones de FTB Quests en bloque.

Las claves de libros de Patchouli con i18n y de Modonomicon se traducen como libro, con el título de la entrada y el texto anterior como contexto, y entran en la revisión. El tono de libro ya no pide escribir de forma natural: esa frase empujaba a reescribir y sin ella el chrF de libros sube 1,45 (IC 0,80 a 2,12).
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T01:21:07.841340Z 647bb2f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 647bb2fa30

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

for ambito, del_ambito in por_ambito(piezas, modulo.ambito).items():
hecho = self._traducir_ambito(pasada, informe, grupo, ambito, del_ambito, solo_memoria)
pendientes += hecho[0]
traducciones.update(hecho[1])

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve translations for duplicate strings across scopes

When the same English string is pending under both a book key and a regular UI key, each scope produces a translation keyed only by that source string. This update overwrites the UI result with the book result, and Mods.escribir then applies that one value to both keys, losing the scope-specific translation. Preserve the per-key scope association or otherwise resolve the shared value intentionally.

Useful? React with 👍 / 👎.

)
for pieza in con_contexto:
piezas.append(Pieza(pieza.texto, pieza.pista, AMBITO_LIBRO))
self._ambitos[pieza.texto] = AMBITO_LIBRO

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Count pending work separately for each scope

When the same English string is pending under both a book key and a regular UI key, _ambitos can store only one scope for that string, and pendientes_de receives only the strings. It therefore checks the book scope for both occurrences and misses pending UI work, underreporting the analysis and estimated translation cost even though execution translates both scopes.

Useful? React with 👍 / 👎.

@Consterna
Consterna merged commit 2a002fc into main Nov 16, 2026
5 checks passed
@Consterna
Consterna deleted the feat/segmentacion branch November 16, 2026 01:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant