Template talk:Lang

Foreign-language article titles
31 August 2021 (UTC)

Forced prefixing of *
I've just noticed that use of codes for protolanguages, as in, forces a prepended * (indicating a construction unattested in surviving materials). This is undesirable, since in the vast majority of cases what we're going to be doing is replacing existing in-article strings with bare italics and no lang markup, like, with templated replacements, e.g.  , but this produces a double ** which has to be manually fixed. And there are apt to be tabular-data cases (interlinear glosses, etc.) in which an entire row of cells is prefixed with * and specific words or morphemes in particular cells follow this and should not each individually have * but should still have language markup. At bare minimum we need a way to suppress this "auto-*" behavior, but ideally it would be off by default and turned on only by a parameter switch, since it is unexpected, inconsistent, completely undocumented, and almost always editorially unhelpful. PS: If this does get changed, please ping me, since I will need to go fix Caledonians and some other things to have non-templated * again. — SMcCandlish ☏ ¢ 😼  07:35, 2 March 2024 (UTC)
 * Two thoughts: there is some value to the asterisk symbol as unattested (especially if we tooltip the first occurrence à la c.), so could we use asterisk, or perhaps (new) unattested and have that resolve to asterisk? Alternatively, what about just using one of the many star-shaped thingies that look like asterisk, but aren't, e.g.,
 * ❋ (U+274B HEAVY EIGHT TEARDROP-SPOKED PROPELLER ASTERISK) (my favorite, but several more hidden in the wikicode).
 * Thanks, Mathglot (talk) 11:17, 2 March 2024 (UTC)
 * Using an alternative character would be WP making up a "fake style" out of nowhere. The standard across all linguistics writing since at least the Victorian era is the * symbol (asterisk).  — SMcCandlish ☏ ¢ 😼  05:07, 10 June 2024 (UTC)
 * Already exists but, alas, not documented:
 * → kal-
 * → kal-
 * → kal-
 * → kal-
 * —Trappist the monk (talk) 15:02, 2 March 2024 (UTC)

Testing bullet-asterisk interaction with proto asterisk: Looks good. We should document Module code starting at line 791 of the Module in a new, level-4 subsection 'Proto' at Template:Lang, probably to live under section. Mathglot (talk) 20:05, 2 March 2024 (UTC)
 * one asterisk, to make a bullet item
 * kal- one asterisk, followed immediately by
 * one asterisk to make another bullet item
 * But wait—you said in sentence 2, but this produces a double ** which has to be manually fixed, so what was your example that produced a double asterisk? It seems to be the identical code that works just above. Can you reproduce your error case below? Mathglot (talk) 20:14, 2 March 2024 (UTC)
 * To repeat from the OP: in the vast majority of cases what we're going to be doing is replacing existing in-article strings with bare italics and no lang markup, like, with templated replacements, e.g., but this produces a double ** which has to be manually fixed. If the solution is changing   to   or to  , I guess I can live with that, but I still think it would be preferable for the template to not force the * by default.  — SMcCandlish ☏ ¢ 😼  05:07, 10 June 2024 (UTC)

Code for Anatolian languages
I need a private-use language tag for Anatolian languages. Antiquistik (talk) 20:32, 6 April 2024 (UTC)
 * Propose one. You know the rules for making a private-use tag.
 * —Trappist the monk (talk) 21:45, 6 April 2024 (UTC)
 * Does  work? Or is it already assigned? Antiquistik (talk) 21:51, 6 April 2024 (UTC)
 * and the rest of it?
 * —Trappist the monk (talk) 22:01, 6 April 2024 (UTC)
 * I have no idea. I will need your help for that. Antiquistik (talk) 00:00, 7 April 2024 (UTC)
 * I'm just the coder. Perhaps you can consult with WP:Languages or WP:Linguistics or some other such wikiproject.
 * —Trappist the monk (talk) 00:07, 7 April 2024 (UTC)
 * Would  work? Antiquistik (talk) 17:59, 15 April 2024 (UTC)
 * → text
 * —Trappist the monk (talk) 18:20, 15 April 2024 (UTC)
 * Thanks! Antiquistik (talk) 19:00, 15 April 2024 (UTC)

Changes
Has something changed with this? I don't know the ins and outs of the module/template but the way it displays at 2022 Comhairle nan Eilean Siar election has changed and I'm not sure what I'd need to alter so it displays correctly. Stevie fae Scotland (talk) 13:35, 11 April 2024 (UTC)
 * Nothing has changed in the module. Here is the history of that template in 2022 Comhairle nan Eilean Siar election:
 * at this edit, you added the template
 * at this edit, using AWB, I changed it to
 * at this edit, I changed it to
 * at this edit, Editor Pedia9jb6l changed it to
 * On 10 April 2024, this edit by Editor PK2 changed from a redirect to  to a  template.  That change broke the template on 2022 Comhairle nan Eilean Siar election.  The editor did not explain why that change was made.  Special:WhatLinksHere/Template:Lang-for indicates that there may be more articles that were broken by this edit.
 * I have reverted the edit at.
 * —Trappist the monk (talk) 15:14, 11 April 2024 (UTC)
 * Thanks very much for looking into this and for fixing it. Stevie fae Scotland (talk) 09:00, 12 April 2024 (UTC)
 * Thanks very much for looking into this and for fixing it. Stevie fae Scotland (talk) 09:00, 12 April 2024 (UTC)

Create and other relevant templates for Interslavic
Interslavic has recently received an ISO 639-3 code: isv. Latin and Cyrillic are equal in status in Interslavic, just like in Serbo-Croatian. –Vipz (talk) 09:34, 27 April 2024 (UTC)
 * not listed in the current (2024-03-07) version of the IANA language-subtag-registry file so nothing to be done yet.
 * —Trappist the monk (talk) 11:42, 27 April 2024 (UTC)
 * It is now. "Added: 2024-05-15" -- --Error (talk) 11:43, 22 May 2024 (UTC)

Quoting multiple alternative translations
How does one correctly quote multiple translations using this template? I am trying to fix an issue on German Air Force, which includes in its lede the problematic lang-de template

Luftwaffe

from the source code

Luftwaffe

which is not quoted correctly. I can fix this by doing

Luftwaffe

leading to

Luftwaffe

but this is a rather inelegant hack. Is there a better way to quote multiple lit values?

I have searched the talk archives here but couldn't find anything if this had been asked before. Thanks, Ainlina(box)? 15:30, 29 April 2024 (UTC)
 * In context, it would seem to me that air force is a better choice for the lead. If you wish to delve into the etymology of the word, perhaps a footnote linking the Wiktionary German entry for Luftwaffe is appropriate.
 * Recently, there has been discussion at that you might find interesting.
 * —Trappist the monk (talk) 15:51, 29 April 2024 (UTC)
 * Thanks for the info, unfortunately I have very little subject matter knowledge, and was just browsing and encountered some bad formatting. Is there a correct way to do this if two translations are both needed due to ambiguity? Thanks, Ainlina(box)? 17:05, 29 April 2024 (UTC)
 * Thanks for the info, unfortunately I have very little subject matter knowledge, and was just browsing and encountered some bad formatting. Is there a correct way to do this if two translations are both needed due to ambiguity? Thanks, Ainlina(box)? 17:05, 29 April 2024 (UTC)

Question about Category:Articles containing Dogrib-language text
For some reason, Category:Articles containing Dogrib-language text has started showing an error message, is empty, and has been tagged for speedy deletion. We still have an article at Dogrib language, and the ISO 639 code is still dgr. It appears that articles that should be placed into that category are now being placed into the new (as of 22 May 2024) Category:Articles containing Tlicho-language text. I don't know what happened behind the scenes (maybe this change?), but we have an inconsistency between our article name and our category naming, which is undesirable. – Jonesey95 (talk) 23:41, 27 May 2024 (UTC)
 * The 2024-04-15 update to the ISO 639-3  name list is the result of this change request.  That update is reflected in this update to Module:Language/data/ISO 639-3.  Subsequently, IANA incorporated that change (in reverse name-order in the 2024-05-16 update to their language-subtag-registry file which is reflected in this update to Module:Language/data/iana languages.
 * When multiple names are provided by IANA, Module:Lang takes the first name in the list – in this case 'Tlicho'. This may be overridden in Module:Lang/data when there is consensus to do so.
 * —Trappist the monk (talk) 18:01, 28 May 2024 (UTC)
 * I believe that the stable title (for the last eight years or so) of our Dogrib language article constitutes sufficient consensus to override. I poked around the sources, and they seem to be split somewhat evenly among "Dogrib", "Tlicho", and "Tłı̨chǫ Yatıì", the latter of which would be a challenging article name for the English Wikipedia. If the article is moved, the override can easily be removed. – Jonesey95 (talk) 00:27, 29 May 2024 (UTC)
 * I believe that the stable title (for the last eight years or so) of our Dogrib language article constitutes sufficient consensus to override. I poked around the sources, and they seem to be split somewhat evenly among "Dogrib", "Tlicho", and "Tłı̨chǫ Yatıì", the latter of which would be a challenging article name for the English Wikipedia. If the article is moved, the override can easily be removed. – Jonesey95 (talk) 00:27, 29 May 2024 (UTC)

Limitations possibly requiring template modification
Given that I edit ancient history articles, I have to use this template extensively for a large range of languages, and I'm finding some lacks in it that limit my ability to edit:
 * 1) the  form of the template should also display a label for the name of the language used similar to when using the   form;
 * 2) the  form needs a   option that works just like it does with the   form;
 * 3) the  needs an option where there is a comma instead of the romanized: label usually preceding the transcription in addition to the already existing format with the romanized: label;
 * 4) there needs to be an option for adding multiple spellings and multiple transliterations; for example:
 * 5) the name Tuwaddis was recorded as 𔕬𔗬𔑣𔓯𔗔 and 𔕬𔓬𔑣𔕣, and presenting them in an article currently requires me to write
 * the code
 * to obtain and 𔕬𔓬𔑣𔕣, romanized Tuwaddis;
 * 1) similarly, if I want to make a list of the various forms of the Hieroglyphic Luwian name Ḫartapus in an article, I would need to write it
 * as
 * to obtain, 𔓟‎𔖱𔐞𔗣𔗔‎ and 𔗖‎𔐞𔕯𔗔, romanized: Ḫartapus;
 * 1) meanwhile, the name 𒁹𒌇𒁮𒈨𒄿 is interpreted as either Tugdammî and Dugdammî, and presenting them in an article currently requires me to write
 * the code
 * to obtain or Dugdammî;
 * 1) and the name 𒁹𒄖𒊌𒄖 is interpreted as both Gugu and Guggu, but presenting it in an article would require that I write
 * the code
 * to obtain and Guggu
 * 1) if I need to make a list of the various spellings of the name māt Tabali, for example, I need to write
 * the code
 * to obtain māt Tabali (𒆳𒋫𒁀𒇷, 𒆳𒋫𒁀𒀀𒇷, 𒆳𒋫𒁄𒇷, 𒆳𒋰𒀀𒇷);
 * 1) and if I want to make a list of the various forms of the name Qedar, I need to write
 * the code, Qidri; 𒆳𒆤𒊏𒀀𒀀, Qidrāya; 𒆳𒆥𒁕𒀀𒊑, Qidāri; 𒆳𒋡𒁕𒊑, Qadari; 𒆳𒋡𒀜𒊑, Qadri; 𒇽𒆤𒊏𒀀𒀀, Qidrāya; 𒇽𒆥𒁯𒊏𒀀𒀀, Qidarāya; 𒌷𒆥𒁕𒊑, Qidari; and 𒇽𒄣𒁕𒊑, Qudari
 * 1) I would also require a transcription parameter because some scripts are not transcribed in the exact same was as their reconstructed pronunciation, and this sometimes needs to be shown in the text.
 * 2) For example, Mycenaean Greek kʰalkós was written as 𐀏𐀒 in Linear B script, which is transcribed as ka-ko, but the template as it now exists only allows me to add the Linear B text and the word as it was pronounced, but not the transcription of the text;
 * 3) Integrating the functions of  into the   template would also be useful because sometimes the coding takes too much space in the article or using it makes the article unnecessarily big so that it would be preferable to shift this onto the templates instead.
 * 4) For example,  and   should have a parameter that functions in the same way as if   and   were used.
 * 5) Some scripts, like cuneiform, however use multiple variants due to how widespread and long-lived their use was, and, if creating such a parameter is possible, it would need to be able to render the various fonts used in Template:Script/Cuneiform.
 * 6) This parameter should be optional, however, because some of the script templates, like  and   render the text in a font that is difficult to read and are therefore already discouraged.
 * 7) There also needs an option where interting  in the text parameter followed by the transliteration in the template displays the language followed by the transliteration.
 * 8) For example,  should give something that displays like Sanskrit: bharu.

Would it be feasible to modify the template so as to remove any or some or even all of these current limitations? Antiquistik (talk) 15:01, 28 May 2024 (UTC)


 * can any of these issues be resolved? Antiquistik (talk) 08:13, 3 June 2024 (UTC)
 * I numbered your list to make it easier to answer.
 * 1. because already has a wikilinked language label, using the   html attribute is considered redundant or superfluous
 * 2. might be done but probably not necessary because exists to serve that purpose
 * 3. see 4
 * 4. if you do a lot of these custom lists, you might be better served to create one or more templates to do the grunt work
 * 5. a new template, might be created; you will need to work out details of its implementation
 * 6. nesting templates in may take more space, but space in a Wikipedia article is not an issue; this is not a dead tree encyclopedia
 * 7. templates might be created; you will need to work out the implementation details
 * In general, Module:Lang works well for the vast majority of its uses; mucking about with that for a small number of articles seems to me to be counterproductive.
 * —Trappist the monk (talk) 14:22, 3 June 2024 (UTC)
 * For #6, I've faced problems with pages I rewrote becoming too big per WP:TOOBIG before, so space is unfortunately an issue.
 * For #2, editing using both and   for this purpose is too cumbersome and unwieldy. Adding a   parameter to   would be the best option.
 * For #3, I am not sure I understand how #4 relates to this issue. You might need to spell it out for me.
 * For #4, yes, a separate template for lists would be ideal. It should work like Wiktionary's  template, minus creating a link for the term. However, the options for the first four sub-issues should be integrated into  /.
 * For #5, an additional transcript template would definitely be a very useful addition. However, I also have no choice in needing the transcription option to be part of as well. There are articles in some scripts that really do need a Name in script, followed by a transliteration, followed by a transcription, option. This is especially important because the present   parameter is presently used for transcription instead than transliteration but otherwise still require both transcription and transliterations, including in articles that are not part of the topics that I cover.
 * For #7, what would be ideal would be both a  template and the option to insert a nil parameter in the present template as well.
 * As for #1, well, I can do without it for now. But I would still support adding a label if the question arises again in the future. In my (personal) opinion, the label in fact makes it more easily to read the pages.
 * Additionally, could you modify the private-use tag  to render as "Late Babylonian Akkadian" rather than simply as "Late Babylonian" as it now does?
 * Antiquistik (talk) 19:31, 7 June 2024 (UTC)
 * Can you have a look at my response and see what can be done please? Antiquistik (talk) 06:26, 25 June 2024 (UTC)

Mild performance improvement
I have been looking at Kashmiri language and wondering why it takes a long time to build the page.

In the timing stats on the page, the lua function gcodepoint_init is high on the list. Looking at the wikitext of the page, templates of the form &#123;&#123;#invoke:lang|lang|ks|&#123;&#123;uninastaliq... (of which there are over 900) are responsible for this timing. For each of these calls, gcodepoint_init is called three times.

The call to gcodepoint_init actually comes from Module:Unicode_data is_Latin

Now to the point, Module:Lang calls is_Latin from line 988 and is_rtl (which calls is_Latin) from lines 549 and 551.

The call to is_rtl could be made once and then used in the two succeeding if statements - hence saving a call Desb42 (talk) 08:16, 7 June 2024 (UTC)

Renaming a template per ISO 639 changes?
At Template talk:Lang-sh, we've had a question whether to use "sh" or "hbs" as the template name/code. Is this a doable change, is there something to think about? The first thing that occurs to me is that the TFD notice would clutter a lot of lead sections... --Joy (talk) 15:05, 8 June 2024 (UTC)


 * Anything is possible. What is the end goal? Change instances that use Lang-sh to Lang-hbs or just switch between the current template and the "hbs" redirect? If the first and there is consensus on the page, a bot operator could help with the 800s transclusions, if just rename, then anyone that can rename pages can do that or WP:RM/T. Also a small edit to the template to change the code parameter. Gonnym (talk) 15:16, 8 June 2024 (UTC)
 * So if I get this right, you wouldn't use a TFD tagging procedure? --Joy (talk) 19:15, 8 June 2024 (UTC)
 * sh is the IETF BCP 47 language subtag utilized for Serbo-Croatian, and these are the basis for Wikipedia's lang templates and by extent subdomains (which is the reason sh.wikipedia.org does not need to move to hbs.wikipedia.org). –Vipz (talk) 16:37, 8 June 2024 (UTC)
 * @Vipz well, that's actually making things a tad more confusing because there it says for "sh":
 * Registry comment: sr, hr, bs are preferred for most modern uses
 * sh is a macrolanguage that encompasses the following more specific primary language subtags: bs hr sr cnr. If it doesn't break legacy usage for your application, you should use one of these more specific language subtags instead. On the other hand, sh is often preferred by legacy applications rather than sr (Serbian).
 * We're not just using it for legacy applications. --Joy (talk) 19:14, 8 June 2024 (UTC)
 * Interestingly, that quoted material doesn't mention "hbs".  — SMcCandlish ☏ ¢ 😼  04:38, 10 June 2024 (UTC)

Side question on Proto-[Foo]
Why are we at en.wp using, e.g., gem-x-proto while en.wikt is using gem-pro? Is one site or other making a grave mistake? — SMcCandlish ☏ ¢ 😼  04:39, 10 June 2024 (UTC)

Early Modern English?
Not sure of the process here, but is it possible to make the template accept Early Modern English as a language? There are some long quotations on Elinor Fettiplace which, while definitely not in Middle English, must be extremely confusing to a screen reader. ISO 639-6 proposed emen as a code for it, but as I gather was not accepted. UndercoverClassicist T·C 08:40, 22 June 2024 (UTC)
 * → text
 * → text
 * —Trappist the monk (talk) 11:39, 22 June 2024 (UTC)
 * Wonderful: thank you! UndercoverClassicist T·C 15:11, 22 June 2024 (UTC)

lang-xx missing tooltip?
Didn't lang-xx use to add a tooltip, the same as lang, or am I mistaken? For example: — W.andrea (talk) 00:01, 3 July 2024 (UTC)
 * tooltip: French-language text
 * no tooltip
 * Perhaps for a short time. In the olden days before Module:Lang,  called  which called .  This wikitext form did not have a tooltip.  During the transition to Module:Lang,  was the first to be converted.  The new  has a tooltip.  Before  was converted to directly call Module:Lang, it continued to call the new  so did have a tooltip.  When  was converted to directly call Module:Lang, the tooltip went away because it is redundant to the language label link that precedes the French language text.
 * If you have the redundant tooltip, you can use :
 * → – has a tooltip because this template calls.
 * —Trappist the monk (talk) 01:03, 3 July 2024 (UTC)
 * Oh, of course! I don't know how I didn't realize that. Thanks! — W.andrea (talk) 01:10, 3 July 2024 (UTC)
 * Oh, of course! I don't know how I didn't realize that. Thanks! — W.andrea (talk) 01:10, 3 July 2024 (UTC)
 * Oh, of course! I don't know how I didn't realize that. Thanks! — W.andrea (talk) 01:10, 3 July 2024 (UTC)