https://bugzilla.wikimedia.org/show_bug.cgi?id=36430

--- Comment #6 from jeb...@gmail.com 2012-07-11 08:59:00 UTC ---
There is a patchset that can be used for discussion at
https://gerrit.wikimedia.org/r/#/c/15433/

This uses the current fallbacks from Language class (see $fallback in message
files) if all languages fails. Typically the current fallback which goes right
to english will be extended somewhat. For example Norwegian (bokmål) will use
"nn,da,sv", Norwegian (nynorsk) will use "nb,sv,da", Swedish will use
"nn,nb,da" and Danish will use "nb,nn,sv". All will have English added to the
list by default.

If fallbacks are turned on, and if labels (or descriptions) are fallbacks, then
they are flagged as such. That is a structure like the following are returned
(the query is for labels in the "nb" language, but it is only found in "en")

http://localhost/repo/api.php?action=wbgetitems&ids=4&languages=nb&format=jsonfm
{
    "items": {
        "4": {
            "id": 4,
            "labels": {
                "en": {
                    "language": "en",
                    "value": "Etnedal",
                    "fallback": ""
                }
            }
        }
    }
}


All languages specified in the call must fail for the fallbacks to be used. If
they are used the languages list from the call is replaced one by one by the
languages list from the fallbacks. If all fallback list fails then no labels
(or descriptions) are returned.

It is only implemented for labels and descriptions in wbgetitems, fallbacks for
modules that sets the labels and descriptions give no sense.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to