glaterza opened a new pull request, #42808:
URL: https://github.com/apache/superset/pull/42808

   ### SUMMARY
   
   39 entries in the Spanish catalog carry a translation that renders a 
**different string
   than the English `msgid`**. Several render the opposite of the source:
   
   | `msgid` | Spanish shown to users | What it actually says |
   | --- | --- | --- |
   | `Select all` | `Deseleccionar todo` | **Deselect all** |
   | `Data Export Options` | `Opciones del gráfico` | **Chart options** |
   | `Export All Data` | `Borrar todos los datos` | **Delete all data** |
   | `Sign in` | `No está en` | **Not in** |
   | `Not Contains` | `Denunciar un contenido` | **Report content** |
   | `Equals` | `Secuencial` | Sequential |
   | `True` | `MAR` | Tue |
   | `Client Secret` | `Selección de columna` | Column select |
   
   `Select all` is the label on the button whose handler is `handleSelectAll()`
   (`Select.tsx:654`) — so a user clicking a control that reads **"Deselect 
all"** selects
   every option. `Sign in` renders twice on the login page, as the card title 
*and* the
   submit button.
   
   These are legacy strandings. The old `pybabel update` fuzzy matcher copied a 
translation
   from a similar-looking `msgid`; where it guessed wrong, the copied Spanish 
stayed behind.
   `babel_update.sh` has since moved to `--no-fuzzy-matching`, so this is 
cleanup of damage
   already done rather than an ongoing source of new breakage.
   
   They are live in the UI: both the frontend and backend builds compile with 
`--use-fuzzy`,
   so a `#, fuzzy` entry is displayed, not withheld. This is also why `msgfmt` 
never caught
   them — it skips format checking on fuzzy entries.
   
   **This is the follow-up to #42728**, which fixed the 75 entries whose format 
*placeholders*
   didn't match. That defect class had a mechanical proof (`msgfmt`). This one 
does not: the
   placeholders here are fine, so the errors are only visible to someone who 
reads both
   languages.
   
   #### How these were found, and where the method fails
   
   A script made the class tractable, and it is worth stating how it works so 
the change is
   auditable rather than "trust me":
   
   > The fuzzy matcher *copies* a translation from another entry. When it 
guesses wrong, the
   > copied Spanish usually still sits on the entry it was correctly 
translating. So a fuzzy
   > entry whose `msgstr` is byte-identical to another entry's, where the two 
`msgid`s are
   > textually dissimilar, is a stranding suspect.
   
   **The detector under-reports, and this is a structural property, not a 
tuning problem.**
   When a *legitimate* synonym shares the stranded translation, the pair scores 
as similar and
   never surfaces. Three entries in this PR were missed that way:
   
   | Missed entry | Masked by |
   | --- | --- |
   | `Select all` → "Deseleccionar todo" | `Deselect all` → "Deseleccionar 
todo" (correct) |
   | `Data Export Options` → "Opciones del gráfico" | `Chart Options` → 
"Opciones del gráfico" (correct) |
   | `Revoke` → "Eliminar" | `Remove` → "Eliminar" (correct) |
   
   The first two were caught only by opening the running UI and looking. The 
third is left for
   a follow-up. So: the detector is a lead generator, not a proof, and this PR 
is **not** a
   claim that the catalog is clean.
   
   **Every entry here was confirmed by reading its call site**, which changed 
several of the
   translations. Entries with no reachable call site were left alone rather 
than guessed at
   (e.g. `beta`, whose only occurrences are in test files).
   
   #### Scope notes
   
   - **The ag-Grid table filter menu is corrected as a whole.** Three entries 
surfaced
     individually, then turned out to sit in one dropdown 
(`AgGridTable/index.tsx:556-587`)
     where most neighbours were also stranded. Fixing 3 of 13 in the same menu 
would have
     been incoherent. Note this table is behind `AG_GRID_TABLE_ENABLED`; 
`Select all` and
     `Select All` are **not** flag-gated and render in the core `Select` 
component.
   - **Every shared `msgid` was checked for other call sites** before being 
touched — `to`,
     `Group`, `Select All`, `Select all`.
   - **The Datastore connection error** listed the *BigQuery* roles and 
permissions instead
     of the Datastore ones (`db_engine_specs/datastore.py`).
   - **`Referrer` is deliberately left untranslated.** It is `Log.referrer` — 
the HTTP Referer
     URL — in an admin audit view, and this catalog already keeps protocol 
terms as-is
     (`URL`, `JSON`, `dttm`, `Host`). It replaces "Actualizar" (*Refresh*), 
which was wrong.
   - **`Feature Not Enabled` → "Función no habilitada"**: *funcionalidad* is 
arguably the more
     precise Spanish, but this catalog uses *función* for the software sense 
throughout
     (`función de desglose`, `función experimental`) and *funcionalidad* 
appears nowhere in
     its 4,871 entries. Consistency was chosen over precision; happy to switch.
   - Entries carrying the `# Machine-translated via backfill_po.py` comment are 
**out of
     scope** — those are AI drafts awaiting review, a different workflow.
   
   38 `#, fuzzy` flags are cleared, since the corrected entries are now 
confirmed
   translations. `Deleted %s` was already un-fuzzy — confirmed, and wrong.
   
   Deliberately **not** included, to keep this reviewable: two recently-added 
features
   (API keys, semantic layers/views) shipped with almost entirely stranded 
catalogs and want
   their own PR.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   Captured on a local instance running `apache/superset:f65b424`, this PR's 
base commit.
   
   | | Before | After |
   | --- | --- | --- |
   | **Login page** | `Sign in` renders as "No está en" (*Not in*) on both the 
card title and the submit button | "Iniciar sesión" |
   | **Explore → export menu** | "Opciones del gráfico" → "Borrar todos los 
datos" / "Invertir página actual" | "Opciones de exportación de datos" → 
"Exportar todos los datos" / "Exportar la vista actual" |
   | **Multi-select bulk actions** | "Deseleccionar todo (66)" with 0 selected 
— the control that selects all | "Seleccionar todo (66)" |
   
   ### TESTING INSTRUCTIONS
   
   The catalog compiles cleanly and no new format errors are introduced:
   
   ```bash
   msgfmt -c --statistics -o /dev/null 
superset/translations/es/LC_MESSAGES/messages.po
   # 3931 translated, 978 fuzzy, 197 untranslated  (was 3893 / 1016 / 197)
   ```
   
   To confirm none of the newly-confirmed entries hides a format defect, 
blanket-clear the
   fuzzy flags and recompile — `msgfmt` only format-checks non-fuzzy entries:
   
   ```bash
   sed -E 's/^#,(.*)fuzzy(.*)$/#,\1\2/' \
     superset/translations/es/LC_MESSAGES/messages.po > /tmp/t.po
   msgfmt -c -o /dev/null /tmp/t.po
   ```
   
   This reports **4 fatal errors both before and after this change** — all 
pre-existing, in
   `%s column`, `%s item`, `Added to 1 dashboard` and `%(suggestion)s instead 
of …`. Anything
   above 4 would mean new breakage.
   
   To see the strings in the UI, run with the locale set to `es`, then:
   
   - **Login page** — card title and submit button
   - **Explore → any chart → ⋮ → Data Export Options** — the submenu and its 
two children
   - **Any multi-select** (e.g. Explore → Filters → a string column → operator 
`IN`) — the
     bulk-action bar at the bottom of the dropdown
   - **Settings → Action Log** — the `Referrer` column
   - **A table chart's column filter menu** (requires `AG_GRID_TABLE_ENABLED`) 
— operators,
     `Blanks`, `AND`/`OR`
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [x] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to