Hey folks,
we are currently working on the final steps towards making it possible for Wikimedia Commons to make use of all data in Wikidata in the user's language.
As of last week we have enabled access to all data on beta Wikidata for beta Wikimedia Commons (http://commons.wikimedia.beta.wmflabs.org/). This makes it possible to test this new functionality in order to evaluate it for enabling it on the actual Commons. If you are working on templates or Lua modules on Commons or are generally interested in playing around with the new functionality, please do that on beta Commons.
The data access which Commons will get is the "arbitrary access" which already is deployed to various sister projects, including all Wikipedias. Commons is a special case because similar to Wikidata it is multi-lingual. Unlike Wikipedia or any of the other Wikis that currently have arbitrary access enabled, Commons will get data access in the user's language and not in a defined content language. That means that all functionality that we provide, in order to make use of the data on Wikidata, will be using the users language for localization, so that each user can see the content in their proffered language.
In detail that means that the {{#property:…|from=Q1234}} parser function will output labels, dates, … formatted in the users language. The same applies to the Lua functions we provide for advanced use cases. A detailed reference of the Lua functionality we provide can be found at https://www.mediawiki.org/wiki/Extension:Wikibase_Client/Lua.
It'd be great if those of you familiar with both Commons and Wikidata could test this on beta Commons and let me know if you encounter any major issues. If there are none we'll go ahead and find a date to switch it on when I am back from the Wikimedia hackathon on the 11th of April.
Cheers, Lydia
Will it be possible to force a property to be loaded in a given language (typically English)? I'm thinking in usages that embed the property into Category names, internal comparisons in a template…
Best regards
On Thu, Mar 24, 2016 at 10:55 PM Platonides platonides@gmail.com wrote:
Will it be possible to force a property to be loaded in a given language (typically English)? I'm thinking in usages that embed the property into Category names, internal comparisons in a template…
Yes that is possible via loading the whole item in Lua. Then you have access to everything including labels in all languages.
Cheers Lydia
Am 25.03.2016 um 22:56 schrieb Lydia Pintscher:
On Thu, Mar 24, 2016 at 10:55 PM Platonides <platonides@gmail.com mailto:platonides@gmail.com> wrote:
Will it be possible to force a property to be loaded in a given language (typically English)? I'm thinking in usages that embed the property into Category names, internal comparisons in a template…
Yes that is possible via loading the whole item in Lua. Then you have access to everything including labels in all languages.
While this is true, let me add that * the preferred way to access labels is to ask for either the content language or the user language. * you would not benefit from the built in language fallback mechanism. If there is no label in your desired language, you are on your own. * using labels to create links is a bad idea. * internal comparisons should be based on ids rather than labels. Labels are not reliable keys for matching datasets. If labels are needed, i suggest doing this in the content language (which, for commons, is "en"). * Accessing the full data structure via lua is expensive - it needs to load the entire item and transform it to a lua data structure. Also, we have to track this kind of access as "anything might have been used", which flags the page for purging every time anything about the item changes.
So yes, it's possible, but not recommended in general. Please let us know about important use cases for accessing labels in a specific language, so we can think about optimizing for such use cases specifically.