Page MenuHomePhabricator

Localize auto-summaries
Open, LowestPublicFeature

Description

Hi!

When we go to a wiki (like Wikipedia) and click at the "new section" link (or the [+] at the top of some page), and then click at the "preview" buttom, it is shown a header like
"Editing $1 (new section)". However, the language of this message not change to the language choosen by the user: at en.wikipedia it is always in English. At pt.wikibooks, it is always in Portuguese, and so on...

The same problem happens with MediaWiki:newsectionsummary, when we look at:

PS: I've also asked about this at translatewiki:
http://translatewiki.net/w/i.php?title=Support&oldid=1245792#New_section_message


Version: 1.21.x
Severity: enhancement
URL: http://en.wikipedia.org/w/index.php?title=Wikipedia%3ASandbox&diff=298135586&oldid=298135490
See Also:
T46623: Babel autocreate edit summary in user language instead of content language

Details

Reference
bz19363

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 10:40 PM
bzimport set Reference to bz19363.
bzimport added a subscriber: Unknown Object (MLST).

This is because enwiki customized the message, see [[MediaWiki:Editingcomment]] and [[MediaWiki:Newsectionsummary]].

I don't think so, because [[MediaWiki:Newsectionsummary/pt-br]] has the value "/* $1 */ nova seção" and when we set the language to "pt-br" in [[Special:Preferences]] the text does not change as could be expected.

'Editingcomment' is a UI element, not an auto-summary. It _should_ change when you change your UI language. Do you mean something else?

In any case, 'Newsectionsummary' is wfMsgForContent(), so it should _not_ be changing based on your UI language. Cannot replicate faulty behavior on local install.

Hi ^demon!

You can do the following to replicate the behavior at [[Main page|en.wikipedia]] (I did exactly these steps):

  • Login at [[Special:UserLogin]];
  • Go to [[Special:Preferences]] and at "User profile", under "Internationalisation", choose the language "pt-br-Português do Brasil" and Save;
  • Go to [[Talk:Main Page]] and click [+], or click in the link below:

http://en.wikipedia.org/w/index.php?title=Talk:Main_Page&action=edit&section=new

  • Type "something" at the Summary field ("Assunto/cabeçalho", in portuguese) and click "Preview" ("Mostrar previsão");
  • Now you can see "Previsão de assunto/título: (→something: new section)" instead of "Previsão de assunto/título: (→test: NOVA SEÇÃO)";

By the way, what is "wfMsgForContent"?

Have a nice week! =)
Helder

Ah ok, I see what you mean. That is a preview of what your edit summary will be. The edit summary text is supposed to be a content-language (which is what wfMsgForContent() does), not in your UI language. That's so going down the edit history, you don't see "new section," "nova secao", "nouvelle section", etc.

As far as I can tell, everything here is working like it should.

I'm not sure what you mean by "The edit summary text is supposed to be a ''content-language''":
When we go to
http://en.wikipedia.org/w/index.php?title=Talk%3AMain_Page&diff=298228627&oldid=298224522
it is shown "m (→something: new section)" just below the user name. But when I did the edit, I didn't type "new section", so as a user, we could expect to see the text in our language, because it seems to be "part of the interface", and everything else that is part of it is shown in the correct language. Moreover, if it is not to be translated, and is expected that everybody will see "new section" in english, why there are several translated versions of these messages at /pt /fr /ja...?

How can I found where is wfMsgForContent defined at svn?

Thanks for clarifying... ;-)
Helder

Rephrasing bug so it makes more sense to me and others in the future.

Not sure how much interest there is in implementing this, though. *shrug*

Lot's of work for minor benefit, imho.

(In reply to comment #6)

I'm not sure what you mean by "The edit summary text is supposed to be a
''content-language''":
When we go to
http://en.wikipedia.org/w/index.php?title=Talk%3AMain_Page&diff=298228627&oldid=298224522
it is shown "m (→something: new section)" just below the user name. But when
I did the edit, I didn't type "new section", so as a user, we could expect to
see the text in our language, because it seems to be "part of the interface",
and everything else that is part of it is shown in the correct language.
Moreover, if it is not to be translated, and is expected that everybody will
see "new section" in english, why there are several translated versions of
these messages at /pt /fr /ja...?

Currently, autosummaries are not part of the interface, but are saved in the database verbatim. This means that for every revision, there's only one summary in one language that everybody sees. For this reason, it's undesirable to have this stored in the UI language, because then an edit made by a Brazilian person would show an edit summary in pt-br for everyone.

How can I found where is wfMsgForContent defined at svn?

It's in includes/GlobalFunctions.php . What it does is format a message in the content language as opposed to the UI language.

Hi Roan!

(In reply to comment #9)

Currently, autosummaries are not part of the interface, but are saved in the
database verbatim. This means that for every revision, there's only one summary
in one language that everybody sees. For this reason, it's undesirable to have
this stored in the UI language, because then an edit made by a Brazilian person
would show an edit summary in pt-br for everyone.

Suppose that a user speaks the language PT-BR and has set this in the preferences. When the user do an edit at the project EN.wikipedia, I can imagine three possible behaviors that autosumaries we could have:
(1) The user sees "Editing $1 (new section)" when previewing and "/* $1 */ new section" in the history and recent changes. If the user changes from PT-BR to any other language, these messages remain UNCHANGED;
(2) The user sees "Editando $1 (nova seção)" when previewing and "/* $1 */ nova seção" in the history and recentchanges. If the user changes from PT-BR to any other language, these messages remain UNCHANGED;
(3) The user sees "Editando $1 (nova seção)" when previewing and "/* $1 */ nova seção" in the history and recentchanges. If the user changes from PT-BR to any other language, these messages CHANGES according to the new language;

Currently, what we have is the version (1).

Considering that (A) the "new section" part of the messages are _not_ typed by the user, and that (B) what the user type is usually in the language set in the preferences (PT-BR), and that (C) the sumaries should be saved exactly as they are when the user preview his edit, I think that what makes more sense for the user is the option (2).

Maybe what I've said in my previous comments was not clear, but I'm not asking to have the option (3): the second one makes more sense.

(In reply to comment #8)

Lot's of work for minor benefit, imho.

By the way, this is indeed a "minor benefit" but it has confused me a lot =S when I came across this: The default language at Portuguese projects is PT and I'm Brazilian, so I set PT-BR in the preferences. But every time I've created a new section since I collaborate at pt.wikibooks I see "nova secção" instead of "nova seção". And this looks like a "typo" considering that the language was set to PT-BR, and not PT. So I was looking at
http://pt.wikibooks.org/wiki/Especial:Todas_as_mensagens
, then at
http://pt.wikibooks.org/wiki/MediaWiki_Discuss%C3%A3o:Newsectionsummary
and then at translatewiki
http://translatewiki.net/w/i.php?title=MediaWiki:Newsectionsummary/pt-br&action=edit&loadgroup=core&loadtask=view
trying to understand what is wrong... =/
It took me a while before I realize this is what MediaWiki was "supposed" to do...

So the current behavior do not seems the correct one...

Question: Is it difficult to change from (1) to (2)?

How can I found where is wfMsgForContent defined at svn?

It's in includes/GlobalFunctions.php . What it does is format a message in the
content language as opposed to the UI language.

Thanks!

Helder

Moving to option 2 is certainly easy, but I'm not sure that's desirable. As Roan pointed out, summaries are currently stored verbatim. The reason the summaries are the way they are (in the content language) is because seeing these change on a history page would be confusing; imagine 4 users with en, fr, pt-br and ja all edit the same page and leave their localized versions of "New section" in the history.

Option 3 would be ideal, but it's not really easy. We'd have to extract the auto-summary part of the stored edit summary and then change it to the correct content language. Like Niklas said in comment 8, a lot of work for a minor benefit.

Humm... good point.

Indeed of admin's point of view, that page history would be somewhat confusing =/. But I think that situation is not very usual at the localized projects... =) Anyway at commons and meta this seems to be more frequent... In this sense, I agree that (3) would be the better choice...

But since it is not so easy, I can live with (1) for while... At least now I understand we wasn't doing anything wrong and I know where I can read the source code of MediaWiki... ;-)

Thanks everybody!
Helder

Closing WONTFIX. Original reporter seems to agree in comment 12.

Reopening since this is now implemented at least for Wikidata.

Compare
http://www.wikidata.org/w/index.php?title=Q4918&action=history&uselang=en
http://www.wikidata.org/w/index.php?title=Q4918&action=history&uselang=pt

In the first case we have "Added site-specific [ruwiki] link". In the second, "Adicionado link específico do site [ruwiki]".

Wikidata uses a horrible hack currently, but the CommentStore migration actually established the foundations for this in core, see T215422: Migrate Wikibase to use comment_data field instead of SummaryFormatter.

Aklapper changed the subtype of this task from "Task" to "Feature Request".Feb 4 2022, 11:02 AM
Aklapper removed a subscriber: wikibugs-l-list.