Currently, the language list is fetched from ULS. We need to introduce an own service which we pass around. The initial implementation should just use ULS.
Description
Details
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Pass ContentLanguages instance using ULS to ValueView | mediawiki/extensions/Wikibase | master | +82 -8 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | Lydia_Pintscher | T74126 [Story] Monolingual text does not accept sr-cyrl and a number of other language codes | |||
Declined | None | T74590 [Bug] Monolingual code is missing for Romani (rom) and Scandoromani (rmg-variant) | |||
Resolved | adrianheine | T72205 [Story] Mono-lingual text datatype should support "no linguistic content" and "undetermined language" | |||
Resolved | Smalyshev | T85385 Implement "Monolingual text" in Pywikibot | |||
Resolved | adrianheine | T95286 [Story] Monolingual text should support macrolanguages | |||
Open | None | T124286 [Epic] Wikidata language support | |||
Resolved | Addshore | T78006 [Story] Determine list of available languages in a uniform way | |||
Declined | adrianheine | T87369 Use ContentLanguages object for terms JS | |||
Invalid | None | T87370 Use ContentLanguages object for special pages JS | |||
Resolved | adrianheine | T86653 Make language list injectable throughout frontend | |||
Resolved | adrianheine | T86753 Make language list injectable in ValueView |
Event Timeline
I think it makes sense to do T75380 before this, since we again need to inject a service into ValueView.
Current users of language data I found:
- ValueView needs language codes and names.
- wikibase.Site (used by jquery.wikibase.linkitem and jquery.wikibase.sitelinkview) needs dir
- getDirectionality (used by aliasview, descriptionview, labelview) needs dir
- Special pages need language codes and names
- getLanguageNameByCode (used by descriptionview, entitytermsforlanguagelistview, entitytermsforlanguageview, entityview, labelview) needs language codes and names
I would try to replace the usages in getLanguageNameByCode, getDirectionality and ValueView with the new service as a a start.
interface ContentLanguages getName( code ) getAll() class UlsBasedContentLanguages: ContentLanguages getName( code ) = getAll()[ code ] getAll() = mw.config.get( 'wgULSLanguages' )
@thiemowmde @Snaterlicious What do you think about the interface? What do you think about doing T75380?
@Lydia_Pintscher @Tobi_WMDE_SW Are you ok with pulling T75380 into the sprint?
I think getAll should return an array of language codes, not codes and some names:
interface utils.ContentLanguages getName( code ) getAll() class UlsBasedContentLanguages: ContentLanguages getName( code ) = mw.config.get( 'wgULSLanguages' )[ code ] getAll() = Object.keys(mw.config.get( 'wgULSLanguages' ))
That way it's easier to add more information to ContentLanguages, for example direction or names in different languages.
Change 186229 had a related patch set uploaded (by Adrian Lang):
Pass ContentLanguages instance using ULS to ValueView
We don't need T75380 for this, since we already have a ValueViewBuilder that's passed through all views.
Change 186229 merged by jenkins-bot:
Pass ContentLanguages instance using ULS to ValueView