MediaWiki core has no concept of "context language" on smaller level than of a page. Translate extension can do this, albeit a bit hackily.
When we are processing translatable page, we can easily do some string processing that replaces a marker with the language of the unit (basically, either the target language if translated, or source language if untranslated, assuming no fallback support is added).
This could be named {{UNITLANGUAGE}} or {{TRANSLATIONLANGUAGE}} to be consistent for {{PAGELANGUAGE}}. The downside is, that this would be a simple string replacement, so behavior is not exactly the same as with regular magic words. Maybe it should look completely different altogether?
This would enable using language dependent magic word such as {{FORMATNUM}} and {{#time}} safely, such that they match the language of the text around.
Implementation note: It should be possible to use this magic word in translation variables. E.g. Language: <tvar|lang>{{TRANSLATIONLANGUAGE}}</> should also work.
Affected documentation
Expected outcome
No mismatched localisation of date and numbers, etc. in untranslated translation units.