-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix use of translation functions #5629
Conversation
🤖 Hey, I'm @LmmsBot from github.com/lmms/bot and I made downloads for this pull request, click me to make them magically appear! 🎩
Linux
Windows
macOS
🤖{"platform_name_to_artifacts": {"Linux": [{"artifact": {"title": {"title": "(AppImage)", "platform_name": "Linux"}, "link": {"link": "https://8259-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.689-linux-x86_64.AppImage"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8259?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}], "Windows": [{"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://8257-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.689-mingw-win64.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8257?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://8258-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.689-mingw-win32.exe"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8258?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}, {"artifact": {"title": {"title": "32-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/mxbk7bgay6bgocd0/artifacts/build/lmms-1.2.2-msvc2017-win32.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34628258"}, {"artifact": {"title": {"title": "64-bit", "platform_name": "Windows"}, "link": {"link": "https://ci.appveyor.com/api/buildjobs/14gekdrrfndoa52b/artifacts/build/lmms-1.2.2-msvc2017-win64.exe"}}, "build_link": "https://ci.appveyor.com/project/Lukas-W/lmms/builds/34628258"}], "macOS": [{"artifact": {"title": {"title": "", "platform_name": "macOS"}, "link": {"link": "https://8260-15778896-gh.circle-artifacts.com/0/lmms-1.2.2.689-mac10.13.dmg"}}, "build_link": "https://circleci.com/gh/LMMS/lmms/8260?utm_campaign=vcs-integration-link&utm_medium=referral&utm_source=github-build-link"}]}, "commit_sha": "f34f894a84f9885b91da295f8ee676fb96b3c1e1"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM.
I will update the translation template after this PR gets merged. Thanks for your work!
setToolTip(_pk.description()); | ||
setToolTip(_pk.desc->subPluginFeatures | ||
? _pk.description() | ||
: tr(_pk.desc->description)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although this will certainly not break anything, I am not sure whether this will be effective since _pk.desc->description
is dynamic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case that _pk.desc->subPluginFeatures
is null, _pk.desc
is a static descriptor from a plugin binary, e.g.:
lmms/plugins/Amplifier/Amplifier.cpp
Lines 34 to 45 in f34f894
Plugin::Descriptor PLUGIN_EXPORT amplifier_plugin_descriptor = | |
{ | |
STRINGIFY( PLUGIN_NAME ), | |
"Amplifier", | |
QT_TRANSLATE_NOOP( "PluginBrowser", "A native amplifier plugin" ), | |
"Vesa Kivimäki <contact/dot/diizy/at/nbl/dot/fi>", | |
0x0100, | |
Plugin::Effect, | |
new PluginPixmapLoader("logo"), | |
NULL, | |
NULL | |
} ; |
I'm not aware of any code that modifies these (we should probably make them const), and the description is clearly intended to be translated. This also matches the code in EffectSelectDialog
:
lmms/src/gui/EffectSelectDialog.cpp
Line 237 in f34f894
labelText += "<p><b>" + tr("Description") + ":</b> " + qApp->translate( "PluginBrowser", descriptor.description ) + "</p>"; |
Merge? |
I am very sorry for the late response. I think it's good to merge now. |
Fixes some outdated or incorrect usage of translation functions.
pluginBrowser
class has since been renamed toPluginBrowser
, so translations using that context have been updated to use the new name.setupWidget
toAudioDeviceSetupWidget
. This is consistent with the use ofMidiSetupWidget
for MIDI backends.tr
.presName.replace(tr("\""), tr("'")); // QFileDialog unable to handle double quotes properly
from vst_base has been changed not to usetr
- it doesn't make sense to allow translators to override this and breakQFileDialog
.InstrumentSoundShaping
now useQT_TRANSLATE_NOOP
rather thantr
;tr
has no effect there since the translations have not been loaded yet at that point.TrackContentObjectView
,SetupDialog
, andSampleTCOView
had calls totr
factored out of ternary expressions, or into lambdas. This breakslupdate
, which can't recognise anything but string literals withintr
calls. Calls totr
have been moved to wrap the literals.QString
totr
,toLatin1
has been changed totoUtf8
, since this is the encoding Qt expects.PluginBrowser
now translates descriptions in its tooltips for plugins that aren't subplugins.InstrumentTrack
.