Page MenuHomePhabricator

User toggles in specific language overrided the default user toggles
Closed, ResolvedPublic

Description

The option 'tog-highlightbroken' (Format broken links) is missing when the user
perferences is switched to Zh series interface. (Zh, Zh_tw, Zh_hk and Zh_sg inherits
to Zh_cn)


This is the original part of User toogles in the LanguageZh_cn.php file (obtained
from the latest Subversion head
[http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/languages/LanguageZh_cn.php?
view=log])

/* private */ $wgUserTogglesZh_cn = array(
'nolangconversion',

) + $wgUserTogglesEn;

I don't know whether this option is disabled in default or this affected by this
piece of the code. But if possible, can anyone fix that problem?

thanks and regards
Man


Version: unspecified
Severity: normal

Details

Reference
bz5753

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 9:13 PM
bzimport set Reference to bz5753.
bzimport added a subscriber: Unknown Object (MLST).

I think the change of the summary to identify this issue more clearly.

For example, in a language wiki:

Originally there are user toogles specified in Language.php:
/* private */ $wgUserTogglesEn = array(
'Foo1',
'Foo2',
'Foo3',
'Foo4',
);

and in LanguageZh_cn.php:
/* private */ $wgUserTogglesZh_cn = array(
'Bar1',
) + $wgUserTogglesEn;

and when the specific language is selected. The user toogles that defined in
Language.php is overrided by the user toggles in specific language, thus the
resulting user toggles are rendered as:

'Bar1',
'Foo2',
'Foo3',
'Foo4'

I think that have some errors when getting the user toggles in specific language.
It should be appended before the original user toggles, instead of overriding the
original user toggles. That would resulting:

'Bar1',
'Foo1',
'Foo2',
'Foo3',
'Foo4'

I think that maybe having some problem in the SpecialPerferences.php file to
getting this error.

regards
Man

This is the screenshot when en language is selected in enwiki.

This is the screenshot when en language is selected in enwiki. Those toggles in
Misc tab shows the toggles correctly.

Attached:

enwiki_userperferences_en.png (742×1 px, 140 KB)

This is the screenshot when zh-tw language is selected in enwiki.

This is the screenshot when zh-tw language is selected in enwiki. The option
'highlightbroken' toggle has been overrided by the option 'nolangconversion'
toggle.

Attached:

enwiki_userperferences_zhtw.png (742×1 px, 125 KB)

Simple array_merge() would do it, but looks like option nolangconversion is not
used anywhere and can be removed, am I correct?

sst.dreams wrote:

patch of languages/LanguageZh_cn.php

I also think 'nolangconversion' can be removed. So I make this patch.

attachment LanguageZh_cn.php.patch ignored as obsolete

sst.dreams wrote:

Comment on attachment 2120
patch of languages/LanguageZh_cn.php

Index: LanguageZh_cn.php

  • LanguageZh_cn.php (revision 15717)

+++ LanguageZh_cn.php (working copy)
@@ -40,11 +40,7 @@
'cologneblue' => "科隆香水蓝"
) + $wgSkinNamesEn;

-/* private */ $wgUserTogglesZh_cn = array(

  • 'nolangconversion',

-) + $wgUserTogglesEn;

  • if (!$wgCachedMessageArrays) {

require_once('MessagesZh_cn.php');
}
@@ -52,11 +48,6 @@

class LanguageZh_cn extends LanguageUtf8 {

  • function getUserToggles() {
  • global $wgUserTogglesZh_cn;
  • return $wgUserTogglesZh_cn;
  • } -

function getNamespaces() {

		global $wgNamespaceNamesZh_cn;
		return $wgNamespaceNamesZh_cn;

sst.dreams wrote:

patch of LanguageZh_cn.php

re-upload with the correct patch.

Attached:

Seems this bug has been resolved by Tim on SVN r15823.

  • Moved default user options and toggles from Language to User. Language objects are

still able to define default preference overrides and extra user toggles, via a
slightly different interface.

marked this bug as FIXED.