Template talk:Lang

From Valve Developer Community
Jump to: navigation, search
Icon-message-48px.png
This is the discussion page of Template:Lang. To add a comment, use the Edit button near the headline of the appropriate section. To create a new section, you can use the Add topic button at the top of this page.
Comments on talk pages should be signed with "~~~~", which will be converted into your signature and a timestamp.

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

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. --1416006136 (talk) 04:29, 24 January 2023 The problem has been solved. --1416006136 (talk) 3:14, 3 Mar 2023

language code "JA" vs "JP"

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"? --Pee (talk) 20:02, 12 Feb 2023

All these pages with "JP" code should be moved to "JA". This template does not know how to switch between them. --THE OWL (talk) 4:30, 17 Feb 2023

How does this ever link to ZH-CN?

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. --Pee (talk) 01:48, 17 Feb 2023

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}}. --THE OWL (talk) 4:14, 17 Feb 2023

Un-Deprecating Lang

Because {{Multipage}} has proved to be a source of great hassle to editors, and its fate is now questionable, (and I won't even talk about the supposed upcoming {{Page}}, it looks desperately hopeless to me), should the old {{lang}} be un-deprecated?

As I understand it, one proper way to undo Multipage is to

  1. Nuke the pages that use {{Multipage}} (mod action),
  2. Take back the [page title]/en and move it in place of the nuked page, (because /en pages are the original pages that were moved in the first place, with their history too) (again mod action?),
  3. Move other translated versions, if they exist, from /lang to :lang (also mod action?),
  4. Reglue it all together with {{Lang}}

Isn't that the procedure? So, we would need {{lang}} cleared of deprecation/deletion notice and the advice to replace it with {{Multipage}}. Since the opposite would be taking place. Cvoxalury (talk) 13:47, 20 June 2024 (PDT)

I can't talk about the amount of work associated with going back to {{lang}} and whether or not that is the approach that we should use, but I can confirm that editing is indeed a great hassle. In the preferences of my account I set a language other than English and there are unnecessary problems that arise with the entire i18n system. For example, if a page doesn't exist in my language, it displays the English page instead. So far so good, but when I click one of the edit buttons, I don't get to edit the English page but instead it proposes the creation of the lang page of my language. I would also mention that {{Autolang}} is cluttered at many places translating half of a sentence or less so you end up with a sentence in more than one language but that's another story. --popcorn (talk) 09:57, 21 June 2024 (PDT)
I think it might be better to instead replace :language with /language, since that doesn't require moving pages using {{multipage}}, and that way it actually is a subpage of the English page. If that's implemented, it'll be significantly easier to revert back to this (or a similar) template. I'd be willing to delete the base pages and move English pages to them. Another issue is that some pages are in the pattern page:language/subpage:language, and others are in the pattern page/subpage:language. Ideally, only the latter should be used. This is another reason it might be worthwhile replacing lang with a slightly modified version (which could eventually be renamed to lang once this version is replaced with this successor).
Templates using {{autolang}} should be implemented similar to how they are in {{this is a/strings}}, where there's a "main" string that embeds other strings, and doesn't necessarily include the strings that aren't translated. For example, there's no Spanish translation of "for the shader parameter", so the main string doesn't embed it. ―Pee (talk) 10:33, 21 June 2024 (PDT)
Do you think we should stage an experiment with some not high-traffic multi-language page? The "delete base, move /en in place of base" experiment. Cvoxalury (talk) 13:58, 24 June 2024 (PDT)
For now, it should probably just stay in the sandbox. I was thinking that it might not be a bad idea to switch to a language dropdown while we're at it. Some pages like the Source SDK index have enough flags that it sometimes covers the title. An indicator could be placed at a page (i.e. a topicon that's the farthest right) instead. I came across a good explanation of how a dropdown could be implemented (which doesn't need JS enabled as a bonus). I made a mockup of what it could look like, but I'm not the best at CSS. ―Pee (talk) 19:32, 24 June 2024 (PDT)
I'm concerned that if we wait too long, certain elements will ignore everything said here, and start mass changes that we'll have to revert across some hundreds of pages. (but then, if they want they'll do them even after we change something...)
Dropdown looks fine. (I'd place it right below topicons, but that's moot right now). The amount of languages on some pages... were all those langs even translated by people, or automatically? some of the translations I've seen definitely reek of automation. And then we have Esperanto for some reason which is... why... Cvoxalury (talk) 01:50, 25 June 2024 (PDT)
If lang ever comes back and pages will be moved the language should be a prefix instead of suffix so that search suggestions aren't cluttered like this with pointless results. 6 suggestions from that are completely useless because of the language suffix Nescius (talk)
Bringing back Lang and add modern features (such as language drop down, add new languages, maybe /lang instead of :lang) would be good idea. {{Page}} isn't good at all (imagine a long text that was translated to more than 10+ languages, it would be PITA to read and navigate). For the separate translated category and the prefix/suffix, not sure about the first one (Lang support it, while MultiPage get rids of it) but for the other one, having a language prefix at the beginning before page name would prevent cluttering search results (through it might make finding the translated page (outside of the language icons/bar) much harder (as it's doesnt appear in Page information since it isn't a subpage). --leonidakarlach (talk) 23:47, 26 June 2024 (PDT)