Last modified: 2007-09-10 01:58:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 5387 - Block log items on RecentChanges don't make use of possible translations
Block log items on RecentChanges don't make use of possible translations
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
Special pages (Other open bugs)
unspecified
All All
: Normal normal with 4 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 2775 7307 10138 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-03-29 15:38 UTC by spacebirdy
Modified: 2007-09-10 01:58 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch (trunk) (2.96 KB, patch)
2006-04-20 15:45 UTC, Rotem Liss
Details
Patch (REL1_6) (3.02 KB, patch)
2006-04-20 15:50 UTC, Rotem Liss
Details
Alternative Patch (trunk) (10.65 KB, patch)
2006-05-20 18:09 UTC, Rotem Liss
Details
Alternative Patch (trunk) (10.66 KB, patch)
2006-05-20 18:10 UTC, Rotem Liss
Details
Alternative Patch (trunk) (10.08 KB, patch)
2006-05-20 18:12 UTC, Rotem Liss
Details
Alternative Patch v2 (trunk) (10.25 KB, patch)
2006-05-29 18:45 UTC, Rotem Liss
Details
Alternative Patch v3 (trunk) (10.25 KB, patch)
2006-05-31 15:25 UTC, Rotem Liss
Details
Patch v2 (trunk) (2.94 KB, patch)
2006-06-10 15:52 UTC, Rotem Liss
Details
Alternative Patch v4 (trunk) (10.25 KB, patch)
2006-06-10 15:55 UTC, Rotem Liss
Details

Description spacebirdy 2006-03-29 15:38:44 UTC
Hello all,
in the recent changes the block duration is still shown in English if changed in
[[MediaWiki:Ipboptions]]
although in the [[Special:Log/block]] it is shown correctly.

examples:
Time (Aktuell; Vorherige) . . Admin(Diskussion | Beiträge) (blockiert
Benutzer:someUser für einen Zeitraum von: 2 hours: reason)
[[:w:de:Spezial:Recentchanges]] -> (Benutzerblockaden-Logbuch)
but correct shown in :[[:w:de:Spezial:Log/block]] -> "2 Stunden" instead of "2
hours"

other example: compare
[[:w:fr:Special:Log/block]]
[[:w:fr:Special:Recentchanges]] -> (Historique des blocages)

same on other wikies and wikties: de, fr, es, ...

Many thanks in advance for your help,
best regards,
Elisabeth Anderl ([[:wikt:is:Notandi:Spacebirdy]])
Comment 1 spacebirdy 2006-03-29 15:39:50 UTC
> examples:
> Time (Aktuell; Vorherige) . . Admin(Diskussion | Beiträge) (blockiert
> Benutzer:someUser für einen Zeitraum von: 2 hours: reason)
> [[w:de:Spezial:Recentchanges]] -> (Benutzerblockaden-Logbuch)
> but correct shown in :[[w:de:Spezial:Log/block]] -> "2 Stunden" instead of "2
> hours"
> 
> other example: compare
> [[w:fr:Special:Log/block]]
> [[w:fr:Special:Recentchanges]] -> (Historique des blocages)

correcting the links (I hope so)
Comment 2 spacebirdy 2006-03-29 15:41:27 UTC
(In reply to comment #1)
> > examples:
> > Time (Aktuell; Vorherige) . . Admin(Diskussion | Beiträge) (blockiert
> > Benutzer:someUser für einen Zeitraum von: 2 hours: reason)
> > [[de:Spezial:Recentchanges]] -> (Benutzerblockaden-Logbuch)
> > but correct shown in :[[de:Spezial:Log/block]] -> "2 Stunden" instead of "2
> > hours"
> > 
> > other example: compare
> > [[fr:Special:Log/block]]
> > [[fr:Special:Recentchanges]] -> (Historique des blocages)

hmpf, sorry, what I need is a preview button ;(, I hope this works now
Comment 3 lɛʁi לערי ריינהארט 2006-04-18 21:01:17 UTC
Was this fixed together with
Bug 5592: Set the logs fixed text in Recent Changes as the site language, not
the user's one ?
Comment 4 Rotem Liss 2006-04-20 11:00:47 UTC
(In reply to comment #3)
> Was this fixed together with
> Bug 5592: Set the logs fixed text in Recent Changes as the site language, not
> the user's one ?

I don't think so, but I will check it.
Comment 5 Rotem Liss 2006-04-20 15:45:44 UTC
Created attachment 1589 [details]
Patch (trunk)

The patch fixes the problem in the trunk. Patch for REL1_6 is coming soon.

The patch does, technically, the following things:
* In LogPage::actionText (includes/LogPage.php), there was a parameter named
$translate (by default false (when getting the text for the recent changes),
when calling from LogViewer::LogLine (includes/SpecialLog.php) true) as a
condition for translating the block expiry time expression (in addition to the
basic condition that the log action will be "block", else there is no time
exrpession). It was canceled, and all its references were deleted.
* This variable was originally created because the translated time expression
wasn't shown well in the recent changes – they've included a span HTML tag,
which was shown because no HTML is allowed in the recent changes comments. This
span was invented to pop-up the original time expression, in the original
formatting; however, it is not useful for most of the people, and the other can
go to the block log and see it if they want. This span was in the return value
of the functions Language::translateBlockExpiry (languages/Language.php) and
LanguageFi::translateBlockExpiry (languages/LanguageFi.php). This patch has
moved the span to LogPage::actionText (includes/LogPage.php), if it is $skin
(that means, the block log) – else (that means, the recent changes), no span
is used.
* In Language::translateBlockExpiry (languages/Language.php), wfMsg is used.
However, in the recent changes we should use the content language (because the
log is actually an edit summary), so it was replaced the wfMsgForContent if the
object and $wgContLang class names are equal – else, wfMsg is used. It is not
a good hack, but it is already used in Language.php, and it works.

It seems long, but it isn't. I've just documented the patch as much as possible
here, for you will easily review it.
Comment 6 Rotem Liss 2006-04-20 15:50:41 UTC
Created attachment 1590 [details]
Patch (REL1_6)

Just the same.

By the way, there is a command for SVN used to merge a patch into existing SVN
directories? I've checked in the manual, and searched in the commands list (svn
help), but I haven't found any command like that (svn merge is used for another
purpose, as far as I understand). For example, I've downloaded MediaWiki from
the SVN, downloaded a patch from here, and want to merge the patch changes into
my SVN directories to check it, or to improve it. Should I do that manually, or
there is an automatic way? Thanks if you reply, it will help me a lot creating
fixes for MediaWiki.
Comment 7 Brion Vibber 2006-04-20 18:19:17 UTC
This issue is bogus; the block durations are customizable and 
may change order, size, amount, number, etc. There's no 
available translation information to back such a feature.

Re comment 6: use the standard Unix patch utility.
Comment 8 Rotem Liss 2006-04-21 11:40:46 UTC
(In reply to comment #7)
> This issue is bogus; the block durations are customizable and 
> may change order, size, amount, number, etc. There's no 
> available translation information to back such a feature.
It is translated in the block log, and most of the blocks are done using the
translated options. Also, if we have available translation for something, we
better use it – like we use the English translation if no local translation is
exist, and we don't say "there is no available translation for EVERY string,
English strings will confuse the users, so we better don't use the translation
at all if it isn't complete".

Also, if a site uses an expiry time which is not listed (and has no
translation), its sysops can add it into "ipboptions", and it will have
translation. There is no reason to confuse users with English phrases if we have
an available translation. Also, most of the site sysops are probably
non-technical people, which will most likely use an item from the list.
> Re comment 6: use the standard Unix patch utility.
Thanks, I will try that.
Comment 9 Brion Vibber 2006-04-21 20:26:21 UTC
There is no "English translation". The available option contains a list of
entries, each composed of a machine-readable duration and a localized display
string.
Comment 10 Rotem Liss 2006-04-22 13:23:29 UTC
(In reply to comment #9)
> There is no "English translation". The available option contains a list of
> entries, each composed of a machine-readable duration and a localized display
> string.
> 

And both the block log and the recent changes should use the localized display
string (if available) when showing the items of "X blocked Y for the duration of
Z". The block log shows the localized string, but the recent changes shows the
machine-readable duration. The recent changes should also show the localized
string, and the patch changes the recent changes view so the page *will* show
the localized string.
Comment 11 Brion Vibber 2006-04-22 19:54:54 UTC
Ah, ok I see what you mean.

Not sure the patch makes sense totally though. There's some really 
crappy existing code in there; translateBlockExpiry needs to be 
ripped out and replaced with something that makes sense. It seems 
halfway done but not all there.

What's this for instance supposed to be doing? :)
+		return '”'.htmlspecialchars( trim( $final ) ).'”';
Comment 12 Rotem Liss 2006-04-23 11:13:40 UTC
(In reply to comment #11)
> Not sure the patch makes sense totally though. There's some really 
> crappy existing code in there; translateBlockExpiry needs to be 
> ripped out and replaced with something that makes sense. It seems 
> halfway done but not all there.

You may improve the patch and rewrite the whole code.

> What's this for instance supposed to be doing? :)
> +		return '”'.htmlspecialchars( trim( $final ) ).'”';
> 

This code returns the localized time expiry from the function (in
LanguageFi.php), with trim, htmlspecialchars and the quotes, like the original
code but without the original '<span title="X">' which is inserted in another
part of the code. (The original code doesn't use htmlspecialchars, but the code
in Language.php does, so the code in LanguageFi.php also should use
htmlspecialchars.)
Comment 13 Rotem Liss 2006-05-12 15:54:36 UTC
*** Bug 2775 has been marked as a duplicate of this bug. ***
Comment 14 Rotem Liss 2006-05-20 18:09:34 UTC
Created attachment 1802 [details]
Alternative Patch (trunk)

This patch completely rewrites Language::translateBlockExpiry: now it first
checks if $str is "inifinite", then uses the message "infiniteblock"
immediantly; else, it explodes the string by spaces, goes over the array,
parses the strings (for example, in "7 months 3 weeks", parses "7 months" and
"3 weeks" separatly) using the new "nseconds", "nminutes", "nhours", "ndays",
"nweeks", "nmonths" and "nyears" messages; then it adds the parsed string to
the array $result (if didn't succeed to parse, it adds the original phrase),
and returns this imploded array.

The final result of this script is a clean output, also for "7 months" and "7
months 3 weeks". This rewriting does not depend on "ipblockoptions" for
translation, and is much more logical.

By the way, "ipboptions" was removed, and replaced by the unlocalizable
"blockoptions", which includes only the original phrases and ommits the
translation. We should have a way to change the block options in the site,
however it shouldn't be confused with the translation of the time phrases.
[[Special:Blockip]] now uses the improved Language::translateBlockExpiry.

Unluckily, I was forced to duplicate "wfMsgExt" into "wfMsgExtForContent".

Of course this patch is not for REL1_6, but for trunk only. I think it makes
sense and should be inserted. I've checked this patch on my computer and it
works very well.
Comment 15 Rotem Liss 2006-05-20 18:10:47 UTC
Created attachment 1803 [details]
Alternative Patch (trunk)

Typo.
Comment 16 Rotem Liss 2006-05-20 18:12:43 UTC
Created attachment 1804 [details]
Alternative Patch (trunk)

Another typo.
Comment 17 Rotem Liss 2006-05-29 18:45:52 UTC
Created attachment 1856 [details]
Alternative Patch v2 (trunk)

This patch fixes some problems in the old patch:
1. "infiniteblock" message could not be locally changed (in MediaWiki:
namespace).
2. An error in the parsing (created a paragraph around each result), now using
"parsemag" instead of "parse".
3. Allowing the special form of "2 hours" in Hebrew, by the new third parameter
of "plural" there.
I think my proposed Language::translateBlockExpiry is much more logical than
the current one, as it can translate every time phrase to the local language as
far as I've checked.
Comment 18 Rotem Liss 2006-05-31 15:25:08 UTC
Created attachment 1862 [details]
Alternative Patch v3 (trunk)

Updating the patch line numbers, to make its applying easier.
Comment 19 Rotem Liss 2006-06-10 15:52:32 UTC
Created attachment 1929 [details]
Patch v2 (trunk)

Some lines were changed – matching the patch to the current revision.
Comment 20 Rotem Liss 2006-06-10 15:53:49 UTC
Comment on attachment 1590 [details]
Patch (REL1_6)

Not suitable for branch.
Comment 21 Rotem Liss 2006-06-10 15:55:44 UTC
Created attachment 1930 [details]
Alternative Patch v4 (trunk)

Updating the line numbers.
Comment 22 Raimond Spekking 2006-09-13 09:11:57 UTC
*** Bug 7307 has been marked as a duplicate of this bug. ***
Comment 23 Raimond Spekking 2006-10-26 16:36:41 UTC
*** Bug 7674 has been marked as a duplicate of this bug. ***
Comment 24 Raimond Spekking 2007-06-04 18:20:20 UTC
*** Bug 10138 has been marked as a duplicate of this bug. ***
Comment 25 Aaron Schulz 2007-07-11 03:03:45 UTC
This will be dealt with when revisiondelete is merged in. Also, rob will do additional cleanup and generalizing likely.
Comment 26 Rotem Liss 2007-09-10 01:58:16 UTC
Fixed in r25709. The alternative patch is a fix for another bug (something like "Don't translate block expiry times using ipboptions, but directly") and obviously needs updating.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links