Skip to content

Translate the meter dB range descriptions - #11967

Merged
grliszas14 merged 2 commits into
audacity:masterfrom
jonata:fix-meter-db-range-translation
Sep 9, 2026
Merged

grliszas14 merged 2 commits into
audacity:masterfrom
jonata:fix-meter-db-range-translation

Conversation

@jonata

@jonata jonata commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Resolves: #11940

The eight entries in the meter dB range dropdown (Preferences > Audio settings)
were bare string literals returned straight as QString from
MeterModel::description(), so they were shown in English whatever language the
application was set to.

No new translation work is needed. These strings come from Audacity 3's wave
track settings, and share/locale already carries them — translated — under the
wave-track-settings context. They were simply never looked up. Routing them
through that context makes all of them resolve.

On the choice of context

This is the part worth a second look in review. The rest of this module uses
qtrc("playback", …), which is the obvious thing to reach for here and is
wrong: it finds nothing and reproduces the bug exactly. Checked against the
built .qm:

wave-track-settings  ->  -48 dB (amplitude PCM en échantillonnage 8 bits)   [translated]
playback             ->  -48 dB (PCM range of 8 bit samples)                [NOT TRANSLATED]

The context is noted in a comment next to the constant so the next person does
not "fix" it to match the module.

Verification

All eight strings, against the .qm files produced by this build:

Locale Result
fr, de, es, pt_BR, ru, ja 8/8 translated, 0 missing

Not changed

Range144's label reads -145 dB while PlaybackMeterDbRange::toDouble()
returns -144.0. The label matches Audacity 3 and matches the translated source
string exactly, so changing it would break the lookup in every language. If that
discrepancy is a real problem it needs its own issue, since fixing it means
retranslating.

  • I signed CLA
  • The title of the pull request describes an issue it addresses
  • If changes are extensive, then there is a sequence of easily reviewable commits
  • Each commit's message describes its purpose and effects
  • There are no behavior changes unnecessary for the stated purpose of the PR

Recommended:

  • Each commit compiles and runs on my machine without known undesirable changes of behavior

QA:

  • Testflow test cases have been run

@coderabbitai

coderabbitai Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI (base), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 86c641a3-5433-4e6d-bfb8-b30cbe1f4077

📥 Commits

Reviewing files that changed from the base of the PR and between efcf4fd4fb7c44d6d13102641fee1ab007dc92dc and d5b431b4dce1e3b7cfd63215ded9abbf63884406.

📒 Files selected for processing (1)
  • src/playback/view/common/metermodel.cpp
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/playback/view/common/metermodel.cpp

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The meter model removes local description constants and the shared context constant. It includes translation.h. The description() method now calls muse::qtrc() with the "wave-track-settings" context for each meter range.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to d11ef

Meter range labels now use existing localized strings, and the supplied verification confirms translated display. No current merge-blocking risk is identified.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly describes the primary change: translating the meter dB range descriptions.
Description check ✅ Passed The description identifies issue #11940, explains the untranslated-string cause, documents the translation context, and records verification results. It is complete and relevant, although the statemen…
Linked Issues check ✅ Passed The changes address issue #11940 by routing all eight meter dB range descriptions through the existing translated strings in the wave-track-settings context. The reported behavior is verified for mult…
Out of Scope Changes check ✅ Passed The changes are limited to the translation lookup for the meter dB range descriptions. No unrelated code changes are identified.

Warning

Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped musescore/musescore.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@JLWALTENER

Copy link
Copy Markdown

Many thanks @jonata , PR Windows artifact tested, looks good for me, strings are now shown translated.

@grliszas14 grliszas14 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jonata thanks for the contribution! Noted one thing that needs to be addressed

Comment thread src/playback/view/common/metermodel.cpp Outdated
@@ -215,21 +214,21 @@ QString MeterModel::description(PlaybackMeterDbRange::DbRange range) const
{
switch (range) {
case PlaybackMeterDbRange::DbRange::Range36:
return DB36_DESCRIPTION;
return muse::qtrc(DB_RANGE_CONTEXT, "-36 dB (shallow range for high-amplitude editing)");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use bare wave-track-settings string in all of those places like this:

return muse::qtrc("wave-track-settings", "-36 dB (shallow range for high-amplitude editing)");

and remove DB_RANGE_CONTEXT variable along with the comment.

That's because lupdate tool that reads the codebase and updates the translation sources is just a simple text parser and won't work correctly.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, thanks!

The eight entries in the meter dB range dropdown were bare string literals
returned straight as QString, so they were shown in English whatever language
the application was set to.

The translations already exist. These strings come from Audacity 3's wave
track settings and share/locale carries them, translated, under the
"wave-track-settings" context - they were simply never looked up. Routing them
through that context makes every one of them resolve with no new translation
work: checked against the built .qm files for fr, de, es, pt_BR, ru and ja,
all eight strings translate in all six.

The context matters more than it looks. Filing them under "playback", which is
what the rest of this module uses and the obvious choice, finds nothing at all
and reproduces the bug exactly.
@grliszas14
grliszas14 force-pushed the fix-meter-db-range-translation branch from d5b431b to d11ef3f Compare September 9, 2026 12:12
@grliszas14
grliszas14 merged commit 5cd829d into audacity:master Sep 9, 2026
9 of 10 checks passed
kryksyh added a commit that referenced this pull request Sep 22, 2026
Translate the meter dB range descriptions (#11967)
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.

Meter dB range shown as untranslated

3 participants