Skip to content

Buttons: do not translate empty button text - #1314

Open
f3l1x wants to merge 2 commits into
masterfrom
claude/amazing-bardeen-74yvzl-909
Open

f3l1x wants to merge 2 commits into
masterfrom
claude/amazing-bardeen-74yvzl-909

Conversation

@f3l1x

@f3l1x f3l1x commented Sep 30, 2026

Copy link
Copy Markdown
Member

Closes #909.

Problem: an icon-only action (empty name) still called translate('') on every row. That filled translator logs with missing '' keys.

Fix: skip the text when it is ''. This applies to Action, MultiAction, ToolbarButton, Export and Filter SubmitButton. The rendered HTML is the same. '0' is still rendered.

Tested (locally):

  • 36 tests pass. The new test fails on the old code.
  • phpcs and phpstan are clean.

Note: Export still translates its title when it is ''. I did not change that, because it would change the output.

🤖 Generated with Claude Code

https://claude.ai/code/session_012jmXrhsCDpW1PebtBnDxhy


Generated by Claude Code

Action, MultiAction, ToolbarButton, Export and filter SubmitButton passed
an empty text to the translator, so icon-only buttons produced a
missing-translation entry for '' on every render.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012jmXrhsCDpW1PebtBnDxhy
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.65%. Comparing base (48bb5da) to head (51673ba).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1314      +/-   ##
==========================================
+ Coverage   54.78%   55.65%   +0.87%     
==========================================
  Files          65       65              
  Lines        3019     3022       +3     
==========================================
+ Hits         1654     1682      +28     
+ Misses       1365     1340      -25     

☔ 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.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Buttons with translated text issue

1 participant