Template talk:Lang

From Valve Developer Community
Jump to: navigation, search
Icon-message-48px.png
Welcome to Template talk:Lang!
This is the start of the Lang discussion page.

To add a new message, click on "Add Topic/Reply" button below, and set the "Subject".
To add a Reply, do the same as above, but leave the "Subject" blank.

This currently seems broken. It shows only English in non-English pages and links to the file of flag. I don't know if I did wrong nor how to fix it. FloraC (talk) 07:16, 31 August 2019 (UTC)

Looked at your recent edits on translated pages. To use the lang template, you need to have the title of the english page as the first parameter, then you can add title=translated title as the second parameter. — Dr. Orange talk · contributions 09:33, 31 August 2019 (UTC)

Synchronize buttons to header line?

The language buttons seem a tad bit lower than the line. Is it fine if I adjust the template to account for this? - Amicdict (talk) 16:09, 30 August 2021 (PDT)

Support for more languages?

I think more languages should be supported:

  • Hindi (hi)
  • Finnish (fi)
  • Modern Greek (el)
  • Danish (da)
  • Arabic (ar)
  • Afrikanns (af)
  • Slovak (sk)
  • Romanian (ro)
  • Bulgarian (bg)
  • Indonesian (id)
  • Karelian (krl)

More ISO codes are located at Wikipedia icon List of ISO 639-2 codes. - Amicdict (talk) 18:29, 13 September 2021 (PDT)

Big update idea

There are many problems with this template. But after spending a couple of days I came up with one idea that could fix most of all the problems associated with this template. You can take a look at a sketch of how it will look (link).

There will be no more problems with the fact that the template will slide down, for example, because of the inscription "Redirected from" or if this article is a sub-article and there is an automatic link to the parent article. Also, in this version, all languages ​​will be displayed at once, but in order not to get confused, those articles which do not exist are marked in red. And the one that is slightly brighter than everyone else is the one you are on. This is almost the same as on mediawiki, only instead of text - pictures.

Also if the user has a small screen and the title of the article is long, then the original lang would overlap with the title. This is certainly not a disaster, but this will not happen in the new version either.

It might be worth making a separate template for each language so that there are not so many in the lang template. Perhaps this will prevent reaching the limits, as this thing is quite expensive.

So, is it worth redesigning the template? by the way, this change will not break anything and on old articles everything will work fine. - Max34 (talk) 7:38, 15 September 2021 (UTC)

I don't see anything wrong with doing this. If it turns out to have bad problems, it's easy to just undo the changes and rework them. - Amicdict (talk) 14:33, 15 September 2021 (PDT)
There is a request I like to make though and that is to add parameters to change the language links, while still automatically using the standard translated page names by default. (so setting the japanese flag link to 翻訳なページ instead of translated_site:jp as an example). - Amicdict (talk) 14:38, 15 September 2021 (PDT)
Looking at the template though, I would prefer to keep the flags to the right of the header to not waste any screen space. - Amicdict (talk) 17:42, 15 September 2021 (PDT)
Why should it display every language? Not very related, but if there's a way to make this template stop spamming Special:WantedPages, it should be done. --Loudslappingsounds (talk) 23:19, 15 September 2021 (PDT)
That is why I think that the option with all languages ​​will be better at once: they will all be in one place, that is, you will not have to look for the desired icon again. If you show all the icons at once (even if you add 11 more new ones that Amicdict suggested), it will still take up little space. If you place them in the article itself, and not on the top right, most of the visual problems will be solved: unnecessary offset, for example, due to redirection, intersection with the article title, if the title is long, and there is also a problem with constant offset: at different screen resolutions, the template then below what you want, then above what you need, but if you put the template in the article, and not on the top right, this will not happen. The mediawiki uses a similar principle (for example here) and is pretty handy. And by the way, I think I found a way to avoid two of the most serious problems at once: the problem with the limit {{#ifexist:}} and the problem with a lot of unnecessary links in Special:WantedPages. Now I will try to make a new version of the template and see if it works. - Max34 (talk) 13:46, 16 September 2021 (UTC)

New language bar

This huge language is atrocious (https://imgur.com/4DWhx3T). Can we please get rid of this? Darnias (talk)

You can undo the change if you hate it ya know. I think the code patches should be kept, but definitely keep the flags to the right of the header like it always has been. Simply put: Putting the flags in the article wastes valuable user space. - Amicdict (talk) 15:00, 16 September 2021 (PDT)
Also should other languages be supported? If not that's ok. - Amicdict (talk) 15:00, 16 September 2021 (PDT)

Change response

Having the language bar to the top right is way better. I approve of this change.

Only issue left is the appearance of the borders around the flags and the border enclosing the whole bar, because the borders look off. - Amicdict (talk) 15:16, 16 September 2021 (PDT)

One small edge around one flag is the selection on which article you are. If it gets in the way, I can remove it. And the fact that the line does not connect with the line around the flags is already a display problem and cannot be fixed in any way, I can only deliberately underestimate a little more so that it does not rise too high. - Max34 (talk) 22:25, 16 September 2021 (UTC)
Ok. If the Lang template line is too low, you can always use noline=1 and then a raised horizontal bar. - Amicdict (talk) 21:23, 16 September 2021 (PDT)

There is the issue that if there is only one page (no other languages), the empty flags' box still shows its borders. I personally think it is better if the flag of the current page does show, with no link, as it was before. It is easier to count, the flags order remains the same when switching between lang pages, (we can tell by seeing the flags whether the lang template is used,) (seriously, doesn't it make you feel prouder if there are more flags?). Maybe one could highlight the background of the flag of the current page?
--Popcorn (talk) 11:38, 19 September 2021 (PDT)

Language parameters?

Can I experiment with adding the ability to change the flag links? There will always be the default suffixes that apply, but if a language parameter (jp, ka, ko, etc.) is applied then that language's flag will link to a different site instead of the default (e.g jp=翻訳なページ makes the Japanese flag go to 翻訳ページ instead of translated_page:jp)

This way we don't have to rely on {{otherlang2}}, and can instead use the better {{lang}} template for translated pages that don't conform to the translated page name standard. - Amicdict (talk) 22:20, 16 September 2021 (PDT)

Amicdict, it's not very easy to communicate here, can we go to a discord, for example? (Max34#7774). - Max34 (talk) 5:47, 17 September 2021 (UTC)
Sure, but do also post the conversation here as well. - Amicdict (talk) 00:39, 17 September 2021 (PDT)

Solve a problem

There is a problem that the template will change the page title automaticaly and cause entity templates cannot change the titles of entity pages. ——大康 (talk) 00:52, 17 December 2022 (PST)

This can be fixed by using the {{{noerror}}} parameter in the {{DISPLAYTITLE}} of the entity templates. You can read about this here: https://www.mediawiki.org/wiki/Help:Magic_words#DISPLAYTITLE. — User:Max34 (talk) 14:16, 17 December 2022 (GMT)

Reasons not to use

Is there any reason not to use this, either on a translated or english-only page? —Pee (talk) 15:58, 6 January 2023 (PST)

The titles of entity pages

ERR
Empty.png
DaKang23312:29, 24 January 2023 (UTC+8)
Is there a way to make the title of an entity template appear first when {{lang}} is in use? Changing the title every time via the {{{title}}} parameter of the {{lang}} template is a bit of a hassle.
ERR
Empty.png
DaKang23311:14, 3 March 2023 (UTC+8)
The problem has been solved.

language code "JA" vs "JP"

ERR
Empty.png
Pee20:02, 12 February 2023 (UTC)
Every Japanese-language page except the main page, which isn't even translated, uses the non-standard code "JP" despite "JA" being correct. Should all of these pages be moved, or should the lang template switch from "JA" to "JP"?
ERR
UserAvatarFrame-THE OWL.png
THE OWL11:30, 17 February 2023 (UTC+7)
All these pages with "JP" code should be moved to "JA". This template does not know how to switch between them.

How does this ever link to ZH-CN?

ERR
Empty.png
Pee1:48, 17 February 2023 (UTC)
this page only ever has "zh" or "zh-tw" as far as I can see, yet the Chinese flag appears to link to zh-cn. This caused me some strange issues while moving pages around, does anyone know why? Hopefully I'm not just too blind to find where it says zh-cn here or in the dictionary template.
ERR
UserAvatarFrame-THE OWL.png
THE OWL11:14, 17 February 2023 (UTC+7)(edited)
I think there was a mistake. Continue using
zh-cn for language pages if you use this template.

Max34 decided to replace zh-cn with zh, following the example of Wikipedia, but for some reason he also touched on this template, which should support the old way of translating pages.

zh-cn is specified in the template {{zh}}.