Last modified: 2014-10-07 15:29:44 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 28671 - indicate canonical alias on meta=siteinfo&siprop=magicwords|specialpagealiases
indicate canonical alias on meta=siteinfo&siprop=magicwords|specialpagealiases
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
1.18.x
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on: 28675 28676
Blocks:
  Show dependency treegraph
 
Reported: 2011-04-23 08:20 UTC by db [inactive,noenotif]
Modified: 2014-10-07 15:29 UTC (History)
10 users (show)

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


Attachments

Description db [inactive,noenotif] 2011-04-23 08:20:12 UTC
It is possible to get information about the canonical alias of magicwords/specialpage with the api? It is nice to get the alias of an magicword/specialpage which work on all wikis.

Maybe add a canonical="" to the the alias-tag

Indicate the localname is also nice, but it looks that the localname is always the first entry of that list.

Thanks.
Comment 1 Sam Reed (reedy) 2011-04-23 11:22:12 UTC
For the specialpages, surely realname is the canonical one?

      <specialpage realname="Allmessages">
        <aliases>
          <alias>MediaWiki-Systemnachrichten</alias>
          <alias>AllMessages</alias>
        </aliases>
      </specialpage>

Same for name on magicword?

      <magicword name="ucfirst">
        <aliases>
          <alias>INITIAL_GROSS:</alias>
          <alias>UCFIRST:</alias>
        </aliases>
      </magicword>
Comment 2 db [inactive,noenotif] 2011-04-23 13:07:01 UTC
(In reply to comment #1)
> For the specialpages, surely realname is the canonical one?
>       <specialpage realname="Allmessages">
>         <aliases>
>           <alias>MediaWiki-Systemnachrichten</alias>
>           <alias>AllMessages</alias>
>         </aliases>
>       </specialpage>

No, that does not work for Randompage

> Same for name on magicword?
>       <magicword name="ucfirst">
>         <aliases>
>           <alias>INITIAL_GROSS:</alias>
>           <alias>UCFIRST:</alias>
>         </aliases>
>       </magicword>

That does not work for redirect or img_alt
Comment 3 Sam Reed (reedy) 2011-04-23 13:09:22 UTC
      <specialpage realname="Randompage">
        <aliases>
          <alias>Zufällige_Seite</alias>
          <alias>Random</alias>
          <alias>RandomPage</alias>
        </aliases>

Why not...?
Comment 4 db [inactive,noenotif] 2011-04-23 13:22:15 UTC
(In reply to comment #3)
>       <specialpage realname="Randompage">
>         <aliases>
>           <alias>Zufällige_Seite</alias>
>           <alias>Random</alias>
>           <alias>RandomPage</alias>
>         </aliases>
> Why not...?

Because the canonical one is <alias>Random</alias> not <alias>RandomPage</alias>, it should work with RandomPage, but it only an english alias.
Comment 5 Sam Reed (reedy) 2011-04-23 14:59:47 UTC
Magic words:
 * Note to translators:
 *   Please include the English words as synonyms.  This allows people
 *   from other wikis to contribute more easily.

Special pages
Aliases from the fallback
 * localisation (usually English) will be included by default.

The magic word ones aren't guaranteed... And the english would only be there as fallback, unless it's added..

Gonna log a couple of dependency bugs for this.. It's a bit of a farce
Comment 6 Bryan Tong Minh 2011-04-23 16:28:49 UTC
(In reply to comment #5)
> Magic words:
>  * Note to translators:
>  *   Please include the English words as synonyms.  This allows people
>  *   from other wikis to contribute more easily.
> 
Didn't we discuss this elsewhere and resolved to unconditionally add the English canonical word?
Comment 7 Sam Reed (reedy) 2011-04-23 16:44:38 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > Magic words:
> >  * Note to translators:
> >  *   Please include the English words as synonyms.  This allows people
> >  *   from other wikis to contribute more easily.
> > 
> Didn't we discuss this elsewhere and resolved to unconditionally add the
> English canonical word?

If that's the case, it means half of this original bug is invalid then...
Comment 8 Mark A. Hershberger 2011-04-23 17:40:43 UTC
(In reply to comment #6)
> Didn't we discuss this elsewhere and resolved to unconditionally add the
> English canonical word?

That makes a lot of sense.  Use this bug or one of the others that Reedy filed for tracking progress on it?
Comment 9 db [inactive,noenotif] 2014-01-31 14:07:13 UTC
(In reply to comment #6)
> (In reply to comment #5)
> Magic words:
>  * Note to translators:
>  *  
> Please include the English words as synonyms.  This allows people
>  *  
> from other wikis to contribute more easily.
> 
Didn't we discuss this
> elsewhere and resolved to unconditionally add the
English canonical word?

This was already done with r81960

This bug was about adding a indicator in the api result to see the canonical form which will work in all wikis. This can also be done by adding a language attribute about the language, where the alias came from, than the alias from "en" can be used as canonical form.

Or the bug gets closed, because the realname can be used, but I have not tested, if that works for all special pages.
Comment 10 Brad Jorsch 2014-06-24 17:19:04 UTC
On the one hand, it looks like there *isn't* a "canonical" name. "realname" isn't guaranteed to work at all.

But if every language falls back to 'en', then the aliases defined for 'en' are all "canonical". And all the 'en' alias lists seem to include the "realname".
Comment 11 Bawolff (Brian Wolff) 2014-06-24 17:23:34 UTC
(In reply to Brad Jorsch from comment #10)
> On the one hand, it looks like there *isn't* a "canonical" name. "realname"
> isn't guaranteed to work at all.
> 
> But if every language falls back to 'en', then the aliases defined for 'en'
> are all "canonical". And all the 'en' alias lists seem to include the
> "realname".

In OutputPage, we use the following:

list( $canonicalSpecialPageName, /*...*/ ) =
                                SpecialPageFactory::resolveAlias( $title->getDBkey() );

to populate $wgCanonicalSpecialPageName in js, which is probably what's being asked for.
Comment 12 Brad Jorsch 2014-06-24 17:31:28 UTC
(In reply to Bawolff (Brian Wolff) from comment #11)
> In OutputPage, we use the following:
> 
> list( $canonicalSpecialPageName, /*...*/ ) =
>                                 SpecialPageFactory::resolveAlias(
> $title->getDBkey() );
> 
> to populate $wgCanonicalSpecialPageName in js, which is probably what's
> being asked for.

SpecialPageFactory::resolveAlias returns the "realname" value.

But there's nothing forcing that realname to actually work as [[Special:Realname]], it just relies on the realname being listed in the 'en' version of $specialPageAliases and every other language falling back to 'en' eventually.

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


Navigation
Links