So if we do not want to have to create and maintain 323 templates for the 323 languages on Wikipedia, we need "global templates".
https://www.mediawiki.org/wiki/Global_templates
They are being proposed, but there is not yet the critical mass to get going. But there is a #Wikimania session.
https://wikimania.wikimedia.org/wiki/2021:Submissions/Global_templates,_component_templates
If you are, and would like to join up, do contact these folks.
https://meta.wikimedia.org/wiki/User:Deryck_Chan
https://en.wikipedia.org/wiki/User:Anon423
Wiki templates are written in #Lua.
See also discussion here:
https://meta.wikimedia.org/wiki/Community_Wishlist_Survey_2019/Archive/Centralized_templates_and_modules