Page MenuHomePhabricator

Remove "Backwards compatibility hacks" from all LanguageXx.php files
Closed, DeclinedPublic

Description

Author: gangleri

Description:
Hallo!

Please compare [[wiktionary:nl:user:Gangleri]] and [[wiktionary:la:user:Gangleri]].
You will see that "wikipedia" is not a valid interwiki at
[[wiktionary:la:Pagina_prima]] = wiktionary:la: .

Tray [[wiktionary:la:Victionarium:Taberna]], [[wiktionary:la:project:Taberna]]
and [[wiktionary:la:Wikipedia:Taberna]] and you will see that the "Backward
compatibility hack" is still active because off

function getNsIndex( $text )
{

global $wgNamespaceNamesLa;
global $wgMetaNamespace;

foreach ( $wgNamespaceNamesLa as $i => $n ) {
 if ( 0 == strcasecmp( $n, $text ) ) { return $i; }
}

# Backwards compatibility hacks
if( $wgMetaNamespace == 'Vicipaedia' || $wgMetaNamespace == 'Victionarium' ) {
 if( 0 == strcasecmp( 'Wikipedia', $text ) ) return NS_PROJECT;
 if( 0 == strcasecmp( 'Disputatio_Wikipedia', $text ) ) return NS_PROJECT_TALK;
}

The problem is at

if( $wgMetaNamespace == 'Vicipaedia' || $wgMetaNamespace == 'Victionarium' ) {

which is *always* the case in MediaWiki foundation projects.

Please compare with
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageFr.php?view=markup

if( $wgSitename == 'Wikipédia' ) {
 if( 0 == strcasecmp( 'Wikipedia', $text ) ) return 4;
 if( 0 == strcasecmp( 'Discussion_Wikipedia', $text ) ) return 5;
}

There the condition depends on $wgSitename:

if( $wgSitename == 'Wikipédia' )

*request*
Please allow "Backwards compatibility hacks" to be dependend in LanguageXx.php
files only from $wgSitename and not from $wgMetaNamespace.

Please identify *all* afected LanguageXx.php files. I remember that I have
reported a similar bug for [[eo:]] (maybe also for [[la:]]) which was fixed by
Hashar. See
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageEo.php?r1=1.75&r2=1.76

Thanks for your efforts in advance!

best regards reinhardt [[user:gangleri]]


Version: unspecified
Severity: normal
URL: http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageLa.php

Details

Reference
bz4282

Event Timeline

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

gangleri wrote:

Sorry! This is a "todo issue" for people with have access to change the
LanguageXx.php's.
The bug should have product WikiMedia web sites and component Language setup.

It should not be that difficult to search the files for
if( $wgMetaNamespace ==
in order to identify all affected languages.

avarab wrote:

The problem is that your report does not make any sense at all, we have no idea
what you want, where the problem is and how to fix it.

gangleri wrote:

OK Ævar! Keep it KISS.
This summer we (Tim and me) installed some test wiki's at WikiPage.

At that time I have seen that I was not able to configure an interwiki prefix
[[wikipedia:]]. We verified the code at LanguageEo.php. Some weeks later we
installed a wiki in Latin. There was the same story. Inserting [[wikipedia:]] in
the interwiki table did not help to generate links. LanguageEo.php was fixed in
the mean time.

I verified LanguageLa.php this night at 04:24. This bug is not just a bug about
LanguageLa.php. This is *one* item. I made a general subject because it makes
sense to solve "similar" patterns together.

robchur wrote:

You've still not said what it is we need to fix about those language files.
Chances are, anyone reading this bug report now is confused as hell.

gangleri wrote:

(In reply to comment #5)

You've still not said what it is we need to fix about those language files.
Chances are, anyone reading this bug report now is confused as hell.

Rob! We talked at IRC. I think you agreed that [[wiktionary:la:Wikipedia:Foo]]
should not be equivalent to [[wiktionary:la:project:Foo]] ==
[[wiktionary:la:Victionarium:Foo]] but to [[en:Foo]].
You told me that I can use interwiki's as "w:<language code>:user:Gangleri" at
[[wiktionary:la:user:Gangleri]]. I know that. This is a "workaround". You agreed
that the interwiki prefix "wikipedia:" can *not* be used at WIKT:LA:.

Tody I verified the other sister projects of WP:LA: at [[Special:SiteMatrix]].
http://la.wikibooks.org/wiki/Wikipedia:foo
http://la.wikiquote.org/wiki/Wikipedia:foo
http://la.wikisource.org/wiki/Wikipedia:foo
These three direct all to [[en:Foo]].

Task 1: Just change
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageLa.php

Task 2: Verify if this change allows you to use the interwiki prefix al WIKT:LA:


There are two more issues:

a) Please verify if other files from
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/#dirlist
contains similar "Backwards compatibility hacks".

Because MediaWiki claims to be used also for installations outside the WikiMedia
foundation my opinion is that no compatibility hack should be included in *any*
LanguageXx.php file.

This would lead to wrong installations. See:
http://esperanto.wikicities.com/wiki/Wikipedia:Foo
which is equivalen to
http://esperanto.wikicities.com/wiki/La_malferma_Esperanto-komunumo:Foo
because it was created with an old version of LanguageEo.pho (as available
around January 2005)
see http://esperanto.wikicities.com/index.php?oldid=1

Revision as of 08:47, 14 Jan 2005;

I do not have the time to verfy all the files from
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/#dirlist
Maybe it is also not my task.

b) because there is a difference in behaviour / seeting between WIKT:LA: and
WIKISOURCE:LA: you / somebody with access to all LocalSettings.php files should
verify

  • if hacks are present in LocalSettings.php
  • if yes, if they make sense / are still required; notify /ask the community if

you are not certain

c) please note that [[special:SiteMatrix]] contains more languages then
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/#dirlist
as [[co:]] etc. etc.

Again only the people having access to all the LocalSettings.php files can
verify if hacks are present there or not.

When opening a bug I was not aware of the last implications. However I did
expect that some feedback would be posted by people involved in "Backwards
compatibility hacks" during the past. See
http://oc.wikipedia.org/w/index.php?title=Oiquipedi%C3%A0:La_tav%C3%A8rna&oldid=10608#Project.2C_Oiquipedi.C3.A0.2C_Wikipedia
http://oc.wikipedia.org/wiki/Utilisator:Gangleri/tests

best regards reinhardt [[user:gangleri]]

gangleri wrote:

I identified additional projects / Language.Php files:
a) [[wiktionary:hu:user:Gangleri]]
b) [[wiktionary:ia:user:Gangleri]]
c) [[wiktionary:la:user:Gangleri]]
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageLa.php?annotate=1.24.2.1
line 123 ...
d) [[wiktionary:ms:user:Gangleri]]
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageMs.php?annotate=1.54
line 17 ...
e) [[wiktionary:sl:user:Gangleri]]
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageSl.php?annotate=1.60
line 796 ...
f) [[wiktionary:tt:user:Gangleri]]
http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/LanguageTt.php?annotate=1.20.8.1
line 23 ...

Please fix both the LanguageXx.php files and local files on WikiMedia foundation
servers.

*note*
The list above might not be complete.

gangleri wrote:

(In reply to comment #3)

The problem is that your report does not make any sense at all, we have no idea
what you want, where the problem is and how to fix it.

(In reply to comment #5)

You've still not said what it is we need to fix about those language files.
Chances are, anyone reading this bug report now is confused as hell.

REOPENed the bug because now there are more todo's all with the *same* pattern.
Sorry Ævar, Brion and Rob if I can not find the right words from the beginning
when I can not forsee all the implications.

changed summary to:
Remove "Backwards compatibility hacks" from all LanguageXx.php files

I assume that "Backwards compatibility hacks" at the WikiMedia foundations wiki
should be included only in LocalSettings.php files.

*more to do's*
a2) [[wikibooks:hu:User:Gangleri]]
b2) [[wikibooks:ia:Usator:Gangleri]]
c2) probably *no action* as [[wikibooks:la:wikipedia:foo]] directs to [[foo]]
c3) probably *no action* as [[wikisource:la:wikipedia:foo]] directs to [[foo]]
d2) [[wikibooks:ms:Pengguna:Gangleri]]
e2) [[wikibooks:sl:Uporabnik:Gangleri]]
f2) [[wikibooks:tt:Äğzä:Gangleri]]

best regards reinhardt [[user:gangleri]]

gangleri wrote:

a3) [[wikiquote:hu:User:Gangleri]]
c4) probably *no action* as [[wikiquote:la:wikipedia:foo]] directs to [[foo]]
e3) [[wikiquote:sl:Uporabnik:Gangleri]]
f3) [[wikiquote:tt:Äğzä:Gangleri]]

g1) [[wikibooks:sr:Корисник:Gangleri]]
g2) [[wikinews:sr:Корисник:Gangleri]]
g3) [[wikiquote:sr:Корисник:Gangleri]]
g4) [[wikisource:sr:Корисник:Gangleri]]
g5) [[wiktionary:sr:Корисник:Gangleri]]

gangleri wrote:

h1) [[wiktionary:fo:Brúkari:Gangleri]]

This seems to be the last.

gangleri wrote:

adding "depends on"
Bug 4130: Change some inactive wikibooks Project namespaces to "Wikibooks"

Thanks Zigger!

Bug 4130 shows that not all languages / projects listed above are using
"backwards compatibility hacks". If bug 4130 is fixed the list should be
reworked. Bug 4130 does not cover "Wiktionaries". It seems that there (in some
of the projects) is the same problem.

best regards reinhardt [[user:gangleri]]

*note*
The problem at
Bug 4413: LanguageFa.php hardcodes Wikipedia project namespace
Bug 4526: oc.wikipedia doesn't have proper sitename/metanamespace
was not caused by "backwards compatibility hacks"; it was caused by hardcoded
*project* namespaces

gangleri wrote:

*Update*

The following templates show that the language projects are using the same
namespace for project as WP:XX:.

This might be an indication that the project namespace is hardcoded at:

http://fo.wiktionary.org/wiki/template:wikivar (Wikipedia)
http://ga.wiktionary.org/wiki/template:Wikivar (Vicipéid)
http://ia.wiktionary.org/wiki/template:Wikivar (Wikipedia)
http://ms.wiktionary.org/wiki/template:Wikivar (Wikipedia)
http://sl.wikibooks.org/wiki/template:Wikivar (Wikipedija)
http://sl.wikiquote.org/wiki/template:Wikivar (Wikipedija)
http://sl.wiktionary.org/wiki/template:Wikivar (Wikipedija)
http://tt.wiktionary.org/wiki/template:Wikivar (Wikipedia)

best regards reinhardt [[user:gangleri]]

gangleri wrote:

All issues a) to h1) work fine except
the link generated at *Mediazilla* for g2) [[wikinews:sr:Корисник:Gangleri]].

This links works fine at
[[commons:User:Gangleri/tests#wikinews:sr:Корисник:Gangleri]] .

Soem issues from comment 12 are still open.

gangleri wrote:

(In reply to comment #12)

http://sl.wikibooks.org/wiki/template:Wikivar (Wikipedija)
http://sl.wikiquote.org/wiki/template:Wikivar (Wikipedija)
http://sl.wiktionary.org/wiki/template:Wikivar (Wikipedija)

still have {{ns:project}} == (Wikipedija). All others are fixed.

gangleri wrote:

(In reply to comment #4)

... LanguageEo.php was fixed in
the mean time.

This was
Bug 2513: LanguageEo.php uses "Wikipedia" as equivalent to {{ns:6}}

gangleri wrote:

Marking as WORKSFORME because all mentioned projects are fixed one way or the other:
a) backward compatibility links are included in if statements checking for
Wikimedia Foundation projects
b) (all known) hardcoding of project namespaces was removed

Thanks to all for cleaning this.

best regards reinhardt [[user:gangleri]]