Skip to content

fix(i18n-es): correct case/number collapse in the semantic-layer labels - #43311

Open
glaterza wants to merge 1 commit into
apache:masterfrom
glaterza:fix/i18n-es-case-number-collapse
Open

fix(i18n-es): correct case/number collapse in the semantic-layer labels#43311
glaterza wants to merge 1 commit into
apache:masterfrom
glaterza:fix/i18n-es-case-number-collapse

Conversation

@glaterza

@glaterza glaterza commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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 (datasetdatasource, databasedata
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:

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

Before
01-dataset-list

After
01-dataset-list

Before
02-database-list

After
02-database-list

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.

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:

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:
  • Required feature flags: SEMANTIC_LAYERS (for 8 of the 13 entries; the rest
    render in a default install)
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • 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

`features/semanticLayers/label.ts` and `semantic_layers/labels.py` export
cased and numbered variants of each label so they read correctly both as
headings and mid-sentence. The Spanish catalog collapsed each family onto a
single string, so the distinction the source deliberately draws was lost:
"Datasources", "datasource" and "datasources" all rendered "Fuente de datos",
and five members of the "data connection" family all rendered "Conexiones de
la base de datos" -- which belongs to the legacy menu label
"Database Connections".

The legacy side of the same file already models the convention correctly
("Dataset"/"dataset"/"Datasets"), so the fix follows the pattern the catalog
itself establishes.

Also corrects two strandings that render on the same screens:

- "New" was a byte-copy of "Now" -> "Ahora". It is a standalone button label
  at all five call sites, so no agreement constraint applies.
- "Copied!" and "Code Copied!" both held "SQL copiado", whose own msgid is no
  longer in the catalog, leaving both copies orphaned.

translated 3996 -> 4009, fuzzy 913 -> 900, untranslated unchanged at 197.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions github-actions Bot added i18n Namespace | Anything related to localization i18n:spanish Translation related to Spanish language labels Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.66%. Comparing base (7d4f305) to head (8c377d1).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #43311   +/-   ##
=======================================
  Coverage   66.66%   66.66%           
=======================================
  Files        2876     2876           
  Lines      164029   164029           
  Branches    37846    37846           
=======================================
+ Hits       109345   109348    +3     
+ Misses      52537    52535    -2     
+ Partials     2147     2146    -1     
Flag Coverage Δ
hive 38.10% <ø> (ø)
mysql 57.75% <ø> (ø)
postgres 57.79% <ø> (+<0.01%) ⬆️
presto 40.04% <ø> (ø)
python 59.17% <ø> (+<0.01%) ⬆️
sqlite 57.43% <ø> (ø)
unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@glaterza
glaterza marked this pull request as ready for review August 18, 2026 21:58
@bito-code-review

bito-code-review Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Code Review Agent Run #c4b47f

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: 8c377d1..8c377d1
    • superset/translations/es/LC_MESSAGES/messages.po
  • Files skipped - 0
  • Tools
    • Whispers (Secret Scanner) - ✔︎ Successful
    • Detect-secrets (Secret Scanner) - ✔︎ Successful

Bito Usage Guide

Commands

Type the following command in the pull request comment and save the comment.

  • /review - Manually triggers a full AI review.

  • /pause - Pauses automatic reviews on this pull request.

  • /resume - Resumes automatic reviews.

  • /resolve - Marks all Bito-posted review comments as resolved.

  • /abort - Cancels all in-progress reviews.

Refer to the documentation for additional commands.

Configuration

This repository uses Superset You can customize the agent settings here or contact your Bito workspace admin at evan@preset.io.

Documentation & Help

AI Code Review powered by Bito Logo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

i18n:spanish Translation related to Spanish language i18n Namespace | Anything related to localization size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant