Repository navigation
Translate the meter dB range descriptions - #11967
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI (base), Organization UI (inherited) Review profile: CHILL Plan: Team Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between efcf4fd4fb7c44d6d13102641fee1ab007dc92dc and d5b431b4dce1e3b7cfd63215ded9abbf63884406. 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe meter model removes local description constants and the shared context constant. It includes Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to 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)
Warning Linked repositories: Public OSS repositories can only analyze public repositories installed in this organization. No linked repositories were analyzed; skipped 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. Comment |
|
Many thanks @jonata , PR Windows artifact tested, looks good for me, strings are now shown translated. |
grliszas14
left a comment
There was a problem hiding this comment.
@jonata thanks for the contribution! Noted one thing that needs to be addressed
| @@ -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)"); | |||
There was a problem hiding this comment.
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.
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.
d5b431b to
d11ef3f
Compare
Translate the meter dB range descriptions (#11967)
Resolves: #11940
The eight entries in the meter dB range dropdown (Preferences > Audio settings)
were bare string literals returned straight as
QStringfromMeterModel::description(), so they were shown in English whatever language theapplication was set to.
No new translation work is needed. These strings come from Audacity 3's wave
track settings, and
share/localealready carries them — translated — under thewave-track-settingscontext. They were simply never looked up. Routing themthrough 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 iswrong: it finds nothing and reproduces the bug exactly. Checked against the
built
.qm: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
.qmfiles produced by this build:Not changed
Range144's label reads-145 dBwhilePlaybackMeterDbRange::toDouble()returns
-144.0. The label matches Audacity 3 and matches the translated sourcestring 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.
Recommended:
QA: