Last modified: 2014-10-30 19:06:10 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 72153 - meta=siteinfo should allow client to identify RTL languages
meta=siteinfo should allow client to identify RTL languages
Status: NEW
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Nobody - You can work on this!
: i18n
Depends on:
Blocks: rtl 64617
  Show dependency treegraph
 
Reported: 2014-10-16 21:35 UTC by Jon
Modified: 2014-10-30 19:06 UTC (History)
9 users (show)

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


Attachments

Description Jon 2014-10-16 21:35:02 UTC
https://en.m.wikipedia.org/w/api.php?action=query&format=json&meta=siteinfo&siprop=general%7Clanguages&prop=langlinks&llurl=true&lllimit=max&titles=Tofu

This returns a list of language codes
languages: [ {code:aa, *:Qafár af} ...{lang:he, url:https://he.wikipedia.org/wiki/%D7%98%D7%95%D7%A4%D7%95, *:טופו} ]

In mobile we need to identify which languages are RTL and which are not.

Expected: Return a rtl property when a language is RTL
languages: [ {code:aa, *:Qafár af } ... {lang:he, url:https://he.wikipedia.org/wiki/%D7%98%D7%95%D7%A4%D7%95, *:טופו, rtl: true }]
Comment 1 Brad Jorsch 2014-10-16 22:51:49 UTC
At a glance, it seems this would require fetching a Language object for every single language. That may be prohibitive from a performance perspective.
Comment 2 Jon 2014-10-16 22:55:28 UTC
Pulling in some i18n experts.
Comment 3 Brad Jorsch 2014-10-16 23:11:12 UTC
Even if we can skip that part (as with Language::getFallbacksFor()), it would still require loading language info for every language which has the same concerns.
Comment 4 Niklas Laxström 2014-10-17 08:56:05 UTC
I said on IRC that many people use jquery.uls.data for getting the direction of a language. I do not know if that is possible for you.
Comment 5 Nemo 2014-10-17 09:54:34 UTC
I don't understand the bug summary.
https://he.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=general
 lang="he" rtl=""
WORKSFORME
Comment 6 Umherirrender 2014-10-30 19:06:10 UTC
He is asking for rtl="" for all supported languages, not for the content language (where the flag exists).

https://he.wikipedia.org/w/api.php?action=query&meta=siteinfo&siprop=languages

For what the dir is needed in this context?

Another solutation maybe where to add the dir (rtl or ltr) to each language link from the prop=langlinks, than there is no need to fetch all languages and just use the one which are needed.

By the way:
For performance you can actually change meta=siteinfo&siprop=languages by llprop=autonym

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


Navigation
Links