Problem: Ca 99% of templates in wiktionary need a language code. The same code must be fed separately into every single template call. This is junk work, and brings risk of wrong codes. This applies to a lesser degree to the word class too. Also, templates intended to be invoked from certain sections only cannot check whether they are used correctly.
Proposed solution: Add a LUA function to read out previous section heading of specified level. The most interesting levels are 2 and 3. Level 2 requested below ==Swedish== (at any distance until a different level 2 heading or higher level appears) would return "Swedish". Level 3 requested below === Subordinator === would return "Subordinator". If no heading of requested level has been passed or a higher level heading (lower number of equal signs "=") appared since the last one, then return empty string or type "nil".
Who would benefit: All contributors of wiktionary, template editors on wiktionary, to a lesser degree also all other wikis.
Details and previous discussion: https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2023/Wiktionary/Add_LUA_function_to_read_out_previous_section_heading