glaterza opened a new pull request, #42728:
URL: https://github.com/apache/superset/pull/42728
### SUMMARY
75 entries in the Spanish catalog carried a translation whose **format
placeholders did not match the source string**: 50 dropped a placeholder
present in the `msgid`, 24 introduced one the `msgid` never had, and the rest
renamed or reordered them.
All 75 were legacy `#, fuzzy` entries — translations Babel's fuzzy matcher
stranded from a *different* source string, before `--no-fuzzy-matching` was
added to `babel_update.sh` (the failure mode that change's comment describes).
Many therefore rendered an unrelated sentence:
| `msgid` | Spanish before | What it actually said |
| --- | --- | --- |
| `Clear %s filter` | `borrar todos los filtros` | "clear all filters" |
| `Invalid SQL: %(error)s` | `Función NumPy no válida: %(operator)s` | wrong
message *and* wrong argument name |
| `Edit %s` | `Editar usuario` | "Edit user" — on a dataset menu |
| `Select %s or type to search %s` | `Selecciona el esquema o introduce el
nombre para buscar esquemas` | says "schema" on the database picker |
| `%s min ago` | `Hace 1 mes` | "1 month ago" |
| `%s s ago` | `Hace 30 días` | "30 days ago" |
| `Ends with (ILIKE %x)` | `Anchura del borde` | "Border width" |
Because catalogs are compiled with `--use-fuzzy`, these were **live in the
Spanish UI**, not withheld.
They were also latent build breakage. Removing the `fuzzy` flags without
fixing the text makes `msgfmt -c` report **70 fatal format errors**; with this
change it reports **none**. That is what allowed the entries to sit broken for
so long — `msgfmt` skips format checking on fuzzy entries.
This follows the reviewer workflow described in
`docs/developer_docs/contributing/howtos.md`:
> Reviewers should verify each entry and remove the `#, fuzzy` flag to
promote it to a confirmed translation.
**Method.** Every `%s` / `%(name)s` was checked against its actual call site
to confirm what the placeholder receives, rather than translating the catalog
in isolation. For example `Select %s or type to search %s` is passed the
*database* label (`databaseLabel()`, feminine in Spanish), so that string
deliberately takes no article, while `Missing %s` is passed
`datasetLabelLower()` (masculine), so `Falta el %s` is safe. Wording follows
the catalog's existing register: informal *tú*, `dataset` → *conjunto de
datos*, `dashboard` → *panel de control*.
**Scope.** Only entries with a provable placeholder mismatch. The remaining
~1,024 fuzzy entries in `es` are untouched; I'd like to follow up with the
legacy entries that say the wrong thing but happen to have matching
placeholders (e.g. `Export All Data` → *"Borrar todos los datos"*, "Delete all
data").
**Known limitation, not introduced here.** Count strings such as `%s
Physical` and `%s Selected (%s)` use `t()` rather than `tn()`, so no single
Spanish form is correct for both 1 and N. I chose the plural. Fixing that
properly needs a source change and is out of scope.
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
<!-- Drag the four images in here. -->
**Explore → dataset menu (`Edit %s`)** — before: `Editar usuario` ("Edit
user"); after: `Editar conjunto de datos`
**SQL Lab → database picker (`Select %s or type to search %s`)** — before:
`Selecciona el esquema…` ("schema"); after: `Selecciona base de datos…`
### TESTING INSTRUCTIONS
The defect and the fix are both mechanically verifiable.
**1. The catalog compiles cleanly:**
```bash
msgfmt -c --statistics -o /dev/null
superset/translations/es/LC_MESSAGES/messages.po
# 3922 translated, 1024 fuzzy, 93 untranslated
```
**2. The entries were genuinely broken** — strip the `fuzzy` flags on
`master` and compile:
```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
# master: msgfmt: found 70 fatal errors
# this PR: no format errors
```
**3. No translation regression** (the repo's own check):
```bash
python scripts/translations/check_translation_regression.py --count \
--translations-dir /path/to/master/superset/translations > /tmp/before.json
python scripts/translations/check_translation_regression.py --compare
/tmp/before.json
# No translation regressions.
# es: translated 3847 -> 3922 (+75), fuzzy 1099 -> 1024 (-75)
```
**4. In the UI:** set `LANGUAGES` to include `es`, build translations, and
switch the language to Spanish. Open any chart in Explore and click the ⋮ next
to the dataset name — the first item should read *"Editar conjunto de datos"*,
not *"Editar usuario"*. In SQL Lab, the database picker placeholder should
mention *base de datos*, not *esquema*.
### 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]