MediaWiki talk:Lang

From Valve Developer Community
Revision as of 04:33, 5 October 2025 by Max34 (talk | contribs)
Jump to navigation Jump to search

Regarding the definition of the interface language

Right now the site uses {{Uselang}} and {{Intlang}} templates to define the interface language. This is not implemented in the best way: by checking certain interface messages for specific text. But this is the only way to properly implement a language definition. This option is not ideal, since if the interface is not translated into some language, it will be impossible to determine it (for example aa lang). There are only two options on what to do to solve this problem:

Create MediaWiki:Lang which will store all the language codes (MediaWiki:Lang/es = es, MediaWiki:Lang/ca = ca, MediaWiki:Lang/ru = ru, etc.), so it will be enough to enter {{int:lang}} to get the interface language.

Or add a MediaWiki extension that adds a magic word that displays the interface language code: mw:Extension:UILangCode. Max34 (talk) 7:32, 15 June 2024 (UTC)

Extensions are a no-go since I presently don't have access to the server containing the wiki. I can do the first option, but I'd have to do it later. PabloS (talk) 18:38, 15 June 2024 (UTC)
As I've noticed, people have moved away from {{Uselang}} and {{Intlang}} in favor of checking a single interface message (MediaWiki:Img-lang-go), but this method still requires converting from text to language code, which is bad. Furthermore, this isn't done with a single simple switch, but with a bunch of templates, which is even worse. This format adds these templates to the templates used on the pages, which means more unnecessary dependencies.
Moreover, this format might be difficult to scale, because if two languages ​​have the same translation, they won't be distinguishable. I understand that this is not the most necessary thing, but it is better to do it right from the start so that you don't have to fix it later. Creating this interface message is the best solution to all these problems. Max34 (talk) 04:33, 5 October 2025 (PDT)