Skip to content

fix(i18n): translate DateFilter tooltip for time range values#40286

Open
miharejec wants to merge 1 commit into
apache:masterfrom
miharejec:fix/translate-date-filter-tooltip
Open

fix(i18n): translate DateFilter tooltip for time range values#40286
miharejec wants to merge 1 commit into
apache:masterfrom
miharejec:fix/translate-date-filter-tooltip

Conversation

@miharejec
Copy link
Copy Markdown

SUMMARY
The tooltip on the date filter pill (time range selector) was showing untranslated English text instead of the localized string. For example, when using Superset in Slovenian, the tooltip showed "Current day" instead of "Tekoči dan".

This happened because the raw value string (e.g. "Current day", "Last week") was used directly in the tooltip without passing it through t() for translation. The pill label itself was already translated (via t() in the DateLabel component), but the tooltip was missed.

Three places were fixed:
getTooltipTitle(): wrap label in t() so the tooltip shows the translated label when the pill text is truncated
Initial tooltipTitle state: wrap value in t() so the tooltip is translated before the time range API call resolves
Error fallback: wrap value in t() so the tooltip is translated when the API call fails
This affects all time range values shown in the tooltip: Current day/week/month/quarter/year, Last day/week/month/quarter/year, previous calendar week/month/quarter/year, and No filter.

TESTING INSTRUCTIONS
Configure Superset to use a non-English locale that has translations for time range values (e.g. Slovenian, German, Chinese)
Navigate to a dashboard or chart with a time range filter
Set the time range to a value like "Current day" or "Last week"
Hover over the date filter pill to see the tooltip
Verify the tooltip text is translated to the configured locale
Also verify when the pill text is truncated (narrow container) — the bold label in the tooltip should also be translated

ADDITIONAL INFORMATION

  • Changes UI

The tooltip on the date filter pill was showing untranslated English
text (e.g. 'Current day' instead of the localized string). This was
because the raw value was used directly without passing it through
t() for translation.

- Wrap label in t() inside getTooltipTitle for truncated labels
- Translate initial tooltipTitle state with t(value)
- Translate error fallback tooltipTitle with t(value)
@dosubot dosubot Bot added explore:filter Related to filters in Explore i18n:general Related to translations labels May 20, 2026
@bito-code-review
Copy link
Copy Markdown
Contributor

bito-code-review Bot commented May 20, 2026

Code Review Agent Run #ac78c5

Actionable Suggestions - 0
Review Details
  • Files reviewed - 1 · Commit Range: e91c189..e91c189
    • superset-frontend/src/explore/components/controls/DateFilterControl/DateFilterLabel.tsx
  • 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

@sadpandajoe sadpandajoe added the merge-if-green If approved and tests are green, please go ahead and merge it for me label May 20, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

❌ Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.16%. Comparing base (e617903) to head (e91c189).
⚠️ Report is 26 commits behind head on master.

Files with missing lines Patch % Lines
...nts/controls/DateFilterControl/DateFilterLabel.tsx 33.33% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master   #40286   +/-   ##
=======================================
  Coverage   64.16%   64.16%           
=======================================
  Files        2591     2591           
  Lines      138293   138293           
  Branches    32084    32084           
=======================================
  Hits        88736    88736           
  Misses      48027    48027           
  Partials     1530     1530           
Flag Coverage Δ
javascript 67.04% <33.33%> (ø)

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

☔ View full report in Codecov by Sentry.
📢 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.

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

Labels

explore:filter Related to filters in Explore i18n:general Related to translations merge-if-green If approved and tests are green, please go ahead and merge it for me size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants