Repository navigation
feat(contexto): trozos de componentes con su frase y líneas con su continuación - #39
Conversation
…ntinuación Cada trozo de un componente JSON de estilos mezclados se sigue traduciendo aparte, pero con la frase entera en la pista. Una línea de una misión o de un libro que no cierra su frase lleva el comienzo de la siguiente.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 285f9accc8
ℹ️ 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".
| frase = " ".join("".join(trozos).split()) | ||
| frase = frase if len(frase) <= LARGO_FRASE else frase[: LARGO_FRASE - 1] + "…" | ||
| extra = f"trozo de la frase «{frase}»" | ||
| return [Pieza(u, f"{pista} · {extra}" if pista else extra) for u in partes] |
There was a problem hiding this comment.
Keep styled titles identifiable as titles
When an FTB Quests title or book name/title is a multi-part JSON component, this suffix means the hint no longer ends with title or exactly equals libro: title. The title predicates then fail, so con_vecindad does not establish the right title context for following text and may carry over the previous title instead. Preserve the title-field identity separately from the component-context hint.
Useful? React with 👍 / 👎.
| trozos = json_texto.extraer(texto, literal) or [] | ||
| if len(partes) < 2 or len(trozos) < 2: | ||
| return [Pieza(u, pista) for u in partes] | ||
| frase = " ".join("".join(trozos).split()) |
There was a problem hiding this comment.
Exclude hover text from the visible phrase context
When a component has multiple visible text segments and a hoverEvent.show_text, json_texto.extraer also returns the tooltip text, so this concatenation treats it as part of the visible phrase (for example, combining a label with its tooltip). That unrelated phrase is then added as context to each chunk and can mislead their translations; build the context from the same rendered text run or keep hover text separate.
Useful? React with 👍 / 👎.
Segunda parte de la ola 7 del plan de calidad: frases partidas, con su contexto.
Qué cambia
["", {"text": "Use the "}, {"text": "Wrench", "color": "gold"}, …]): cada trozo se sigue traduciendo aparte, para no perder colores ni eventos, pero ahora lleva la frase entera en la pista («trozo de la frase «Use the Wrench to rotate blocks.»»). Lo aplicabase.piezas_deen las misiones (FTB Quests en SNBT y en JSON, Heracles) y en los libros.quitar_vecindadtambién quita esta parte, para las mediciones sin vecindad.Por qué así y no traduciendo el bloque entero
Traducir la frase como plantilla y repartirla entre los trozos, o la descripción como un solo bloque, obliga a reescribir cómo se escriben los archivos. Además, si el modelo mueve los cortes, las líneas o los estilos quedan desalineados. La pista da el mismo contexto sin ese riesgo, igual que el contexto de la ola 4, que se midió y mejoró la interfaz.
Medición
Sin medición con el modelo: los bancos tienen sus pistas fijas y no traen componentes de varios trozos. Lo cubren las pruebas de
tests/test_contexto_de_trozos.py.Verificación
scripts/verificar.pycompleto: 1375 pruebas pasan.