-
Notifications
You must be signed in to change notification settings - Fork 225
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
Translations: Use substitutions instead of concatenations #2646
Conversation
@@ -1183,7 +1183,7 @@ void CAudioMixerBoard::UpdateTitle() | |||
QString strEscServerName = strServerName; | |||
strEscServerName.replace ( "&", "&&" ); | |||
|
|||
setTitle ( strTitlePrefix + tr ( "Personal Mix at: " ) + strEscServerName ); | |||
setTitle ( strTitlePrefix + tr ( "Personal Mix at: %1" ).arg ( strEscServerName ) ); |
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.
Why isn't strTitlePrefix
a substitution, too? And, indeed, why isn't line 1176 amended to use substitution?
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.
This would look a bit strange:
tr ( "%1Personal Mix at: %2") (note the missing space)
The RECORDING ACTIVE can be changed of course
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.
This would look a bit strange:
That's not really much of an argument. And the change at 1176 also wasn't what I meant.
Maybe the title of the PR is wrong and this isn't about using substitutions instead of concatenations but something else?
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.
Can you give a suggestion on what should be done? This PR is to make translations easier – as noted in the linked issue. If a change is not worth it – or even the whole PR, we can close the issue and PR
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.
Like you said:
setTitle ( strTitlePrefix + tr ( "Personal Mix at: %1" ).arg ( strEscServerName ) ); | |
setTitle ( tr ( "%1Personal Mix at: %2" ).arg ( strTitlePrefix ).arg ( strEscServerName ) ); |
But only if using substitutions instead of concatenations is the goal.
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.
Fixes: jamulussoftware#1114 Co-Authored-By: Peter L Jones <pljones@users.noreply.github.com> Co-Authored-By: Gary Wang <wzc782970009@gmail.com>
@pljones ready for merge? |
Looks like it's waiting on @hoffie - I think I've approved it already. (The GitHub UI can be really opaque...) |
Short description of changes
Remove last concatenations which might benefit from being translatable. I couldn't find anything which is worth changing anymore.
CHANGELOG: Internal: Improved translator experience by using substitutions instead of concatenations
Context: Fixes an issue?
Fixes: #1114
Does this change need documentation? What needs to be documented and how?
No. It is already documented in the CONTRIBUTING file
Status of this Pull Request
Ready to be merged.
What is missing until this pull request can be merged?
Nothing. Just approvals
Checklist