MediaWiki talk:Lang: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 11: Line 11:


:: 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. [[User:Max34|Max34]] ([[User talk:Max34|talk]]) 04:34, 5 October 2025 (PDT)
:: 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. [[User:Max34|Max34]] ([[User talk:Max34|talk]]) 04:34, 5 October 2025 (PDT)
::: It’s faster way to not have switch but bunch of templates. If conflict arises switch can be added to the conflicting languages. Of course this solution is simpler but the current one is already close to this.  —[[User:Nescius|Nescius]] ([[User talk:Nescius|talk]]) 06:54, 5 October 2025 (PDT)
::: It’s faster way to not have switch but bunch of templates. If conflict arises switch can be added to the conflicting languages. Of course this solution is simpler but the current one is already close to this.  —[[User:Nescius|Nescius]] ([[User talk:Nescius|talk]]) 06:54, 5 October 2025 (PDT)
:::: The switch option '''is better'''. And not because I think so, but because I tested it before writing about it, including in different languages ​​and usage scales. It also eliminates one expensive function usage and the sub-template is no longer called, eliminating the dependency on multiple templates.
:::: However, the interface message option is the best because it eliminates the need to rely on any templates at all. You won't have to worry about someone breaking them, either accidentally or on purpose. [[User:Max34|Max34]] ([[User talk:Max34|talk]]) 09:03, 5 October 2025 (PDT)

Revision as of 09:03, 5 October 2025

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:34, 5 October 2025 (PDT)
It’s faster way to not have switch but bunch of templates. If conflict arises switch can be added to the conflicting languages. Of course this solution is simpler but the current one is already close to this. —Nescius (talk) 06:54, 5 October 2025 (PDT)
The switch option is better. And not because I think so, but because I tested it before writing about it, including in different languages ​​and usage scales. It also eliminates one expensive function usage and the sub-template is no longer called, eliminating the dependency on multiple templates.
However, the interface message option is the best because it eliminates the need to rely on any templates at all. You won't have to worry about someone breaking them, either accidentally or on purpose. Max34 (talk) 09:03, 5 October 2025 (PDT)