Skip to content
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

Merged
merged 1 commit into from Oct 8, 2017

Conversation

reosarevok
Copy link
Member

Copy link
Contributor

@yvanzo yvanzo left a 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.

@reosarevok reosarevok force-pushed the mbs-9496 branch 2 times, most recently from cd2b4ad to a24782f Compare October 2, 2017 16:36
@reosarevok
Copy link
Member Author

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.",
Copy link
Member

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.

Copy link
Member Author

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?

Copy link
Member

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.

Copy link
Contributor

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

Copy link
Member

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?

Copy link
Contributor

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.

Copy link
Member

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. :)

Copy link
Contributor

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.

@mwiencek
Copy link
Member

mwiencek commented Oct 5, 2017

@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.

@yvanzo yvanzo merged commit 6f6780b into metabrainz:master Oct 8, 2017
@reosarevok reosarevok deleted the mbs-9496 branch February 8, 2022 10:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants