On Wiktionary several important templates require a language to be specified, but the language is always the language of the word being defined, i.e. the <h2> section. For example, look at the {{ux}} invocations on wikt:good. It has been requested that a mechanism be provided to make these templates aware of the section they are in, so that the language does not need to be specified in every invocation.
They asked for Extension:Variables, but I think it would be better to use a new extension which provides an immutable, scoped declaration, which would be more compatible with asynchronous construction of the DOM tree. Perhaps:
{{#sectionproperty: declare | lang=en}}
would attach a property called "lang" to the current (most deeply nested) <section> tag, then any instances of
{{#sectionproperty: get | lang}}
within the same section would retrieve that property. Declarations would be required to be at the top level of the preprocessor parse tree, after the section start but before any other template invocations or property fetches, so that declarations would be effectively available anywhere in the section while still allowing a single pass preprocessor. A nested section would inherit the properties of its parent section. Parsoid would need to track property declarations, serialize them and send them to the MW preprocessor for each template invocation within the relevant section.