Wikidata/Notes/Language fallback: Difference between revisions

Content deleted Content added
Answer question
m Reverted changes by 202.86.218.135 (talk) to last version by Sakura emad
Tag: Rollback
 
(7 intermediate revisions by 4 users not shown)
Line 1:
From the perspective of a client like(e.g. athe French Wikipedia) that displays data from a Wikidata item in an infobox, some properties in an item may not have a language-specific label in the currently selected language available. In this case, a fallback mechanism should be used to show an available label from another language.
 
Fallback can be based on:
* similarities between languages (e.g. en-UKGB -> en)
* the languages a signed-in user speaks
* the languages signaled by the browser
Line 13:
 
==User fallback chain==
The prefered user languages are defined in [[Special:Preferences]] for the various users. There are some limitations where the user preferred languages can be used. It seems likely they can be used when the API is accessed, or when the rendered content isn't cached, or where the cached objects can be specialized to a given language. ''For now the user fallback chain is one set of alternate languages where all have the same weight. Later it might be possible to add weight to the languages by giving them weights explicitly or by giving them some specific order. There can also be other hints used, such as the weights set in the browser.''
 
The preferedpreferred user languages are defined in [[Special:Preferences]] for the various users. There are some limitations where the user preferred languages can be used. It seems likely they can be used when the API is accessed, or when the rendered content isn't cached, or where the cached objects can be specialized to a given language. ''For now the user fallback chain is one set of alternate languages where all have the same weight. Later it might be possible to add weight to the languages by giving them weights explicitly or by giving them some specific order. There can also be other hints used, such as the weights set in the browser.''
If the user have defined alternate languages, all of these languages can be tried in sequence, but the main (primary) language is tried first. Content (messages, labels, or other strings) may or may not exist in the given fallback language.
 
If thea user havehas defined alternate languages, all of these languages can be tried in sequence, but the main (primary) language is tried first. Content (messages, labels, or other strings) may or may not exist in the given fallback language.
 
For anonymous users that are not logged in, the list of preferred languages defined in the web browser may substitute the mediwiki-language-preference-settings.
Line 30 ⟶ 31:
In the case of Wikipedia clients, the most important fallback chain will be provided by the client. When a user changes the user interface language, on most Wikimedia foundation projects (known exception: Commons) and most (all?) Wikipedias, only the user interface changes, but not parts of the content. Changing the content of infoboxes in cases where the user language preference conflicts with the content language of the Wikipedia might be surprising. A decision whether this is ultimately desirable would probably have to be left to the community of each Wikipedia.
 
The fallbackbase chainbehaviour maywould therefore be, efallback chains that start with the language of the Wikipedia (= the wikidata client).g., The fallback chain for a German Wikipedia might then be, e.g., "de -> en -> fr -> nl -> es -> it -> first-language-present". A necessary decision will be whether to provide a community-specific means to define and discuss this or whether only a large set of global fallback chains is centrally defined for each language that corresponds to a Wikipedia. To support community decision, a property "Property:language_fallback_chain" could be defined and set on the each item page inside Wikidata that represents a Wikipedia. This property information could then either be used live by Wikidata, or it could be harvested in regular intervals (similar to information from translation wiki).
 
==Support for fallback in the Wikidata editing interface==
Line 39 ⟶ 40:
 
The user interface interaction would require:
* a list of languages for which transliteration andor translation is especially desired (if desired this step can be skipped, making this the default behavior for all languages)
* if a label is entered in one of these language, the software checks whether at least one label in one of the top 5 fallback languages is available.
* if not, ifit offers the 5 top fallback languages and prompts the user to consider entering at least one.
* In a second phase, a web service hook for automatic transliteration should be build in. The return of this service should not be entered directly as a new label, but could be displayed next to it ready to be accepted or modified.