glaterza opened a new pull request, #43311:
URL: https://github.com/apache/superset/pull/43311
### SUMMARY
The Spanish catalog collapsed several families of labels that the source code
deliberately keeps distinct, so one Spanish string was serving four English
msgids differing only in case or number.
Two files — `superset-frontend/src/features/semanticLayers/label.ts` and
`superset/semantic_layers/labels.py` — do one job: swap vocabulary when the
`SEMANTIC_LAYERS` flag is on (*dataset* → *datasource*, *database* → *data
connection*). Between them they contain exactly **19** translatable strings,
and
each is exported in a cased/numbered variant so labels read correctly both as
headings and mid-sentence:
```ts
datasetLabel() = sl(t('Dataset'), t('Datasource'))
datasetLabelLower() = sl(t('dataset'), t('datasource'))
datasetsLabel() = sl(t('Datasets'), t('Datasources'))
datasetsLabelLower() = sl(t('datasets'), t('datasources'))
// same shape for the database / data connection family
```
**10 of those 19 were broken.** Six msgids all rendered "Conexiones de la
base de
datos" — which is the legitimate translation of a seventh, the legacy menu
label
`Database Connections`. Three all rendered "Fuente de datos". One was
capitalised
where the source asks for lower case. The remaining 9 were already correct
and are
untouched.
| msgid | Before | After |
| --- | --- | --- |
| `datasets` | Conjuntos de datos | conjuntos de datos |
| `datasource` | Fuente de datos | fuente de datos |
| `Datasources` | Fuente de datos | Fuentes de datos |
| `datasources` | Fuente de datos | fuentes de datos |
| `databases` | Bases de datos | bases de datos |
| `Data connection` | Conexiones de la base de datos | Conexión de datos |
| `data connection` | Conexiones de la base de datos | conexión de datos |
| `Data connections` | Conexiones de la base de datos | Conexiones de datos |
| `data connections` | Conexiones de la base de datos | conexiones de datos |
| `Data Connections` | Conexiones de la base de datos | Conexiones de datos |
**Proof a reviewer can check without reading Spanish:** the legacy half of
the same
file already models the convention correctly — `Dataset` / `dataset` /
`Datasets`
are "Conjunto de datos" / "conjunto de datos" / "Conjuntos de datos". This
change
makes the semantic half follow the pattern the catalog itself already
establishes.
`Data Connections` and `Data connections` both map to "Conexiones de datos".
That is
intentional: Spanish does not title-case headings, so the English difference
between
them is styling rather than meaning.
#### Scope
Three further entries are included because they are visibly wrong on the same
screens a reviewer will open to check the above. They are **not** part of
the 19,
and are called out here rather than folded silently into the claim:
| msgid | Before | Literally | After |
| --- | --- | --- | --- |
| `New` | Ahora | "Now" | Nuevo |
| `Copied!` | SQL copiado | "SQL copied" | ¡Copiado! |
| `Code Copied!` | SQL copiado | "SQL copied" | ¡Código copiado! |
- `New` was a byte-copy of `Now`'s translation. It is a standalone button
label at
all five call sites (`DatasetList`, `DatabaseList`, `NewItemDropdown`),
never
composed with a following noun, so no agreement constraint applies.
- `Copied!` and `Code Copied!` both held "SQL copiado", whose own msgid is
no longer
in the catalog — both copies were orphaned. The catalog is inconsistent
about
whether to carry an English trailing `!`; these two keep it, in the full
`¡…!` form Spanish requires.
Every one of the 13 msgids was checked tree-wide for its *call site*, not
its bare
text, over `superset-frontend/{src,packages,plugins}` and `superset/` (5,210
files).
The ten label entries appear only in the two files named above.
`msgfmt` statistics move by exactly the entry count and nothing else:
**translated 3996 → 4009, fuzzy 913 → 900, untranslated unchanged at 197.**
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
### TESTING INSTRUCTIONS
Two of the entries (`datasets`, `databases`) render in a default install.
The rest
need the `SEMANTIC_LAYERS` feature flag, which ships default-off — which is
precisely why these strings rotted unnoticed.
```python
FEATURE_FLAGS = {"SEMANTIC_LAYERS": True}
```
Switch the UI to Spanish, then:
1. **`/tablemodelview/list/`** — the nav item and page title read "Fuentes
de datos"
(were "Fuente de datos"); the create button reads "+ Nuevo" (was "+
Ahora"); the
filter and column header read "Conexión de datos" (were "Conexiones de la
base de
datos"). Hovering the import icon shows "Importar fuentes de datos".
2. **`/databaseview/list/`** — the page title and the Settings → Data
Connections menu
link both read "Conexiones de datos".
3. **`/sqllab/`** — the connection selector placeholder reads "Selecciona
conexión de
datos o escribe para buscar conexiones de datos", exercising the singular
and the
plural in one sentence.
4. **Explore → datasource menu** — "Editar fuente de datos" / "Intercambiar
fuente de
datos", exercising the lower-case singular mid-sentence.
5. **With the flag off** — the SQL Lab placeholder reads "…buscar bases de
datos" and
the dataset-list import tooltip reads "Importar conjuntos de datos"; both
were
capitalised mid-sentence before.
Catalog checks:
```bash
msgfmt -c --statistics -o /dev/null
superset/translations/es/LC_MESSAGES/messages.po
```
Not verified in a running UI, and flagged as such: `Copied!` and `Code
Copied!` (both
need a clipboard write or a saved-query/query-history row) and the lower-case
`data connection`, which renders only inside the delete-connection
confirmation modal.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [x] Required feature flags: `SEMANTIC_LAYERS` (for 8 of the 13 entries;
the rest
render in a default install)
- [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]