Page MenuHomePhabricator

Log entries are difficult to localize; convert old style logs to the new code
Open, MediumPublic

Description

Author: theevilipaddress

Description:
Currently, the only message for localizing the block log entries is [[MediaWiki:Blocklogentry]]. The parameter $2 can be different values here:

*either a timeframe, like 5 days, 6 months
*"indefinitely"
*a date, for example "2010-01-01T00:00:00"

However, often there isn't one word combination that fits them all, even in English. The first one should be "blocked $1 for a timeframe of $2 $3". The second should simply be "blocked $2 indefinitely $3", because "for a timeframe of indefinitely" just sounds bad. The third one then should be "blocked $1 until $2 $3". Thus, this one message should be splitted into these three different messages.

Another problem is that the time isn't properly localized. If an admin decides to block someone for an unusual timeframe and writes "6 minutes" into the form, then "6 minutes" will not be localized in the block log entry. The same goes for dates, which are always in the YYYY-MM-DDTHH:MM:SS format, even if that's not the user's preferred date format.

Details

Reference
bz24620

Related Objects

StatusSubtypeAssignedTask
ResolvedUmherirrender
ResolvedNone
OpenNone
Declinedsiebrand
Resolved Fabrice_Florin
Resolvedmatthiasmullie
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedUmherirrender
ResolvedNone
ResolvedUmherirrender
OpenNone
OpenNone
ResolvedGlaisher
DeclinedNone
ResolvedGlaisher
DuplicateNone
OpenNone
OpenNone
OpenNone
Resolvedmatej_suchanek
ResolvedZabe
OpenNone
ResolvedGlaisher
Resolvedmatej_suchanek
ResolvedGlaisher

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:11 PM
bzimport set Reference to bz24620.
bzimport added a subscriber: Unknown Object (MLST).

I agree. The block log should be modernized to store enough data to allow more dynamic translations. Increasing severity.

Rewrite done, but each type needs a conversion. Using this as a tracking bug for now.

(In reply to comment #3)

Rewrite done, but each type needs a conversion. Using this as a tracking bug
for now.

As you're not going to fix the blockers yourself, where are the instructions to do so? Is [[mw:Manual:Logging to Special:Log]] the correct page to direct people to for code standards, l10n best practices, word order and parameters etc.?

With [[gerrit:29279]] there are some types added to the LogFormatter-class.

In [[gerrit:31067]] I add some tests for LogFormatter.

Patch sets were merged briefly, but broke several extensions because LogFormatter::getMessageParameters was changed from protected to public (Interwiki, AbuseFilter, RenameUser). Changing the extensions, will cause problems with BC.

Sam and I decided that reverting is the sanest thing to do right now, because he'll be making the next 1.21wmf branch tomorrow, and having this code in, would unnecessarily complicate things for him.

I also advise to add the logic and test cases in the same change set on the next try.

I have fixed the problems of the changes and upload a new change: https://gerrit.wikimedia.org/r/#/c/38137/

For documantation: gerrit:38137 was merged

Looks like Umherirrender will get this fixed by 1.25. :) https://www.mediawiki.org/wiki/MediaWiki_1.25#Logging_and_gender (let's remember to update it when we close this).

demon set Security to None.
demon added a subscriber: demon.

Would've been good to have, and the pieces fixed will definitely be worth including. Won't make it for 1.25 though.