An urgent use case is the need to call LanguageConverter::findVariantLink() to do proper title existence check.
Version: unspecified
Severity: normal
liangent | |
Apr 26 2013, 11:44 AM |
F28662700: 0001-Add-handler-for-Language-findVariantLink.patch | |
Apr 15 2019, 2:14 PM |
F28662696: 0001-Add-handler-for-Language-findVariantLink.patch | |
Apr 15 2019, 2:12 PM |
An urgent use case is the need to call LanguageConverter::findVariantLink() to do proper title existence check.
Version: unspecified
Severity: normal
findVariantLink is also available as Language::findVariantLink(). Maybe it can be easily done with a few lines in mw.language.lua, but I'm not sure about this.
I was trying to introduce Wikidata-based annotated link to zh.wp the other day, and mw.wikibase.getEntityIdForTitle was not working too well for this exact reason. Anyone want to triage this task?
Looks like I need to:
There we go, I guess. Simple as mw.language.findVariantLink(link : string) -> string.
…and on LC-enabled sites you are now supposed to replace all references to the title with mw.language.findVariantLink(title). Sounds legit as long as you only do it once and save up the result.