Applies to parsedcomment for the watchlist api calls, tag display language, and probably something else that I'm missing
I guess this applies to all of the watchlist retrieval api calls, not just wikibase, but its clearest there
By default, the default language used is user, meaning to use the user's preferences
To account for any preferences being different across wikis, we should not override that if the uselang parameter is not set
I guess mw.util.getParamValue( 'uselang' ) can be used to check if its set
Except we already retrieve the labels for the wikibase items in the currently used language (mw.config.get( 'wgUserLanguage' )) and its unlikely that users will have wikis shown in two different languages...
@IKhitron thoughts? I know you were saying something about viewing metawiki in a language different from the languages you view the other wikis with. We have the following informatio available
- the current page view language, from mw.config.get( 'wgUserLanguage' )
- we can add a check for whether this is specified explicitely in a uselang parameter, or is based on the users preferences, via mw.util.getParamValue
- for most things, the default language used is based on the users preferences on the foreign wiki, which uselang= should be able to override
So, I guess this is most clearly visible for the displayed text of the different tags.
Currently, tags should all be shown in the language you chose for that wiki (i.e. change tags for edits on hewiki are shown in Hebrew, change tags for edits on ruwiki are shown in Russian, and change tags for enwiki edits are shown in English).
If we say, always use the language specified in mw.config.get( 'wgUserLanguage' ), the change tags would all be shown in English (since you have that set for meta) or whatever you override uselang= with. My question is, for users that don't specify uselang=, should tag labels be shown according to their preferences on the foreign wiki (for your case, Hebrew or Russian) or the local wiki (English)?
If we always want to use the language of the current page view, regardless of whether its because of local preferences or uselang, its fairly easy. However, if we only want to override foreign wiki preferences when uselang is explicitely used, thats a bit trickier.
mw.config.get( 'wgUserLanguage' ) returns the language that the user has set for their preferences locally (unless its overridden by uselang) (technically, it just returns the language of the context for the result, but that language is the one based on user preference, uselang overrides, and whatever the configuration default is for users with no preferences set)
Okay, I see where the confusion may be.
"local wiki" = wiki where Special:GlobalWatchlist is being viewed
"foreign wiki" = wiki with changes
By default, the api will fetch with the language being the virtual language user. If this is the case, the api will use the user preferences on the foreign wiki when fetching stuff for that foreign wiki - in your case, everything should be in Hebrew for hewiki, Russian for ruwiki, and English for others like eswiki
mw.config.get( 'wgUserLanguage' ) returns the language of the current page view. By default, this will be the user's preference on the local wiki, but it can be overridden with uselang=.
If we tell the api to use the language that we get from mw.config.get( 'wgUserLanguage' ), then uselang= will correctly override user preferences and force everything to be in that language, but even when uselang= is not set, all wikis will be fetched according to the language preferences on the local wiki.
It should be possible to decide to only override the default user if and only if the uselang= parameter is specified, and that is what I am proposing.
While wikidata labels are currently shown using mw.config.get( 'wgUserLanguage' ) always, since using the local preference isn't an option, you are correct.
However, this is about the language that should be used for other stuff, like automatic summaries from wikibase (when creating a new item, the summary in the database is wikibase-item-summary-wbeditentity-create-item and at run time, this is converted to, eg, "Created a new Item" (en) or "创建新项" (zh)) or tag descriptions. Currently, those all rely on the user preferences on foreign wikis, and thus cannot be overridden by uselang, and I was proposing that they do be overridden by uselang
But, on the other hand, how can you be sure that the user does not prefer the foreign language preferences. He set them to use these wikis, including reading the diffs and the history pages.