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
MBS-9496: Modbot "AC being changed" edit note is confusing #558
Conversation
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.
Please create an $artistname
variable, alike the $editid
one, so as to save translators from cabalistic symbols.
cd2b4ad
to
a24782f
Compare
Changed! |
@@ -485,7 +486,7 @@ with 'MusicBrainz::Server::Controller::Role::Edit' => { | |||
$c->model('EditNote')->add_note( | |||
$ac_edit->id, | |||
{ | |||
text => "The artist name has been changed in edit #$editid.", | |||
text => "This credit is being changed because the main name for the artist qq{$artistname} is being modified by edit #$editid.", |
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.
qq{$artistname}
should just be $artistname
(you're already inside quotes so that would literally output qq{U2}
).
Also, should we add display quotes around “$artistname”
? e.g. the artist “is” is
reads a bit more clearly than the artist is is
.
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.
Adding display quotes is exactly what I was trying to achieve here. Do I just use “ ” then?
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.
Yes, you can use the unicode ones directly in the string.
Otherwise the ASCII ones would just need to be escaped with a backslash: artist \"$artistname\" is
.
qq
only makes sense on the outside as an alternative quote operator, so you can do e.g. qq("a'bunch"of'nonsense")
without having to escape those normal quotes.
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.
For the record, it requires both utf8
and a backslash for a proper encoding of unicode quotes.
Fixed in 9fc9a4c
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.
Now I'm curious, what happens without the backslash?
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.
Fancy characters are displayed instead: https://musicbrainz.org/edit/49349519
It is only necessary for not-localized messages since encoding is done by l
function.
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.
Sorry, I meant I saw the edit in IRC, but I don't understand why the backslash is needed. I never had to backslash Unicode quotes before and couldn't find what this does in any documentation, so I want to learn what it does. :)
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.
Sorry, I just meant it has the same weird output. I guess it is probably the same as:
"This ... artist" . encode('utf-8', '“') . $artistname . encode('utf-8', '”') . "is ..."
Note that this message is not passed directly to template. It is stored into the database first. That is probably why it requires special attention compared to other messages.
@yvanzo These notes aren't translated at present, unless I misunderstood you. I'm not sure they could be easily right now, since we only have the interpolated values when the note is created. |
https://tickets.metabrainz.org/browse/MBS-9496