Jump to content

Template talk:Lang/Archive 14

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 10Archive 12Archive 13Archive 14

Possible bug

At the bottom of the page, List of transgender public officeholders in the United States is in the category "Category:Articles containing Neapolitan-language text", despite not having any Neapolitan text. I'm not seeing anything labeled {{lang|nap}} or anything like that, either. Snowman304|talk 13:47, 15 September 2024 (UTC)

That page transcludes Template:Transgender sidebar which does use that. Gonnym (talk) 14:38, 15 September 2024 (UTC)
Gotcha! Thanks Snowman304|talk 14:47, 15 September 2024 (UTC)

Template-protected edit request on 18 September 2024

Can someone please categorise the template {{lang-ku}} under Category:Iranian multilingual support templates instead of Category:Indo-Iranian multilingual support templates, and the templates {{lang-bn}}, {{lang-hi}}, {{lang-ne}}, {{lang-pa}}, {{lang-sa}} and {{lang-ur}} under Category:Indo-Aryan multilingual support templates instead of Category:Indo-Iranian multilingual support templates, because the categories 'Indo-Aryan multilingual support templates' and 'Iranian multilingual support templates' are more specific than the category 'Indo-Iranian multilingual support templates'? PK2 (talk; contributions) 03:44, 18 September 2024 (UTC)

Done. Another reason why this system of creating hundred of templates like this is horrible maintenance-wise, when one template with a language code works. Gonnym (talk) 08:25, 18 September 2024 (UTC)

a way to mark something as being in multiple languages

Maybe this is pie-in-the-sky, or a different matter entirely, but it would be nice if there were a way to mark something as being in multiple languages, e.g., Czech and Slovak from Chort: A chort (Russian: чёрт, Belarusian and Ukrainian: чорт, Serbo-Croatian čort or črt, Polish: czart and czort, Czech and Slovak: čert, Slovene: črt) Snowman304|talk 19:12, 18 September 2024 (UTC)

Not in these templates. The primary purpose of these templates is to provide correct html markup for non-English text. html allows only one lang= attribute per tag. Which one of these multiple languages would apply? Browsers use this attribute to choose a proper font; screen readers use the attribute to control pronunciation. Do Belarusians and Ukrainians pronounce 'чорт' the same way? If not then that suggests that a different way of writing that lead sentence should be preferred.
Trappist the monk (talk) 19:43, 18 September 2024 (UTC)
Gotcha, I wasn't thinking about those things at all. Snowman304|talk 21:08, 18 September 2024 (UTC)

Is it applied to transliterarions?

Please see Talk:Kompromat#Why_is_the_word_so_small?. Two issues: (2) the complaint abouot fontsize and (1) (my question: Is the usage {{lang|ru|Kompromat}} (Kompromat) valid or only {{lang|ru|компромат}} makes sense? --Altenmann >talk 23:54, 4 October 2024 (UTC)

Please use {{lang|xx-Latn}} or {{tlit}} for transliterations: IETF codes assume the "native" script with a bare language code, so ru assumes Cyrillic (i.e. explicitly ru-Cyrl). Using the transliteration template {{tlit|ru}} would tag as ru-Latn (i.e. Russian written using the Latin alphabet)
So, {{lang|ru|Компромат}} {{tlit|ru|Kompromat}}Компромат Kompromat. If you have any questions lmk Remsense ‥  23:59, 4 October 2024 (UTC)
Thx, great. But what about the complaint in Talk:Kompromat#Why_is_the_word_so_small?? --Altenmann >talk 00:11, 5 October 2024 (UTC)
I've responded there. Remsense ‥  00:20, 5 October 2024 (UTC)
Not great at all; the italics make me start off seeing it as Cyrillic italic. I read {{tlit|ru|Kompromat}}Kompromat as the italicized version of the unpronounceable mish-mash Котротаъ, which rendered in italics almost looks like the word under discussion (here rendered on two lines, to illustrate the problem):
  • Котротаъ – fake word 'Котротаъ' in italics
  • Kompromat – from {{tlit|ru|Kompromat}}Kompromat — real Russian word Компромат, romanized
See the problem? Makes me backtrack and reparse. The ' r ' is a clue, but it depends how clear my glasses are, and what time it is. Isn't there a guideline somewhere about not italicizing Cyrillic? There's a good reason for that. Mathglot (talk) 01:06, 5 October 2024 (UTC)
Found it: MOS:BADITALICS. Mathglot (talk) 01:13, 5 October 2024 (UTC)

Italics in foreign-language text

I'm struggling with what to do with foreign-language text containing italic text while following default rules on foreign-language italicization. Specifically, I'm working on Template:Translated blockquote. The default rules are described at Template:Lang#Automatic italics and defined at Module:Lang#L-996.

Option Source Issue
{{lang|fr|Je suis un clown nommé ''Maurice''|italic=unset}} Category:Lang and lang-xx template errors Doesn't use the default italicization
{{lang|fr|Je suis {{noitalic|English}}.}} Template:Lang#Automatic italics Uses Template:Noitalic, when the content should invert italics relative to the surrounding text.
tûndra Template:Lang#italic parameter Doesn't use the default italicization

I have edited Template:Lang/with italics (permalink) as a proof-of-concept that can accept the following kinds of markup:

Markup Renders as
{{Lang/with italics|en|Some text}}

Some text

{{Lang/with italics|en|Some <i>italic</i> text}}

Some italic text

{{Lang/with italics|fr|Je suis française.}}

Je suis française.

{{Lang/with italics|fr|Je ''suis'' française.}}

Je suis française.

{{Lang/with italics|he|לעז}}

לעז

{{Lang/with italics|he|''לעז''}}

[לעז] Error: {{Lang}}: text has italic markup (help)

My implementation is really klunky, so this isn't an edit request. It just seemed easier for me to implement in the template rather than the Lua module.

Questions:

  1. Why doesn't Template:Lang accept italics in its text, as Template:Lang/with italics does?
  2. What do you recommend I do with Template:Translated blockquote? At the moment, it uses |italic=invert. It could use Template:Lang/with italics by a more permanent name, eg Template:Lang/with italics.

Daask (talk) 20:08, 18 September 2024 (UTC)

{{lang}} emits errors because in the beginning of this module's life, there were a bunch of {{lang|es|''casa''}}, holdovers from the time that Latn-script text had to be manually italicized. This doesn't happen so much anymore now that editors have learned the 'new' way. But, this italics prohibition brought with it the problem of what to do with mixed italic/upright text. The solution to that was |italic=unset and |italic=invert. So far as I know, there has been no call for any other options.
What is wrong with using |italic=invert? Does it not do what you need doing?
Trappist the monk (talk) 21:47, 18 September 2024 (UTC)
@Trappist the monk: The |italic=default only italicizes Roman-script text, whereas |italic=invert always italicizes the text, regardless of script.
Eg. {{Lang|italic=invert|he|לעז}}לעז vs. {{Lang/with italics|he|לעז}}לעז
Daask (talk) 13:32, 19 September 2024 (UTC)
Maybe we could add an option |allow-italics=yes to omit error messages about italics within the text? Daask (talk) 13:39, 19 September 2024 (UTC)
On second thought, Category:Lang and lang-xx template errors is empty except for a citation template issue, so I suggest the Template:Lang/with italics behavior be made the default. These error messages are no longer necessary. Daask (talk) 13:41, 19 September 2024 (UTC)
I disagree. These italics errors do still appear. The template is responsible for styling the rendered non-English text so it considers italic markup an error unless the editor has explicitly directed the template to allow the markup.
Trappist the monk (talk) 14:44, 19 September 2024 (UTC)
Yes: |italic=default only italicizes Roman-script text – this determination happens at lines 996–1003; see also lines 94–135
The purpose of invert is to flip italicized text within upright text so that you get upright text within italicized text. This is a completely bogus example because the English text should never be marked up as Hebrew:
{{Lang|italic=invert|he|some italic text followed by inverted Hebrew text ''לעז'' and then some more italic text}}
some italic text followed by inverted Hebrew text לעז and then some more italic text
So, the module inverts everything to the opposite markup:
some italic text followed by inverted Hebrew text ''לעז'' and then some more italic text
some italic text followed by inverted Hebrew text לעז and then some more italic text
becomes:
''some italic text followed by inverted Hebrew text ''לעז'' and then some more italic text''
some italic text followed by inverted Hebrew text לעז and then some more italic text
If there is no italic markup, |italic=invert is the same as |italic=yes as you demonstrated in your example. Conversely, when there is only italicized text:
{{Lang|he|''לעז''|italic=invert}}
לעז
Your example:
{{Lang/with italics|he|''לעז''}} → [לעז] Error: {{Lang}}: text has italic markup (help)
can be achieved with any of these:
{{Lang|he|לעז|italic=yes}}לעז
{{Lang|he|לעז|italic=invert}}לעז
{{Lang|he|''לעז''|italic=unset}}לעז
These |italic= parameter values are working as they are intended to work.
Trappist the monk (talk) 14:44, 19 September 2024 (UTC)
@Trappist the monk: I have current set Template:Translated blockquote to use Template:Lang/with italics, because I see no way to use Template:lang. I need the default behavior (which Template:Lang/with italics detects via Template:lang/italicize), but I also need to omit error messages. I apologize for being overly bold in suggesting that the error messages are no longer useful, but I need a means to omit them. Daask (talk) 14:55, 19 September 2024 (UTC)
Daask, I think you should not implement any italics for Cyrillic until you get sufficient consensus to overturn Wikipedia:Manual of Style/Text formatting, in particular, MOS:BADITALICS. Is this sandboxed now? If so, please do not release it until a wider discussion has been had about it. Mathglot (talk) 01:12, 5 October 2024 (UTC)
@Mathglot: I'm confused by your comment. {{Lang/with italics}} and {{Lang}} use the same default italicization. {{Lang/with italics}} just omits the error messages when the text contains manual italicization. I have no intention of proposing changes to WP:MOS related to this topic. Can you give an example of your concern? Daask (talk) 12:50, 8 October 2024 (UTC)
Ah, I now see your comments in § Is it applied to transliterarions? and think I understand your concern. You want to ensure that {{Lang/with italics}} enforces MOS:BADITALICS by throwing errors on manual italicization of non-Roman scripts. I created it because {{Lang}} was throwing errors on italicization in French text, but I see that my examples included italicized non-Roman text, which are not acceptable. I'll adjust the template accordingly momentarily. Daask (talk) 13:01, 8 October 2024 (UTC)
Yes, that's what I meant. Mathglot (talk) 15:03, 9 October 2024 (UTC)

Georgian italics

In Langx, Georgian (code "ka") is currently italicized by default but shouldn't be, per WP:FOREIGNITALIC. — Goszei (talk) 22:54, 12 October 2024 (UTC)

Use {{lang-ka}}. That template is not one that will be converted to {{langx}} because it is based on {{language with name}} and also uses {{ka-translit}}.
{{lang-ka|ქართული ენა}}Georgian: ქართული ენა
I expect in a future version of {{langx}} to implement the same auto-italic code that is used by {{lang}}:
{{lang|ka|ქართული ენა}}ქართული ენა
If you are seeing editors switching {{lang-ka|...}} to {{lang|ka|...}}, please ask them to stop.
Trappist the monk (talk) 23:24, 12 October 2024 (UTC)

Error when displaying Japanese text

I don't know if this is the right place for a bug report, but instead of the Japanese text and romaji equivalent I get this message: "Lua error in Module:Lang at line 1422: attempt to concatenate a nil value.".

The text was displaying correctly until I clicked on the donate button with the scroll-wheel (which opened the page in a new tab). Now any page I go on has this error message instead of the Japanese text, even when I refresh or close and reopen a page.

I am using Firefox and Ecosia. Luu-meer (talk) 15:44, 13 October 2024 (UTC)

Fixed.
Trappist the monk (talk) 16:04, 13 October 2024 (UTC)

Lua error in Module:Lang at line 1422: attempt to concatenate a nil value

This error show on the page Wicked City (1987 film). 118.3.227.103 (talk) 15:40, 13 October 2024 (UTC)

Ping Trappist the monk (last editor), it also shows up at MOS:FORITA. Sam Sailor 15:54, 13 October 2024 (UTC)
Fixed.
Trappist the monk (talk) 16:03, 13 October 2024 (UTC)
Wow, that was fast! 118.3.227.103 (talk) 16:14, 13 October 2024 (UTC)

merge language-specific templates

For years I've wanted to create a {{lang-??}} template that would replace all of those hundred of templates. Alas, {{lang-xx}}, the most obvious choice for a template name, is used as a redirect to Template:Lang § Language-specific templates. One might argue that the language-specific templates need not be mentioned in Template:Lang/doc if {{lang-??}} was a template that accepted the same parameters as the language-specific templates. {{lang-x}} is used for documentation for the language-specific templates and would become superfluous if we created a single {{lang-??}} template.

We might:

  1. create a redirect {{language-specific templates}}
  2. replace all instances of {{lang-xx}} with {{language-specific templates}} so we could recover the {{lang-xx}} name
  3. modify Module:lang to have a lang-xx() entry point
  4. create {{lang-xx}} as a template that invokes the new lang-xx() entry point to Module:Lang
  5. create Template:lang-xx/doc from {{lang-x}}
  6. create language-tagged index of categories (as a new submodule?)
  7. replace appropriate instances of the {{lang-XX|...}} templates with {{lang-xx|XX|...}} where -xx is literal and XX is the language tag and subtags if any (not all are appropriate, {{lang-zh}} for example; there are also {{lang-XX}} templates that have been 'augmented')
  8. delete appropriate {{lang-XX}} templates that are supported by Module:lang (not all are appropriate)
  9. replace instances of {{language-specific templates}} with links to {{lang-xx}}
  10. delete {{language-specific templates}}
  11. cleanup the mess

No doubt I've missed something here, not the least of which is community approval to make this change.

Trappist the monk (talk) 14:34, 18 September 2024 (UTC) 16:11, 18 September 2024 (UTC) +category list 17:16, 18 September 2024 (UTC) strike category list

Yeah, that all sounds great and I support it. The past few years saw us move from instances of templates with multiple language or country versions, to one single template ({{ISO 639 name}}: TfD; {{In lang}}: TfD (part 1) and TfD (part 2); {{Globalize}}: TfD; {{Contains special characters}}: TfD; {{Wikt-lang}}: TfD), this isn't different. Another option for the name can be {{lang2}} (which currently is an unused unrelated redirect) since "lang-xx" doesn't have any semantic meaning either. Gonnym (talk) 15:24, 18 September 2024 (UTC)
It also seems that most usages of {{lang-xx}} is from transclusions of Module:Road data/strings/doc. Gonnym (talk) 16:05, 18 September 2024 (UTC)
I have removed all but 16 usages of {{lang-xx}}. The remaining usages appear to be generated by an error, possibly in this module. If someone wants to dig in to the remaining 16, we can free up the template name for a better use. – Jonesey95 (talk) 16:18, 19 September 2024 (UTC)
Thanks for doing that. I am beginning to favor {{langx}}; easier to write and no pre-existing conflicts to clean up. I am working to implement {{langx}} in Module:Lang/sandbox:
{{#invoke:lang/sandbox|langx|es|text}}Spanish: text
{{#invoke:lang/sandbox|langx|he|text}}Hebrew: text
Trappist the monk (talk) 16:59, 19 September 2024 (UTC)
If semantic meaning is a requirement, perhaps the solution is a change to {{lang}} where we add a parameter |<something>= that causes Module:Lang to select lang(), lang_xx_inherit(), or lang_xx_italic depending on the language tag supplied in the template call. The replacement in article space then becomes {{lang-XX|...}}{{lang|XX|<something>=yes|...}}. I can imagine that editors won't like that so much and would want a more-or-less familiar shortcut which brings us back to {{lang-xx}} or {{lang2}} or {{langx}} or {{lang+}} or ...
Trappist the monk (talk) 16:11, 18 September 2024 (UTC)
I agree. If we add too much character count it will fail. Gonnym (talk) 16:19, 18 September 2024 (UTC)
Made this topic its own section.
I'm going to commandeer {{langx}} for use as a testbed/demonstrator with a module in my sandbox.
Trappist the monk (talk) 16:44, 18 September 2024 (UTC)
Category list. The categories listed in these various {{lang-??}} templates (like those listed at Template talk:Lang § Template-protected edit request on 18 September 2024) seem to be mostly collections of related templates (see Category:Iranian multilingual support templates as an example). Because a single {{langx}} template can't be categorized in this way there is no need to support those collection categories. I have struck it from the list.
Trappist the monk (talk) 17:16, 18 September 2024 (UTC)
Yes, that's another thing that gets simplified. The category system at Category:Wikipedia multilingual support templates will get trimmed by quite a lot. Gonnym (talk) 17:39, 18 September 2024 (UTC)
The sandbox module is pretty simple, doesn't do error checking (leaves that for _lang_xx() in Module:Lang) and chooses upright font if the language tag is listed in a table of upright tags; italic else:
{{langx|es|casa}}Spanish: casa
{{langx|he|לעז}}Hebrew: לעז
{{langx|aaa|לעז}}Ghotuo: ɔ-kàkà – there is no {{lang-aaa}}
I suppose that the next thing to do is to hack on Module:Lang/sandbox so that it can support both {{langx}} and {{lang-??}}. That will be necessary if or when we transition from the one to the other. I think that we ought to leave support for {{lang-??}} in the module so that the ~155 wikis that use it can adapt to the change in their own time.
Trappist the monk (talk) 18:45, 18 September 2024 (UTC)
Module:Episode list, Module:Nihongo, and Module:Lang/utilities will need to be adjusted if we transition to {{langx}}.
Trappist the monk (talk) 19:11, 18 September 2024 (UTC)
Yes, I agree with leaving in the lang-?? support. I think maybe a note should be added to its documentation that this usage is the deprecated method. Gonnym (talk) 19:12, 18 September 2024 (UTC)
I had thought to enforce the deprecation by testing the value returned in lines 27 & 28; if en and calling _lang_xx, return an error message.
Trappist the monk (talk) 19:33, 18 September 2024 (UTC)
That's also a good idea. Gonnym (talk) 21:17, 18 September 2024 (UTC)
Module:Lang/sandbox now supports {{langx}}. For the most part, {{langx}} uses the code already present for the {{lang-??}} templates. But because of that, it is necessary that all of the testcases in Module:Lang/testcases pass. As of this writing, they do.
Because many of the {{lang-??}} templates render text in an upright font, I created Module:Lang/langx which holds several tables so that Module:Lang/sandbox can render the {{langx}} template identically to the corresponding {{lang-??}}. For example:
{{lang-es|casa}}{{lang-es|casa}} → {{lang-es|casa}}
{{langx|es|casa}}[[Spanish language|Spanish]]: <i lang="es">casa</i>Spanish: casa
{{lang-he|עִבְרִית}}{{lang-he|עִבְרִית}} → {{lang-he|עִבְרִית}}
{{langx|he|עִבְרִית}}[[Hebrew language|Hebrew]]: <span lang="he" dir="rtl">עִבְרִית</span>Hebrew: עִבְרִית
In my sandbox (permalink), all of the {{lang-??}} templates are compared to their {{langx}} counterparts. There are two {{lang-??}} templates that do not match. Both of those wrap the module invoke with <span class="Unicode">...</span>: {{lang-mrj}} and {{lang-sty}}. I have a vague memory that suggests that it was once necessary to use that class but with certain changes to MediaWiki, the requirement for the Unicode class was removed. If I do remember correctly, these two templates might be edited to remove the class span. If, for some reason, the class is required, Module:lang and Module:lang/langx can be modified to support it for mrj and sty
At this writing, Category:Lang-x templates lists 1156 {{lang-??}} and other templates. This number includes the 10 templates in Category:Constructed language multilingual support templates but, rightly, does not include the 14 templates listed in Category:Lang-x templates with other than ISO 639.
Of the 1156, four are redirects. The remaining 13 templates are not supported by {{langx}} though some might be:
  • {{Language with name}} – an older, manual form of {{langx}}; calls {{lang}} to do text rendering
  • {{lang-ku-Arab}} – uses {{language with name}} and {{script/Arabic}}
  • {{lang-mnc}} – uses {{language with name}} and has support for two types of transliteration; might be converted to lang-xx and {{langx}}? Manchu language; would need to add transliteration identifiers to Module:Lang/data
  • {{lang-kmr}}uses {{language with name}}; can be converted to lang-xx and {{langx}}? Kurmanji Kurdish language converted to Module:Lang 2024-09-22
  • {{lang-grc-gre}} – invalid language tag; Module:Lang does not support legitimate IETF extlang subtags; gre is not a legitimate extlang subtag
  • {{lang-ka}} – uses {{language with name}} and {{ka-translit}}
  • {{lang-tdd}}uses {{language with name}}; can be converted to lang-xx and {{langx}}? Tai Nuea language converted Module:Lang 2024-09-22
  • {{lang-prk}}uses {{language with name}}; can be converted to lang-xx and {{langx}}? Parauk language converted Module:Lang 2024-09-22
  • {{lang-zh}} – uses Module:Lang-zh
  • {{lang-wbm}}uses {{language with name}}; can be converted to lang-xx and {{langx}}? Vo language converted Module:Lang 2024-09-22
  • {{lang-su-fonts}} – wraps invoke in <span lang="su" style="font-family:'Noto Sans Sundanese', 'Sundanese Unicode 2013'; font-size:;">...</span> tag
  • {{lang-rus}} – uses {{language with name}} and {{IPA}}
  • {{spell-nv}} – uses {{lang}} wrapped in <span style="font-family: Aboriginal Sans, DejaVu Sans, Calibri, Arial Unicode MS, sans-serif;">...</span> tag; does not belong in Category:Lang-x templates
Many (most?) of the {{lang-??}} templates include category links in their wikitext. Most appear to use some form of 'Category:<language name> multilingual support template' category. Leaving out those categories, this search returns 13 templates with some sort of category link. These are:
I think that Module:Lang/sandbox is ready to go. Yea or nay? If yea then we need to consider the process of retiring the 1100+ {{lang-??}} templates.
Trappist the monk (talk) 18:55, 21 September 2024 (UTC)
I'll of course support it. After the replacement of the templates, and deletion, it will be easier to spot the leftover templates that need additional work (like the ones in your list above). Gonnym (talk) 22:12, 21 September 2024 (UTC)
This sounds like an excellent simplification. I am sure that we will run into a few stumbles along the way, but edge cases can either be dealt with or left behind as exceptions to the general "no lang-xx" templates practice. – Jonesey95 (talk) 20:41, 22 September 2024 (UTC)
Right then, Module:Lang updated from Module:Lang/sandbox so {{langx}} is live; Template:Langx/doc created from a hacked version of Template:Lang-x/doc (needs work; see the TODOs there).
Trappist the monk (talk) 22:26, 22 September 2024 (UTC)
I have converted {{lang-kmr}}, {{lang-tdd}}, {{lang-prk}}, and {{lang-wbm}} in the list above to directly use Module:Lang.
Trappist the monk (talk) 01:01, 23 September 2024 (UTC)
Is there anything I can do to help us get to the point where we are ready with replacement? Gonnym (talk) 17:17, 25 September 2024 (UTC)
I suspect that we're ready with the exceptions of writing a bot to do the replacements and deciding how to word a TfD that will provoke the fewest editors into reaching for their pitchforks and at the same time gain the greatest support. You are for more experienced with TfD and what succeeds there than I, so if you have a suggestion for that... Do we need to mark all 1140-ish templates with TfD notices? If so, that will also need doing; could probably do that with AWB – of course that is the sort of thing that brings out the torches and pitchforks...
Trappist the monk (talk) 18:47, 25 September 2024 (UTC)
We do need to tag all templates, but |type=disabled (in my opinion) should be used so the pages aren't completely full of TfD everywhere (which usually gets people angry).
Regarding the TfD text...well I'm sure we're going to get the angry mob no matter what. But a few things we can mention
Gonnym (talk) 19:03, 25 September 2024 (UTC)
Yeah, all of those TfD notices do cause anger. But, editors will also get angry for not being notified when all of a sudden a bot shows up to rewrite all of the {{lang-??}} templates. Is there a middle ground? Perhaps we show the TfD notice on one or two of the templates with significant use? Perhaps {{lang-de}} (~40280 articles) or {{lang-ru}} (~95500 articles)? Or, we can choose four or five templates that aren't used as much?
How about this? Too long; won't read? Too technical? Too detailed? Too...? reworked 18:51, 26 September 2024 (UTC)
Replace and delete the approximately 1145 {{lang-??}} templates listed at [[]] with the single template {{langx}}.

The {{lang-??}} templates are all more-or-less forks of some ancient ancestor. Like {{lang}} the primary purpose of these templates is to render non-English text in a way that is html-correct and compliant with the Manual of Style. {{langx}} uses the same rendering code as the {{lang-??}} templates so, given the same language tag and text, renders an identical output:

{{lang-es|casa}}{{lang-es|casa}} → {{lang-es|casa}}
{{langx|es|casa}}[[Spanish language|Spanish]]: <i lang="es">casa</i>Spanish: casa

Like {{lang}}, {{langx}} supports all of the 8000+ languages listed in the IANA language-subtag-registry file. {{lang-??}}: one template for one language; {{langx}}: one template for 8000 languages.

Background

The {{lang-??}} templates differ from {{lang}} in that they prefix the non-English text with a link to the language article name:

{{lang|es|casa}}<span title="Spanish-language text"><i lang="es">casa</i></span>casa
{{lang-es|casa}}{{lang-es|casa}} → {{lang-es|casa}}

For editors who need another language template, their options til now have been:

  1. fork a new {{lang-??}} template
  2. use the lang_xx_italic() utility function in {{lang}}
    {{lang|code=es|text=casa|fn=lang_xx_italic}}[[Spanish language|Spanish]]: <i lang="es">casa</i>[[Category:Pages using Lang-xx templates]]Spanish: casa
  3. manually prepend a language-article link to {{lang}}:
    [[Spanish language|Spanish]]: {{lang|es|casa}}[[Spanish language|Spanish]]: <span title="Spanish-language text"><i lang="es">casa</i></span>Spanish: casa
  4. create the template using {{language with name}} (which more-or-less does what item 3 does...)
  5. do it all manually (not recommended because not html correct):
    [[Spanish language|Spanish]]: ''casa''[[Spanish language|Spanish]]: ''casa''Spanish: casa

Previous TfDs related to language tagging:

Wikipedia:Templates for discussion/Log/2020 August 14 § ISO 639 name from code templates
Wikipedia:Templates for discussion/Log/2019 July 5 § Link language wrappers (part 1), Wikipedia:Templates for discussion/Log/2020 February 23 § remaining link language wrappers (part 2)
Wikipedia:Templates for discussion/Log/2024 August 5 § Wiktionary link templates (fewer templates involved but still related to language tagging)
Trappist the monk (talk) 11:57, 26 September 2024 (UTC) reworked 18:51, 26 September 2024 (UTC)
Maybe put the sections relevant to the nomination together (the start and the end), and then add in the technical behind the secnes information for anyone wanting a more detailed explanation to the differences.
There are approximately 1145 lang-?? templates; all more-or-less forks of some ancient ancestor. Like {{lang}} the primary purpose of these templates is to render non-English text in a way that is html-correct and compliant with the Manual of Style {{langx}} uses the same rendering code as the lang-?? templates so, given the same language tag and text, renders an identical output: -examples- Like {{lang}}, {{langx}} supports all of the 8000+ languages listed in the IANA language-subtag-registry file. lang-??: one template for one language; {{langx}}: one template for 8000 languages. Gonnym (talk) 17:10, 26 September 2024 (UTC)
Reworked some. Better? Worse? Still too...?
Trappist the monk (talk) 18:51, 26 September 2024 (UTC)
I think this looks good. @Jonesey95 thoughts? Gonnym (talk) 19:00, 26 September 2024 (UTC)
My experience with TFD is that sometimes biting off a huge chunk creates too much drama and backfires. I would pick ten simple, widely used templates from the set (i.e. don't pick any edge cases; pick ones that will definitely convert cleanly), explain briefly what you propose to replace them with, and then say that if it works, you will bring the remaining 1,100 templates back to TFD using the ten-template TFD as a basis for consensus. Link to this discussion. Doing the process in two phases will probably take less time and cause less drama than trying to do it in one phase. – Jonesey95 (talk) 19:06, 26 September 2024 (UTC)
I guess I don't like this option. It means multiple TfDs which can have multiple outcomes. In the case where the TfD results in merge/delete for some but not for others (because different crowds of editors) there is nothing to prevent the recreation of those templates that were merged/deleted unless we salt those templates. What a headache. For me, I would rather the proposal be accepted or rejected as a whole, {{langx}} will still be here regardless of the outcome (unless someone does a successful reverse TfD to replace/delete {{langx}}).
I can see that it might be necessary to have something to offer so that the enacting of an affirmative would be done in stages rather than as one giant bot run to replace all {{lang-??}} templates. But, that need not be offered from the outset but withheld until needed. But this option is different from Editor Jonesey95's option.
Trappist the monk (talk) 22:06, 26 September 2024 (UTC)
Go for it. I will support either direction. – Jonesey95 (talk) 22:13, 26 September 2024 (UTC)
I also prefer, in this case, a complete nomination. Gonnym (talk) 22:19, 26 September 2024 (UTC)
You didn't answer my Reworked some. Better? Worse? Still too...? question...
Trappist the monk (talk) 23:05, 26 September 2024 (UTC)
I said I think it looks good like that. It explains what we are doing and why and then lets editors who want read into it more. Gonnym (talk) 08:13, 27 September 2024 (UTC)
@Trappist the monk can you look at the /doc? I'm not sure |code= is correct for this template. Not sure about if the others are also still relevant. Gonnym (talk) 23:13, 29 September 2024 (UTC)
|1= and |code= should not be listed separately; they are the same thing in {{langx}}. If both are supplied, |1= wins. |code= is not set by the template (that is only for {{lang-??}}). If |code= is used, then the positional parameters for text (and transliteration and translation if needed) must use their named parameters |text=, |translit=, and |translation= or their explicitly stated numerical aliases |2=, |3=, |4=.
Trappist the monk (talk) 00:21, 30 September 2024 (UTC)

Break

I've came across Template:Lang-az-Cyrl and Template:Lang-lmo-IT that aren't in Category:Lang-x templates (not sure why) and aren't in the TfD nomination. Should they be? --Gonnym (talk) 09:05, 30 September 2024 (UTC)

{{Lang-az-Cyrl}} is one of a couple of dozen that escaped the search. I will add them as an addendum this morning. {{Lang-lmo-IT}} is a wrapper around {{Language with name}} for the Bergamasque dialect of Lombard so not a 'language' per se. Not currently supported by Module:Lang except by the tag lmo-IT which the module knows as Lombard ({{Language with name}} uses {{lang}} for html compliance).
Trappist the monk (talk) 11:38, 30 September 2024 (UTC)
Looking at Template:Lang-bcs, it links (via a MoS invalid redirect) to Serbo-Croatian. That has the code of "hbs". Shouldn't that template also be part of the regular list then? Gonnym (talk) 14:39, 3 October 2024 (UTC)
bcs is the IANA language tag for Kohumono; a Nigerian language so nothing to do with Serbo-Croatian. {{lang-bcs}} uses a custom label and is a wrapper template. The initial list and the addenda are only supposed to list those templates that directly invoke Module:lang because those templates comprise the vast majority of {{lang-??}} templates. After we dispose of those templates, what remains can be dealt with case-by-case.
Trappist the monk (talk) 15:07, 3 October 2024 (UTC)
Ah ok, I didn't even check if bcs was an actual code for something else. How am I not surprised. Gonnym (talk) 15:21, 3 October 2024 (UTC)
I've converted Template:Lang-lmo-cr to use the standard style and it seems to be working correctly. That can also be added to the list. Gonnym (talk) 14:47, 3 October 2024 (UTC)
Ah, the dialect isn't recognized and needs a manual label, so doesn't fit. Gonnym (talk) 14:51, 3 October 2024 (UTC)
I have created Category:Pages using Lang-xx templates to collect pages from all namespaces that use a {{lang-??}} template that calls one of the module functions lang_xx_inherit() or lang_xx_italic(). This category can be used as a resource for a bot when (if) the TfD closes in the affirmative. A category is better than a cirrus search which, for the {{lang-??}} templates, times out.
Trappist the monk (talk) 14:01, 5 October 2024 (UTC)
Nice work. The category will also catch all sorts of edge case formatting of template parameters that searches (or searchers) have a difficult time finding. A note: if categories are working as they have historically, this category may take days or weeks to fill up. Expect to be dealing with stragglers for a while. Individual templates can and should always be checked via "What links here" before they are deleted. – Jonesey95 (talk) 16:25, 5 October 2024 (UTC)
Which is why I created the category now, before the TfD is done and before I take Monkbot 20 to WP:BRFA. Of course this all assumes that the TfD closes in the affirmative.
Trappist the monk (talk) 18:55, 5 October 2024 (UTC)
WP:BRFA filed: Wikipedia:Bots/Requests for approval § Monkbot 20
Trappist the monk (talk) 14:46, 7 October 2024 (UTC)
I have tweaked Module:Lang and Module:Lang/langx to emit a category link whenever {{langx}} has one of the language tags from a template listed at Wikipedia:Templates for discussion/Log/2024 September 27/lang-?? templates § excluded templates. See Category:Langx uses unsupported language tag. The purpose of this is to help (over?) enthusiastic editors to not convert the excluded templates and for the rest of us to know where to look. Pages in that category are sorted by language tag.
Trappist the monk (talk) 15:45, 13 October 2024 (UTC)
Good idea. I wish the BRFA would have already been given a trial so your bot could do have already handled the replacement. Gonnym (talk) 15:53, 13 October 2024 (UTC)
Even had it been through BRFA, there isn't a chance that it could have got through the 13,785 pages in Category:Pages using Lang-xx templates. I have been manually editing thousands of pages using the bot's code and have hardly made a dent. I think that I have fixed all of the category and file namespace pages and (so far) managed to keep the total count to just below 600,000 ... the category is still being populated.
Trappist the monk (talk) 16:12, 13 October 2024 (UTC)
I've restored the usages of lang-ka in the category. I think the category is catching false positives. Your edit here seems to be correct as {{Lang-sh}} is tagged, but maybe the code is catching {{Lang-sh-Cyrl-Latn}} or one of the others. Gonnym (talk) 08:40, 14 October 2024 (UTC)
Fixed. {{lang-sh}} sets |script=Latn which, in the module, gets appended to the language subtag shsh-Latn. {{lang-sh-Latn}} does the same. When it came time to test the language tag against the list of unsupported language tags, both {{lang-sh}} and {{lang-sh-Latn}} triggered the category. Fixed by testing the unmodified language tag, sh, against the list of unsupported language tags. This should be adequate because most editors who are tweaking {{lang-??}} to {{langx}} won't change the ?? portion of the template.
Trappist the monk (talk) 14:00, 14 October 2024 (UTC)

Moldovan Cyrillic

An editor moved {{Lang-mo-Cyrl}} to {{Moldovan Cyrillic}}, which broke the documentation nicely. Many of the transclusions were replaced with the new name. It may need some special attention during the migration. – Jonesey95 (talk) 14:23, 9 October 2024 (UTC)

That template is excluded from the TfD because it uses a custom label.
Trappist the monk (talk) 14:29, 9 October 2024 (UTC)