Community Wishlist Survey 2021/Wiktionary/Something like Extension:Variables to simplify template calls
Appearance
Something like Extension:Variables to simplify template calls
- Problem: Some templates used on Polish Wiktionary (e.g., wikt:pl:Szablon:imię, wikt:pl:Szablon:imię odojcowskie, wikt:pl:Szablon:forma rzeczownika, wikt:pl:Szablon:forma przymiotnika) put entries into laguage-dependent categories. To do that they need to know what language the entry is about. As many dictionary entries are stored in a single article (one section per one language), those template cannot determine the language with the standard MW tools. Thus, the language needs to be provided in the template call (like
{{imię odojcowskie|ukraiński|Абаку́м|m}}or{{forma rzeczownika|pl}}
- Who would benefit: The syntax of entries could be cleaner and more similar to the end result.
- Proposed solution: This could be done with mw:Extension:Variables, but it is unavailable on Wikimedia. So… make it available or maybe develop a better extension of this kind?
- More comments:
- Phabricator tickets:
- Proposer: PiotrekD (talk) 21:02, 17 November 2020 (UTC)
Discussion
- Extension:Variables unfortunately will not be deployed to WMF wikis. Do any of the alternatives listed at mw:Extension:Variables#Alternatives work for you? If I understand you correctly, it sounds like you need the variable to persist across multiple template calls, which Extension:Variables can't do anyway. MusikAnimal (WMF) (talk) 23:27, 17 November 2020 (UTC)
- @MusikAnimal (WMF): None of those “alternatives” (workarounds) solve the problem. Extension:Variables can do that, I have already been using it for sharing variables between templates for a few years on Fandom. PiotrekDTALK 23:59, 17 November 2020 (UTC)
- The Variables extension has been disregarded for allegedly not coping well with VisualEditor/Parsoid (phab:T65324#667308, phab:T113859#1678576). However, pl.gta does have both extensions enabled. @PiotrekD: did you notice any issues related to this? Peter Bowman (talk) 11:49, 18 November 2020 (UTC)
- No issues have ever been noticed by me or reported to me. This may be because the wiki lacks engaged editors using VE, but so does pl.wikt where VE is disabled. PiotrekDTALK 12:16, 18 November 2020 (UTC)
- Does the solution that the en:Module:Citation/CS1 for automatic date formatting work for you? (Basically, read the page itself to extract a particular bit of wikitext that is structured reasonably.) See particularly
reformat_datesin en:Module:Citation/CS1/Date validation. --Izno (talk) 05:41, 18 November 2020 (UTC)- @Izno: technically, yes. To be clear, I assume you are referring to
mw.title:getContent(). We already exploit this "feature" as a means to categorize pages according to their part of speech, which is encoded as plain text since we've never fully adopted the automatic categorization via headword templates as enwiktionary does in wikt:en:Template:en-noun, for instance. However, beyond making the transcluding page record itself in WhatLinksHere, this feels like a hack as it depends on successful wikitext-based page parsing. Note this is not a one-pass action: given the specific configuration of plwiktionary's entry layout, we also need to perform this once per language section (take, for example, wikt:pl:Angola: 40 sections means invoking our hackish Lua parser 40 times). I just wouldn't like to keep adding more layers on top of that. Peter Bowman (talk) 11:16, 18 November 2020 (UTC)
- @Izno: technically, yes. To be clear, I assume you are referring to
- Expanding on PiotrekD's problem description, entry-based projects (such as Wiktionaries) may expect significant gains in enabling this feature, especially regarding stuff that can perform semantic categorization of entries - but currently doesn't, or at least not in the way categories are meant to work, rather by periodically inspecting page contents and maintaining large lists such as wikt:pl:Indeks:Francuski - Medycyna. This list collects all French entries related to medicine based on their transclusion of wikt:pl:Template:med, which doesn't accept a language parameter (precisely this would be nice for categorization purposes) and it will probably never do: we have tons of such templates used across the entire site, potentially making it quite tedious to update hundreds of thousands of tranclusions, also accounting for the process of making our veteran editors aware of this change. In contrast, we could easily upgrade {{med}} and similar to fetch the corresponding language code, conveniently exposed in a variable that relates to the language section this template is placed in, and use it to categorize the page - no need to alter the page contents at all. Peter Bowman (talk) 11:16, 18 November 2020 (UTC)
- A variant of this wish is already in phabricator as T331906, which proposed climbing the heading tree to extract the language information, with an alternative proposed in T122934#9196348. See also Extension:ArrayFunctions for another take on this. Cscott (talk) 17:10, 3 May 2024 (UTC)
Voting
Support Would be useful to have DannyS712 (talk) 18:05, 8 December 2020 (UTC)
Support We had a similar need for French Wiktionary. This may not be the best option on the table but the need is serious. Noé (talk) 19:24, 8 December 2020 (UTC)
Support Imz (talk) 20:09, 8 December 2020 (UTC)
Support Peter Bowman (talk) 21:42, 8 December 2020 (UTC)
Support tsca (talk) 22:24, 8 December 2020 (UTC)
Support Maitake (talk) 23:45, 8 December 2020 (UTC)
Support --Ciao • Bestoernesto • ✉ 02:39, 9 December 2020 (UTC)
Support Kambai Akau (talk) 02:50, 9 December 2020 (UTC)
Support Петър Петров (talk) 17:56, 9 December 2020 (UTC)
Support Futur3g4ry (talk) 22:33, 9 December 2020 (UTC)
Support Libcub (talk) 21:13, 10 December 2020 (UTC)
Support En.WP could use a variable like mechanism. Perhaps with the help of MCR.... Izno (talk) 22:15, 10 December 2020 (UTC)
Support Reptilien.19831209BE1 (talk) 16:16, 11 December 2020 (UTC)
Support KaMan (talk) 16:50, 11 December 2020 (UTC)
Support This feature would be a great improvement, especially for Wiktionaries. --YaganZ (talk) 18:03, 11 December 2020 (UTC)
Support Manseng (talk) 19:49, 11 December 2020 (UTC)
Support Fixer88 (talk) 23:06, 11 December 2020 (UTC)
Support Tom Ja (talk) 09:43, 12 December 2020 (UTC)
Support, using one of "the alternatives listed at mw:Extension:Variables#Alternatives". — SMcCandlish ☺ ☏ ¢ >ʌⱷ҅ᴥⱷʌ< 08:52, 15 December 2020 (UTC)
Support PMG (talk) 13:53, 15 December 2020 (UTC)
Support Kvdrgeus (talk) 11:07, 16 December 2020 (UTC)
Support --Luan (discussão) 19:11, 16 December 2020 (UTC)
Support Fringilla (talk) 20:06, 20 December 2020 (UTC)
Support Nostrix (talk) 16:35, 21 December 2020 (UTC)