Template talk:Lang/Archive 8

cat=n, and related
Would be nice if no and other negative values worked the same as y and other positive values, so people don't have to try to remember which one this template uses. — SMcCandlish ☏ ¢ 😼  17:20, 1 July 2018 (UTC)
 * Contrary to the template documentation, any value assigned to nocat inhibits categorization. This is a bug that should be fixed (the pre-Lua version used  which accepts 'yes', 'y', 'true', 't', 'on', and '1' as affirmative values).  Adding cat which accepts the opposite values can be done at the same time.
 * —Trappist the monk (talk) 12:27, 2 July 2018 (UTC)
 * Module:Yesno interprets values in the way that you describe. I've come up with a way to add cat and check that, if cat and nocat have boolean values, they don't contradict each other. (For instance, the combination of yes and true will trigger an error, but blahblah and hahaha will not, because they are not boolean.) But probably I'm not throwing an error in the correct way. — Eru·tuon 18:46, 2 July 2018 (UTC)
 * I've tweaked your code and, I think, made it less confusing. To do that I decided that nocat should only accept affirmative values ('yes', 'y', 'true', etc) and that cat should only accept negative values ('no', 'n', 'false', etc).  By doing that, there is no error message because there cannot be acceptable contradictory values (y and y treated same as y and dog).  Examples in the collapse box; to get the examples to display here (outside of mainspace), I have forced.


 * 1) * – categorized
 * 2) * – categorized
 * 3) * – not categorized
 * 4) * – categorized
 * 5) * – not categorized
 * 6) * – categorized
 * 7) * – categorized
 * 8) * – not categorized
 * 9) * – not categorized
 * 10) * – not categorized
 * 11) * – not categorized
 * 12) * – categorized
 * 13) * – categorized
 * 14) * – not categorized
 * 15) * – categorized
 * 16) * – categorized
 * 17) * – not categorized
 * 1) * – not categorized
 * 2) * – not categorized
 * 3) * – not categorized
 * 4) * – categorized
 * 5) * – categorized
 * 6) * – not categorized
 * 7) * – categorized
 * 8) * – categorized
 * 9) * – not categorized
 * 1) * – not categorized
 * 2) * – categorized
 * 3) * – categorized
 * 4) * – not categorized
 * 1) * – categorized
 * 2) * – not categorized
 * 1) * – not categorized
 * 1) * – not categorized


 * —Trappist the monk (talk) 00:07, 3 July 2018 (UTC)
 * I think it's less confusing to be completely logical and respond to both true and false values for both parameters – though the only change that entails is a warning if the parameters conflict; either way false and true don't change the default behavior. — Eru·tuon 02:40, 3 July 2018 (UTC)

What about , etc.? Is one parameter going to override another universally, or just by which ever one is last? — SMcCandlish ☏ ¢ 😼  01:43, 3 July 2018 (UTC)
 * Huh. There's no contradiction in : either no or yes would turn off categorization. So neither can override the other. — Eru·tuon 19:39, 6 July 2018 (UTC)
 * D'oh! I fixed it.  — SMcCandlish ☏ ¢ 😼  20:19, 6 July 2018 (UTC)
 * Same as example #9 above. Because categorization is the default, yes is ignored (always) so yes controls.  Example 11 is the opposite case: no is ignored (always) so no controls.
 * —Trappist the monk (talk) 20:44, 6 July 2018 (UTC)

Alternative categorization ideas
— SMcCandlish ☏ ¢ 😼  23:22, 1 July 2018 (UTC)
 * Also, it's tedious and error prone to have to figure out and remember under what circumstances y must be added (e.g., when it's used inside a link, an image caption, and various other cases). It's a pain in the butt, and not getting it perfect often breaks display, in-article, which is "reader-hateful". Sometimes it's quite unpredictable. E.g., when I applied it to père (without y) at Template:Alexandre Dumas, it rendered fine in the template, but dumped exposed wikimarkup when transcluded at Alexandre Dumas.  Given our new-ish section transclusion system, we now have no way of knowing what will be transcluded where, so this would seem to indicate that the only safe choice is to y every single instance. My first thought on a solution: I note that collapsible navboxes have a way to detect the presence of more of them on the same page and auto-collapse when several are present. I would think that the same technique could be used to detect whether a category has already been applied or at least whether the same template is already in use on the page (i.e. the page is already categorized). That might not be the way to do it, since first occurrence on the page might be nocat 'ed. An alternative, and the proposal I'm leaning toward, is to either remove the categorization code or turn it off by default, and instead have a trawling bot manually add the category, once, to the article on the basis of the presence of the template there (e.g. if it contains both French and Spanish, add the category for each, one time each, into the rest of the categories at the bottom.  This would actually be much more efficient anyway, since parser wouldn't have to deal with the same category code being dumped out 100 times for an article that uses ... 100 times in it. This would be more accurate categorization anyway: if the only occurrence of such markup on a page is one requiring y then the article will not be correctly categorized, and this would not happen under the bot-catting method.
 * Another idea: a template that uses Lua to retrieve and search the article text for language codes in language-tagging templates ( and  ) and adds the appropriate categories. Searching the article text seems to be an inexpensive operation even with a fairly large article such as English language: my experimental module function returns  . — Eru·tuon 23:54, 1 July 2018 (UTC)
 * only categorizes when used in article space; never categorizes anywhere else (this has been true since about April 2009).
 * I'm not convinced that this is a problem that a solution.Navbox auto-collapse is handled by javascript in MediaWiki:Common.js which runs on your browser when you load a page from the Wikipedia servers – long time after the  code has run.  The bot 'solution' will work as long as there is someone around to write it, run it, and maintain it.  The Lua code version of  is much more efficient than the wikitext version ever was.  The Lua version does not require the use of   (an expensive parser function).  I suspect that 'efficiency' gains obtained by limiting the number category links will be minimal.  To test that notion, I created a page that contained 5000 of these and nothing else:
 * Then I previewed the page. Here is the parser profiling data for that preview
 * I'm not convinced that this is a problem that a solution.Navbox auto-collapse is handled by javascript in MediaWiki:Common.js which runs on your browser when you load a page from the Wikipedia servers – long time after the  code has run.  The bot 'solution' will work as long as there is someone around to write it, run it, and maintain it.  The Lua code version of  is much more efficient than the wikitext version ever was.  The Lua version does not require the use of   (an expensive parser function).  I suspect that 'efficiency' gains obtained by limiting the number category links will be minimal.  To test that notion, I created a page that contained 5000 of these and nothing else:
 * Then I previewed the page. Here is the parser profiling data for that preview
 * Then I previewed the page. Here is the parser profiling data for that preview

CPU time usage	7.620 seconds Real time usage	7.874 seconds Preprocessor visited node count	45,001/1,000,000 Preprocessor generated node count	0/1,500,000 Post-expand include size	1,160,000/2,097,152 bytes Template argument size	0/2,097,152 bytes Highest expansion depth	2/40 Expensive parser function count	0/500 Unstrip recursion depth	0/20 Unstrip post-expand size	0/5,000,000 bytes Number of Wikibase entities loaded	0/400 Lua time usage	4.963/10.000 seconds Lua memory usage	16.09 MB/50 MB
 * A second test, this time with all 5000 templates set to y:

CPU time usage	6.676 seconds Real time usage	6.696 seconds Preprocessor visited node count	45,001/1,000,000 Preprocessor generated node count	0/1,500,000 Post-expand include size	630,000/2,097,152 bytes Template argument size	0/2,097,152 bytes Highest expansion depth	2/40 Expensive parser function count	0/500 Unstrip recursion depth	0/20 Unstrip post-expand size	0/5,000,000 bytes Number of Wikibase entities loaded	0/400 Lua time usage	4.623/10.000 seconds Lua memory usage	16.09 MB/50 MB
 * Clearly, for these two tests, the y version required less time:
 * CPU time usage 7.620 vs. 6.676 (1.524mS/template vs. 1.335mS/template)
 * so category handling then accounted for:
 * 1.524mS − 1.335mS = 189μS per template.
 * An alternate form of the Dumas template that renders correctly and supplies correct categorization is:
 * —Trappist the monk (talk) 12:27, 2 July 2018 (UTC)
 * Okay, so forget the parser efficiency argument. I still think it'd be better to do this via bot, if someone's willing, so no one ever has to try to remember these complicated syntax and nesting tricks.  — SMcCandlish ☏ ¢ 😼  01:46, 3 July 2018 (UTC)
 * A far-fetched possibility occurred to me while editing Czech phonology. Background: uses, and I discovered that categorization has to be turned off because the language-tagged text is inside the link to the audio file. So if all text in a given language on a given page is in , not in , then the category for that language will not be added. Adding the categories by bot or some other way not involving  would avoid this. But it's unlikely that all snippets of text in a given language will have sound files. (Russian phonology has an unusually large number of soundfiles, but even it doesn't achieve universal coverage.) — Eru·tuon 23:21, 8 July 2018 (UTC)
 * You might turn it around so that wraps  like this:
 * mimicked here with this (sandbox version of lang because, for the time being, it allows categorization outside of mainspace):
 * But, if you want 's help text and links, that's problematic:
 * A tweak to will fix that.  Change:
 * to:
 * Which renders like this:
 *    Loudspeaker.svg zakladatel ( help · info )  
 * —Trappist the monk (talk) 07:58, 9 July 2018 (UTC)
 * I guess putting inside  can  okay if the language doesn't use a noticeably different font, or if the font properties are overrided, but the HTML output would be bad, because   would be tagged as something other than English. It's only a cosmetic fix to override the italicization of , and a complete cosmetic fix would require overriding the font-family property as well, to fix cases where the language is assigned different fonts (like maybe Urdu, which uses Nastaliq: I think some Nastaliq fonts have "fantasy" type Latin glyphs). But it's best not to use inline CSS to hide semantic problems (text being tagged as the wrong language), because font isn't the only purpose of language tagging. A better way to fix categorization in  would be to go back to something like the initial version, which didn't use  at all and placed the link to the audio file inside . — Eru·tuon 16:24, 9 July 2018 (UTC)
 * Of course. Writing from scratch is preferable.  But, you seem determined to blame  for these categorization problems when the problems are interaction problems.  Unless the interacting templates were specifically designed to operate together harmoniously, you should expect that templates of any complexity will likely have interaction problems.  It is not the fault of the templates when they don't all play well with each other.
 * —Trappist the monk (talk) 17:06, 9 July 2018 (UTC)
 * I think it's not just preferable, but essential, to avoid tagging text with the wrong language. But you're right that this is an interaction problem, and the example I chose is not a very good one because there's a way to solve it.
 * I guess the broader issue is that, with the current behavior of, when categorization is turned off in one instance of , a category will only be added if there's another instance of (or a  template) with the same language. So maybe there will be pages on which a category for a language isn't added. Or maybe not. I wonder how to determine that. — Eru·tuon 17:43, 9 July 2018 (UTC)
 * the current behavior of First attempts to figure out categorization based on language codes occurred with  in August 2008.  It took a while but category handling in  pretty much settled into is final wikitext form with  in September 2013 though I think that that edit could have been made earlier (perhaps as early as  in May 2012.  The 'current' categorization behavior has been a long time in the making.  We did not simply dream it up when we converted to Module:lang.
 * —Trappist the monk (talk) 18:18, 9 July 2018 (UTC)
 * Okay. I know the template added categories before you Lua-ified it. I don't mean to blame you for this potential issue, if that's the impression you're getting. — Eru·tuon 18:31, 9 July 2018 (UTC)
 * I don't see you blaming me. Rather, I see you blaming  (I said that above) because it doesn't (and as far as I can tell), was never intended to, always coexist with whatever templates and wiki markup with which editors choose to mate it (I suspect that it is just not possible without MediaWiki grants templates the ability to see beyond their bounding brackets – don't hold your breath for that).
 * —Trappist the monk (talk) 18:48, 9 July 2018 (UTC)
 * Okay.... I am not sure how your point relates to the potential issue I brought up. Are you saying that there are cases in which is not meant to be used, and that in those cases some other method should be used to add language-tagging and categories? — Eru·tuon 19:31, 9 July 2018 (UTC)
 * No, I'm saying that there are markup conditions where will never work and still provide all of its intended output.  For example, stuff like including  inside a wikilink will cause the wikilink to fail because of categorization:
 * – sandbox used here because at present it categorizes outside of mainspace
 * house
 * – turn off categorization
 * house
 * Editors have blamed for this, assuming that somehow the template is at fault.  It is not; wiki markup does no allow nested wikilinks be they normal links or category links:
 * Template talk:Lang
 * [[house]]
 * —Trappist the monk (talk) 20:02, 9 July 2018 (UTC)
 * Okay, but I already understand this. — Eru·tuon 20:34, 9 July 2018 (UTC)
 * If you already knew this then why are you blaming for 'breaking'  and blaming  when it becomes necessary to turn-off categorization so that adjacent markup works?  For the vast majority of  usage, there is no problem, and when there is, there is often a solution by rewriting or alternately configuring the markup or template settings, yet you appear to believe that radical categorization-ectomy is the solution to problems that really are not the fault of  but limitations of the environment in which it is used.
 * —Trappist the monk (talk) 12:32, 10 July 2018 (UTC)
 * Look, I'm interested in whether the category for a given language is always being added when text in that language is present on a page, and in ensuring that it is. If, because categorization in sometimes has to be turned off because of the syntactic issue, the current behavior of  has to be changed (even though, as you've explained, it's existed for about ten years), so be it. But blame in itself is not interesting to me because it does not relate to ensuring that categories are added. If you have a way to ensure categories are added without changing the behavior of  (or if you think that the problem I'm bringing up is far-fetched), then say so. But I'm not interested in discussing the question of blame on its own. — Eru·tuon 17:31, 10 July 2018 (UTC)
 * Cirrus searches are never perfect but they can hint at the magnitude of a 'problem'. This search returns about 450 articles where some template in each article (not necessarily ) has set nocat to something.  That's 450 articles out of 211,295 articles that use  – about 0.02%.  Yet, for the sake of these 450 articles, you would have us remove automatic categorization from the other 210,845 articles and have us invent some new method of categorization; all because you find fault with 's traditional behavior when confronted with certain, apparently rare, markup conditions.  Yeah, I think that this is a mountains and molehills issue.  Were there thousands upon thousands upon thousands of articles that aren't getting categorized because of yes, and were there a common reason for yes among those articles, I would suggest that we might write specialized templates and perhaps supporting modules to take care of those.  For a few hundred?  I don't know.
 * —Trappist the monk (talk) 19:15, 10 July 2018 (UTC)
 * Thank you. A more specific search to only match instances of the parameter in this template yields about 323 results. That doesn't include transclusions of content that has  with categorization turned off, but I wouldn't expect there to be many cases of that. And of these, fewer would have a non-categorizing instance of  and no categorizing instance with the same language. So it's probably a very small issue if it is one at all. That's reassuring. Hm, it would be interesting to make a script that would check for this issue and send up a flare. — Eru·tuon 19:44, 10 July 2018 (UTC)
 * Same here. It's not a matter of the template being bad or Trappist's hard work on it being poor (to the contrary!), but rather the end result of having the template do the categorization impedes editing and causes a lot of errors, many of which are not detected until much later.  — SMcCandlish ☏ ¢ 😼  21:30, 9 July 2018 (UTC)
 * It's sounding more and more like a bot should be doing the categorization (where people don't do it manually), without the templates forcing it. I don't know enough about our bot stuff to be sure how to get this implemented and approved, though.  — SMcCandlish ☏ ¢ 😼  02:40, 9 July 2018 (UTC)
 * —Trappist the monk (talk) 20:02, 9 July 2018 (UTC)
 * Okay, but I already understand this. — Eru·tuon 20:34, 9 July 2018 (UTC)
 * If you already knew this then why are you blaming for 'breaking'  and blaming  when it becomes necessary to turn-off categorization so that adjacent markup works?  For the vast majority of  usage, there is no problem, and when there is, there is often a solution by rewriting or alternately configuring the markup or template settings, yet you appear to believe that radical categorization-ectomy is the solution to problems that really are not the fault of  but limitations of the environment in which it is used.
 * —Trappist the monk (talk) 12:32, 10 July 2018 (UTC)
 * Look, I'm interested in whether the category for a given language is always being added when text in that language is present on a page, and in ensuring that it is. If, because categorization in sometimes has to be turned off because of the syntactic issue, the current behavior of  has to be changed (even though, as you've explained, it's existed for about ten years), so be it. But blame in itself is not interesting to me because it does not relate to ensuring that categories are added. If you have a way to ensure categories are added without changing the behavior of  (or if you think that the problem I'm bringing up is far-fetched), then say so. But I'm not interested in discussing the question of blame on its own. — Eru·tuon 17:31, 10 July 2018 (UTC)
 * Cirrus searches are never perfect but they can hint at the magnitude of a 'problem'. This search returns about 450 articles where some template in each article (not necessarily ) has set nocat to something.  That's 450 articles out of 211,295 articles that use  – about 0.02%.  Yet, for the sake of these 450 articles, you would have us remove automatic categorization from the other 210,845 articles and have us invent some new method of categorization; all because you find fault with 's traditional behavior when confronted with certain, apparently rare, markup conditions.  Yeah, I think that this is a mountains and molehills issue.  Were there thousands upon thousands upon thousands of articles that aren't getting categorized because of yes, and were there a common reason for yes among those articles, I would suggest that we might write specialized templates and perhaps supporting modules to take care of those.  For a few hundred?  I don't know.
 * —Trappist the monk (talk) 19:15, 10 July 2018 (UTC)
 * Thank you. A more specific search to only match instances of the parameter in this template yields about 323 results. That doesn't include transclusions of content that has  with categorization turned off, but I wouldn't expect there to be many cases of that. And of these, fewer would have a non-categorizing instance of  and no categorizing instance with the same language. So it's probably a very small issue if it is one at all. That's reassuring. Hm, it would be interesting to make a script that would check for this issue and send up a flare. — Eru·tuon 19:44, 10 July 2018 (UTC)
 * Same here. It's not a matter of the template being bad or Trappist's hard work on it being poor (to the contrary!), but rather the end result of having the template do the categorization impedes editing and causes a lot of errors, many of which are not detected until much later.  — SMcCandlish ☏ ¢ 😼  21:30, 9 July 2018 (UTC)
 * It's sounding more and more like a bot should be doing the categorization (where people don't do it manually), without the templates forcing it. I don't know enough about our bot stuff to be sure how to get this implemented and approved, though.  — SMcCandlish ☏ ¢ 😼  02:40, 9 July 2018 (UTC)

ISO 639-6
Cantonese translaterated: guzh-Latn isn't working, nor is the less mnemonic yye-Latn. This may be affecting other ISO 639-6 constructions. It's not desirable to only be able to do something like because Chinese script encodes multiple languages and we need to be able to distinguish between them, e.g. in the lead sentence of Cheongsam. — SMcCandlish ☏ ¢ 😼  03:07, 12 July 2018 (UTC) I've patched up the Cantonese article. — SMcCandlish ☏ ¢ 😼  05:16, 12 July 2018 (UTC)
 * ISO 639-6 indicates the standard is withdrawn. --Izno (talk) 03:19, 12 July 2018 (UTC)
 * Then we need to remove it from articles and the language infobox and replace it with something else.  — SMcCandlish ☏ ¢ 😼  05:01, 12 July 2018 (UTC)
 * How about ? That refers to Yue Chinese, but disambiguating between Cantonese and other varieties may not be necessary. — Eru·tuon 03:25, 12 July 2018 (UTC)
 * Yes, that one works. It may be insufficient to distinguishing between Cantonese and other Yue dialects/languages, but if it's all we have then it is.  — SMcCandlish ☏ ¢ 😼  05:01, 12 July 2018 (UTC)

Wiktionary language code
Wiktionary uses the language code  for Old Danish; any chance we could support a fuller range of Wiktionary codes on here, where there isn't an ISO code? —  OwenBlacker (talk; please &#123;&#123;ping&#125;&#125; me in replies) 22:52, 15 July 2018 (UTC)
 * Language codes used with the and  templates must be understandable by browsers and screen readers so consequently must meet the requirements of the IETF language tag format. The form of   suggests that   is a language extension to North Germanic languages (a collective language code) but there is no   extlang defined in the IANA language subtag registry file.
 * We can create private use codes that comply with the IETF format and have done so in the past. You can see them in Module:Lang/data.
 * —Trappist the monk (talk) 23:24, 15 July 2018 (UTC)
 * That should work; the template could just "translate" Wiktionary-invented codes to private use ones on the fly, right?  — SMcCandlish ☏ ¢ 😼  02:52, 16 July 2018 (UTC)
 * That should work; the template could just "translate" Wiktionary-invented codes to private use ones on the fly, right?  — SMcCandlish ☏ ¢ 😼  02:52, 16 July 2018 (UTC)

Old language-collective categories

 * Conversation moved here from Module talk:Lang

I just noticed that the old categories, like Category:Articles containing Germanic-language text still exist and, presumably, should be put up for deletion, given any articles that would have gone there will now be in either Category:Articles with text from the Germanic languages collective or Category:Articles containing Proto-Germanic-language text.

Is there an easy way of enumerating the categories that should now be up for deletion? — OwenBlacker (talk; please &#123;&#123;ping&#125;&#125; me in replies) 13:54, 29 June 2018 (UTC)
 * I would keep the one with a simpler name. "the Germanic languages collective" sounds like a social movement. I've never seen this term before. Maybe it was meant to have a comma in it. Even so, it's misleading in another way, in that it's not a collective (container) category for articles with Germanic language markup, but only those with a specific ISO code, . The English and French names of this code are vague, but the German one is more specific and translates to "Germanic Languages ​​(Other)".  It appears to be a code for Germanic languages that don't have their own code, and is not for "Germanic language in general" or "the Germanic language family", though I suppose no one's head will explode if it's used that way. I think "Category:Articles containing text in an unspecified Germanic language" would be the accurate category name.  — SMcCandlish ☏ ¢ 😼  15:44, 29 June 2018 (UTC)
 * The term collective as applied to ISO 639-2 language codes is defined at Library of Congress. Collectives are described in our ISO 639-2 article at §Collections of languages.
 * There was discussion on this page about the collective category name.
 * —Trappist the monk (talk) 16:57, 29 June 2018 (UTC)
 * Okay, so WP didn't invent it out of nothing. But how does using odd ISO terminology help readers, or editors doing maintenance?  — SMcCandlish ☏ ¢ 😼  17:47, 29 June 2018 (UTC)
 * Because we are talking about a thing, and because that thing has an internationally defined set of terminologies, we should use the internationally defined set of terminologies for that thing in our own work. To make up our own terminologies will only serve to confuse.
 * —Trappist the monk (talk) 12:19, 30 June 2018 (UTC)
 * I could buy that if the purpose is to codify ISO specs in our category structure. But it appears to be to categorize by language. The ISO technical term could be included in a note in the category page, which could live at a name that made sense to normal people. :-) I.e., it's the WP:RECOGNIZABLE factor.  — SMcCandlish ☏ ¢ 😼  05:48, 1 July 2018 (UTC)
 * In general,, has always used name from the ISO specs for language categorization. The only difference now is that this subset of category names accurately reflects their collective nature; that several individual languages are associated with these codes.  Yeah, the documentation for the categories sucks.  It is on my to-do list to improve / replace it.
 * —Trappist the monk (talk) 12:26, 1 July 2018 (UTC)
 * It makes sense to use ISO codes for the params, because they're short, and easy to get from the infoboxes at the languages' articles. That doesn't really relate to categories; ISO geekery isn't helpful in them. The "collective" (ambiguous word, and not very accurate – more like "unspecific") nature of a few codes and corresponding categorizations is better explained in more natural English, like "Category:Articles containing text in an unspecified Germanic language".  — SMcCandlish ☏ ¢ 😼  23:30, 1 July 2018 (UTC)
 * I was noticing in the table at Template:ISO 639 name/doc that at least one category that was moved to one of these "collective" names is redlinking in that table. I don't now if the underlying code needs to change to use a different category now, or whether it's just that the /doc needs to be updated to use it.  — SMcCandlish ☏ ¢ 😼  18:44, 21 July 2018 (UTC)
 * I think that  is the only two-character language code (ISO 639-1) that identifies a language collective; all others language collectives are three-character codes.  The category display is created in Template:ISO 639 name/doc by the documentation template:
 * You can make it show a blue-link to the same category that uses by changing the above to:
 * —Trappist the monk (talk) 19:11, 21 July 2018 (UTC)
 * Further, I'm not really sure why that template documentation lists categories. Neither  nor  add categories when used.  And, of course, the article link should be to Bihari languages (plural).
 * —Trappist the monk (talk) 19:18, 21 July 2018 (UTC)
 * —Trappist the monk (talk) 19:11, 21 July 2018 (UTC)
 * Further, I'm not really sure why that template documentation lists categories. Neither  nor  add categories when used.  And, of course, the article link should be to Bihari languages (plural).
 * —Trappist the monk (talk) 19:18, 21 July 2018 (UTC)

Name parameter
Currently to make a link to a language we have to write  which is cumbersome even for one or two languages, but really a pain when one needs to list a dozen or more. What if we do  to create a language name with a wikilink?--Lüboslóv Yęzýkin (talk) 14:39, 15 July 2018 (UTC)
 * It is not the purpose of the templates to act as editor typing shortcuts.  I do not think that such facility should be added to the  remit.
 * —Trappist the monk (talk) 23:27, 15 July 2018 (UTC)
 * Yeah, it would probably make more sense to create something like, etc. (for "language shortcut"). If it were shoehorned into , it would require a parameter, something like , which would eliminate any convenience.  — SMcCandlish ☏ ¢ 😼  02:54, 16 July 2018 (UTC)
 * I suggested "n=1", what can be shorter. Of course, you can create a parameter as verbose as possible to prove it inconvenient.--Lüboslóv Yęzýkin (talk) 12:30, 16 July 2018 (UTC)
 * That's contradictory. You want a non-mnemonic "n=1" here – which isn't going to mean much to anyone or be remembered – but object to a short template name below on the grounds that it's non-mnemonic.  — SMcCandlish ☏ ¢ 😼  14:44, 16 July 2018 (UTC)
 * N = name. You create a language name from an ISO code. Exactly like "ISO 639 name", but wiki-linked. Why are you so sure that your "(l)sc" is going to mean much to everyone or be remembered?--Lüboslóv Yęzýkin (talk) 19:20, 16 July 2018 (UTC)
 * I also don't find lsc very obvious. It suggests "language script" to me because of the sc parameters on Wiktionary. I like langname better, but Template:langname is a redirect to Template:ISO 639 name right now. — Eru·tuon 19:33, 16 July 2018 (UTC)
 * There's pretty much no continuity between WP and Wikt templates. On en.WP, though, all the page-banner templates (, etc.) support sc parameters so "sc" = "shortcut" in en.Wikipedian minds already. L for language is pretty obvious. That said, I really don't care what it's called.  I don't think of "name" when I think of languages so n doesn't seem mnemonic.  And the primary maintainer (understander, for that matter) of the  code isn't interested in integrating such a parameter, so it's probably a dead stick.  — SMcCandlish ☏ ¢ 😼  09:11, 17 July 2018 (UTC)
 * PS: I assume there'd be an easy way to get to use the same language list as .  — SMcCandlish ☏ ¢ 😼  02:55, 16 July 2018 (UTC)
 * There is ISO 639 name, but it is indeed verbose and does not create a link. I'm not sure about the "lsc" name, it does not look very mnemonic for me. But I do not see why we should create another template. Why couldn't we do this template multipurpose? There are enough of them to get confused already.--Lüboslóv Yęzýkin (talk) 12:30, 16 July 2018 (UTC)
 * Module:Lang has the function  which, given a properly formatted IETF tag, returns the appropriate language name from the  data set.  That function was created for use as a documentation tool and as a possible replacement for  (because that template uses the expensive parser function call  ).    might be modified to accept a second argument so that   would return  .  This functionality must not be part of the  templates.  However, that does not mean that you couldn't create  or  (with a redirect from ) to accomplish what you want.
 * —Trappist the monk (talk) 13:49, 16 July 2018 (UTC)
 * I've tweaked Module:lang/sandbox so that:
 * —Trappist the monk (talk) 15:00, 16 July 2018 (UTC)
 * Great. I'm not insisting on using "lang-xx", "lang" is OK. But I'm afraid using simply "link" may cause problems, because it looks not as a parameter but as a word, in theory there can be link > link. Better make it more obvious that it isn't a word. Why not to use simply zero: 0 ? It is the most obvious and shortest. Why in the last example is there "languages"? No need for that.--Lüboslóv Yęzýkin (talk) 19:20, 16 July 2018 (UTC)
 * No. You will not be using  nor any of the  templates for this.  Create a new template where, internally, it looks something like this:
 * where  holds an IETF language tag and   is a word (could be anything really except spaces) that is used to tell   that it should render a linked output.  If you want, you can write:
 * so that your template will default to linked rendering but can be switched to non-linked by setting the template's second positional parameter to 0. See these template mock-ups:
 * Test your template using the sandbox version of the module and when you are ready, let me know and I'll update the live module.
 * —Trappist the monk (talk) 19:59, 16 July 2018 (UTC)
 * It exactly creates a wiki-linked language name, but just followed by a colon and a word. I do not see any problem in allowing not to write the latter.--Lüboslóv Yęzýkin (talk) 12:30, 16 July 2018 (UTC)
 * Can anybody explain how this template/module construct is in any way an improvement over typing "French"? -- Michael Bednarek (talk) 01:46, 17 July 2018 (UTC)
 * It wouldn't be. The idea is that it would be an improvement over typing, perhaps more the the point  .  — SMcCandlish ☏ ¢ 😼  02:04, 17 July 2018 (UTC)
 * a) Linking "French language" is very rarely a good idea. b) Creating and testing a new template  and then typing   (18 characters) doesn't seem a great improvement on   (26), which can be shortened to   (21). c) I haven't seen "Proto-Indo-European language" in this thread before, but if that is too much effort, typing just Proto-Indo-European will have the same effect. -- Michael Bednarek (talk) 05:40, 17 July 2018 (UTC)
 * The linking you don't like is a built-in feature of, and that link is used, on first ocurrence, in the majority of articles in which the template is used. So, I don't think consensus agrees with you on "very rarely".  Even if it did, it wouldn't pertain to, say, Sesotho language, unfamiliar even by name to most English-speakers. You can't make an argument against an entire template class on the basis that one of thousands of potential uses of it might be unnecessary. Why would I want to type   if I can instead do ?  The fact that your lang link example isn't much of a savings is why I advocated a three-letter template name (or at least a shortcut redirect).  All that said, I'm not entirely convinced we need such a template, either; I just think these are shaky rationales against one.  — SMcCandlish ☏ ¢ 😼  15:41, 17 July 2018 (UTC)
 * Test your template using the sandbox version of the module and when you are ready, let me know and I'll update the live module.
 * —Trappist the monk (talk) 19:59, 16 July 2018 (UTC)
 * It exactly creates a wiki-linked language name, but just followed by a colon and a word. I do not see any problem in allowing not to write the latter.--Lüboslóv Yęzýkin (talk) 12:30, 16 July 2018 (UTC)
 * Can anybody explain how this template/module construct is in any way an improvement over typing "French"? -- Michael Bednarek (talk) 01:46, 17 July 2018 (UTC)
 * It wouldn't be. The idea is that it would be an improvement over typing, perhaps more the the point  .  — SMcCandlish ☏ ¢ 😼  02:04, 17 July 2018 (UTC)
 * a) Linking "French language" is very rarely a good idea. b) Creating and testing a new template  and then typing   (18 characters) doesn't seem a great improvement on   (26), which can be shortened to   (21). c) I haven't seen "Proto-Indo-European language" in this thread before, but if that is too much effort, typing just Proto-Indo-European will have the same effect. -- Michael Bednarek (talk) 05:40, 17 July 2018 (UTC)
 * The linking you don't like is a built-in feature of, and that link is used, on first ocurrence, in the majority of articles in which the template is used. So, I don't think consensus agrees with you on "very rarely".  Even if it did, it wouldn't pertain to, say, Sesotho language, unfamiliar even by name to most English-speakers. You can't make an argument against an entire template class on the basis that one of thousands of potential uses of it might be unnecessary. Why would I want to type   if I can instead do ?  The fact that your lang link example isn't much of a savings is why I advocated a three-letter template name (or at least a shortcut redirect).  All that said, I'm not entirely convinced we need such a template, either; I just think these are shaky rationales against one.  — SMcCandlish ☏ ¢ 😼  15:41, 17 July 2018 (UTC)
 * a) Linking "French language" is very rarely a good idea. b) Creating and testing a new template  and then typing   (18 characters) doesn't seem a great improvement on   (26), which can be shortened to   (21). c) I haven't seen "Proto-Indo-European language" in this thread before, but if that is too much effort, typing just Proto-Indo-European will have the same effect. -- Michael Bednarek (talk) 05:40, 17 July 2018 (UTC)
 * The linking you don't like is a built-in feature of, and that link is used, on first ocurrence, in the majority of articles in which the template is used. So, I don't think consensus agrees with you on "very rarely".  Even if it did, it wouldn't pertain to, say, Sesotho language, unfamiliar even by name to most English-speakers. You can't make an argument against an entire template class on the basis that one of thousands of potential uses of it might be unnecessary. Why would I want to type   if I can instead do ?  The fact that your lang link example isn't much of a savings is why I advocated a three-letter template name (or at least a shortcut redirect).  All that said, I'm not entirely convinced we need such a template, either; I just think these are shaky rationales against one.  — SMcCandlish ☏ ¢ 😼  15:41, 17 July 2018 (UTC)

Thanks for your explanation, but I still haven't got the answer why using "lang-xx" or "lang" is "verboten". Right now la creates French:  la What is wrong if we allow leaving the span part? la is more tricky because it only creates la But again, what is wrong if we expand the template making it multi-purpose?--Lüboslóv Yęzýkin (talk) 15:38, 21 July 2018 (UTC)
 * Yes, I know what the output of these templates looks like. The purpose of the  templates is do as you have illustrated: properly markup, non-English text so that browsers and screen-readers render/pronounce that non-English text correctly.  You desire something different; you desire something that doesn't help browsers/screen readers render/pronounce non-English text; you desire an editor's shortcut template so that you don't have to write out complete wikilinks to language articles.  I have some sympathy for that desire and have suggested a way for you to get what you want that does not require  to deviate from its intended purpose nor complicate Module:lang.
 * —Trappist the monk (talk) 17:54, 21 July 2018 (UTC)

We may usurp "langname", as it's practically not used at all, however, it is a little bit too long. My potential candidates are "langn", "langl", "lana", "lali", "liso" or whatever: I'm open to discussion. But I will rather be glad with already existing "lang-xx"/"lang".--Lüboslóv Yęzýkin (talk) 15:38, 21 July 2018 (UTC)

I don't think of "name" when I think of languages But the people who created "ISO 639 name" did. But OK, why not having aliases like "n=1" and "l=1": let others to choose what one wants. primary maintainer...isn't interested in integrating such a parameter Who is this guy?

Alright, let's count. | and seem equal (5 chars). But in what world is a two/three-letter code longer that the full name which may be quite long? In what world repeating the full language name and adding the word " language" (9 chars) is shorter than any template? And why have we to use a long template ("lang name" is just a suggestion), when we can easily limit ourselves to three to five letters? If you do not know why, how and where, just do not use it, what is the problem? As for myself, just recently I had to write such a line: Karachay-Balkar, Karaim, Krymchak, Kumyk, Urum and extinct Cuman In what world is this short and easy? I had to type every language name, then add | to every name, then repeat every name again, and then add " language" after every name. And it is always prone to errors/typos. Yes, I can copy-paste (and I do), but why have I? Another scenario: I just copy-paste a template any times I want and just add two-letter codes. Feel the difference, right? And such cases are really in (tens of) thousands of articles, so I wonder why such an option has not been created before. Its need is so obvious. We have flag, let's do this to languages! --Lüboslóv Yęzýkin (talk) 15:38, 21 July 2018 (UTC)
 * The main maintainer is Trappist the monk, who's done the months of work to get the language templates within the realm of "working properly and sensibly". I'm not sure who understands all the code behind this other than him.  — SMcCandlish ☏ ¢ 😼  18:42, 21 July 2018 (UTC)
 * I, too, end up having to manually enter things like your Karachay-Balkar ... example, and it also drives me nuts. Thus I threw a few minutes at it, and now – for common and semi-common languages, and without extended data like sa-Latn or pt-BR (the second part just gets ignored, except for simplified and traditional Chinese) – you have  at your disposal. It safely substitutes.  This would probably be better redone as a call to 's smarts; for now it's just a variant of  (which should likewise be converted to use the better routines that fuel  and  ). If you want to create  or  or whatever redirects, knock yaself out. I skipped, because it occurs to me that using three-letter shortcut names is a poor idea; ISO might actually pick that combination for a language code at some point! Not likely for any particular string, but still.  — SMcCandlish ☏ ¢ 😼  18:42, 21 July 2018 (UTC)

Update
Update: (and ) are now using   (and   for the latter), as  has been sandboxing above. It works in general, but partially fails for some specific cases. E.g.: Still, it should be an incremental improvement, able to handle more language codes that the old, still-live code of can. — SMcCandlish ☏ ¢ 😼  14:31, 22 July 2018 (UTC)
 * correctly outputs Australian English:
 * outputs only Portuguese instead of Brazilian Portuguese:
 * PS: The table of supported codes at Template:ISO 639 name/doc will need an update. We should probably keep a master list at something like Template:Lang/codelist and transclude it as a collapsed box in the documentation of all the templates in the set. Maybe even auto-generate it.  — SMcCandlish ☏ ¢ 😼  14:37, 22 July 2018 (UTC)
 * , and  support 7973 language codes (the full list is at Module:Language/data/iana languages).  That's rather a large number of codes to include in the documentation.
 * —Trappist the monk (talk) 15:28, 22 July 2018 (UTC)
 * Ah! Just referencing them should be sufficient.  — SMcCandlish ☏ ¢ 😼  02:16, 25 July 2018 (UTC)
 * Are you sure? This should not produce linked output, right? But it does:
 * → →  fixed
 * I was thinking this morning about changing the  so that it required a named parameter to select the linked/unlinked state because, as you have demonstrated, an empty positional parameter is sometimes misunderstood by humans.  My original selection mechanism was:
 * – where  is a template parameter, not a module parameter
 * which sets the  positional parameter   to   when the template's positional parameter   is anything but  ; else the   positional parameter   gets  .  Naming the   link option parameter should prevent that confusion.  If I change the module then the templates would read:
 * Shall I? done
 * —Trappist the monk (talk) 15:28, 22 July 2018 (UTC)
 * It is done.
 * —Trappist the monk (talk) 15:47, 22 July 2018 (UTC)
 * Yeah, that's a bit clearer.  — SMcCandlish ☏ ¢ 😼  02:17, 25 July 2018 (UTC)
 * —Trappist the monk (talk) 15:47, 22 July 2018 (UTC)
 * Yeah, that's a bit clearer.  — SMcCandlish ☏ ¢ 😼  02:17, 25 July 2018 (UTC)

live update
I have updated Module:lang from its sandbox.

—Trappist the monk (talk) 10:49, 25 July 2018 (UTC)
 * Must be why I feel that sudden sense of vim and vigor! Oh, could you have a look at MOS:TITLES and see if it gets at what it needs to get at for CS1 purposes and such? (Yeah, wrong page, but we're both here.) If it's not quite "it", feel free to user-talk ping me or something.  — SMcCandlish ☏ ¢ 😼  00:25, 27 July 2018 (UTC)
 * This is answered at Help_talk:Citation_Style_1?
 * —Trappist the monk (talk) 23:24, 28 July 2018 (UTC)

BUG: Current template/Module does not support multi-paragraph usage...
See:

https://en.wikipedia.org/w/index.php?title=Lojban&action=edit&section=20

Here the lang template is used with a multiple paragaph..

The expansion thereof is  la berti brife jo'u la solri

ni'o la berti brife jo'u la solri pu troci lo ka cuxna lo poi me vo'a vau traji be lo ka vlipa i ca'o bo lo pa litru noi dasni lo glare kosta cu klama

.i le re mei pu simxu lo ka tugni fi lo nu lo traji be lo ka clira fa lo nu ce'u snada lo ka gasnu lo nu le litru co'u dasni le kosta cu traji lo ka vlipa

.i ba bo la berti brife co'a traji cupra lo brife i ku'i lo nu by by zenba lo ka cupra lo xo kau brife cu rinka lo nu le litru zu'e ri zenba lo ka se tagji le kosta i ba bo la berti brife co'u troci i ba bo la solri co'a glare dirce i ba zi bo le litru co'u dasni le kosta

.i se ki'u bo la berti brife cu bilga lo ka tugni fi lo nu la solri cu traji lo ka vlipa 

This is CLEARLY malformed, as implied    cannot be placed inside a  ShakespeareFan00 (talk) 09:49, 4 August 2018 (UTC)
 * This is a known issue... --Izno (talk) 11:31, 4 August 2018 (UTC)
 * And whats the timescale for it being resolved? ShakespeareFan00 (talk) 11:52, 4 August 2018 (UTC)
 * No need to shout; demonstrations of anger will not speed a resolution.
 * When I looked at the rendered html of Lojban using my browser's view-page-source context menu, I saw something rather different from the expansion you provided. For me, this:
 * When I looked at the rendered html of Lojban using my browser's view-page-source context menu, I saw something rather different from the expansion you provided. For me, this:


 * This is clearly malformed. I have made a tweak to Module:Lang/sandbox that looks for sequential   characters in the template's text parameter.  When this condition is detected, the module switches to  tags which produces this:


 * Since I was mucking about with span/div switching, I also added a test for list markup (see this archived discussion). For list markup, the module looks for   immediately followed by one of ,  ,  , or  :


 * gives:
 * The tag is required for the time being because Module:lang and its /sandbox use Module:Arguments which, by default, trims whitespace from positional parameters.  This can be customized so that ultimately the  will not be required.
 * —Trappist the monk (talk) 14:37, 4 August 2018 (UTC)
 * &lt;i> must contain only phrasing content. Neither divs, nor paragraphs, nor lists are included as phrasing content. --Izno (talk) 15:45, 4 August 2018 (UTC)
 * The  tags wrapping the tags were, I think, dictated by the vagaries of Tidy.  One iteration of Module:lang did not use  for italicized text but instead used  tags with all of the appropriate attributes; if I recall correctly, Tidy buggered that up when a  template was wrapped in wiki italic markup (nested <i ></i> tags, one within the other and Tidy discarded the more specific tags) so we went back to .  We tried using the   attribute in the  tag but editors complained about having to use   in their personal css when they wanted to override specific languages with special fonts.
 * —Trappist the monk (talk) 16:42, 4 August 2018 (UTC)
 * The  attribute is valid on all HTML elements (HTML 4.0 and later), without exception; so we may use

<blockquote class="templatequote" lang="jbo" title="Lojban language text" style="font-style:italic;">la berti brife jo'u la solri

ni'o la berti brife jo'u la solri pu troci lo ka cuxna lo poi me vo'a vau traji be lo ka vlipa i ca'o bo lo pa litru noi dasni lo glare kosta cu klama

.i le re mei pu simxu lo ka tugni fi lo nu lo traji be lo ka clira fa lo nu ce'u snada lo ka gasnu lo nu le litru co'u dasni le kosta cu traji lo ka vlipa

.i ba bo la berti brife co'a traji cupra lo brife i ku'i lo nu by by zenba lo ka cupra lo xo kau brife cu rinka lo nu le litru zu'e ri zenba lo ka se tagji le kosta i ba bo la berti brife co'u troci i ba bo la solri co'a glare dirce i ba zi bo le litru co'u dasni le kosta

.i se ki'u bo la berti brife cu bilga lo ka tugni fi lo nu la solri cu traji lo ka vlipa which produces: <blockquote class="templatequote" lang="jbo" title="Lojban language text" style="font-style:italic;">la berti brife jo'u la solri

ni'o la berti brife jo'u la solri pu troci lo ka cuxna lo poi me vo'a vau traji be lo ka vlipa i ca'o bo lo pa litru noi dasni lo glare kosta cu klama

.i le re mei pu simxu lo ka tugni fi lo nu lo traji be lo ka clira fa lo nu ce'u snada lo ka gasnu lo nu le litru co'u dasni le kosta cu traji lo ka vlipa

.i ba bo la berti brife co'a traji cupra lo brife i ku'i lo nu by by zenba lo ka cupra lo xo kau brife cu rinka lo nu le litru zu'e ri zenba lo ka se tagji le kosta i ba bo la berti brife co'u troci i ba bo la solri co'a glare dirce i ba zi bo le litru co'u dasni le kosta

.i se ki'u bo la berti brife cu bilga lo ka tugni fi lo nu la solri cu traji lo ka vlipa
 * Notice also how the <i ></i> tags (which like can only contain inline content) have been turned into a   attribute. -- Red rose64 &#x1f339; (talk) 19:34, 4 August 2018 (UTC)
 * But, alas, in the configuration that OP presented (one that I suspect most editors would choose), is unaware that it is wrapped in <blockquote ></blockquote> tags so cannot rewrite the  tag as you have done.  We might, in a future version of  offer a parameter that would allow editors to specify one of a limited set tags in which to wrap the text – I have not thought this out so it may not be workable.
 * Because Tidy has gone away, it appears that we can go back to using <i ></i> tags for italicized text. I have tweaked Module:lang/sandbox. From this:
 * produces this:
 * which is not 'tidied' but is rendered in the html as:
 * The issue of italics when text contains,  ,  ,  , or   requires , I think, to convert this:
 * which is not 'tidied' but is rendered in the html as:
 * The issue of italics when text contains,  ,  ,  , or   requires , I think, to convert this:
 * The issue of italics when text contains,  ,  ,  , or   requires , I think, to convert this:
 * The issue of italics when text contains,  ,  ,  , or   requires , I think, to convert this:

<pre style="margin-left:9.6em>:
 * to this:


 * which MediaWiki then renders as this html:


 * —Trappist the monk (talk) 14:17, 5 August 2018 (UTC)

I've hacked at Module:lang/sandbox and have had success with list markup. For example, this: <pre style="margin-left:1.6em>:

renders like this:

with this html: But, implied (from  ) does not work though the failing can't, I think, be laid at the feet of Module:lang/sandbox.

<pre style="margin-left:1.6em>a line item another line item

and yet another line item makes this html: the last line is outside of the enclosing span:

a line item another line item

and yet another line item

The same 'text' using Module:lang/sandbox wraps the whole in tags gives this html: which renders:

What to do? Detect  in 'text' and throw an error? Detect  in 'text' and insert  tags in the appropriate places? If we throw an error, do we recommend <poem ></poem> markup? Probably not because this: <pre style="margin-left:1.6em> produces this flawed html (the module doesn't produce because all it sees is the poem stripmarker): though it 'looks' ok:

We could detect the poem stripmarker, wrap the whole in tags and lose auto-italics.

What to do with  in 'text'?

—Trappist the monk (talk) 12:21, 14 August 2018 (UTC)

isolation
Please consider to add style="unicode-bidi:isolate" - this should resolve issues such as the mixup in Mahmud of Ghazni. Thanks, Eran (talk) 20:24, 15 August 2018 (UTC)
 * I haven't given this any thought but my immediate reaction is that this:
 * محمود غزنوی; 2 November 971 – 30 April 1030
 * should have been written like this:
 * محمود غزنوی; 2 November 971 – 30 April 1030
 * Doing this serves two purposes: first it makes the rendering correct because rtl tells the browser that the tags in the template rendering enclose right-to-left text and second, in the wikisource, it disentangles right-to-left (the Persian text), the ambiguous text (the digits can go either way), and the left-to-right text (English text).
 * —Trappist the monk (talk) 21:53, 15 August 2018 (UTC)
 * yes could be partially automated using script detection, like italicization: look up the scripts of the characters in the text and if all of them are right-to-left scripts or not real scripts, add . I've created an   function in Module:Unicode data and  it to Module:Lang/sandbox. It uses   from Module:Lang/data via Module:Unicode data/scripts. With this change, the example above displays correctly without yes:
 * ; 2 November 971 – 30 April 1030
 * yes would sometimes still be needed: for instance, when there are Latin-script characters in Arabic-script text, for instance. — Eru·tuon 22:44, 15 August 2018 (UTC)
 * Is there a problem?  :
 * ; 2 November 971 – 30 April 1030
 * yes would sometimes still be needed: for instance, when there are Latin-script characters in Arabic-script text, for instance. — Eru·tuon 22:44, 15 August 2018 (UTC)
 * Is there a problem?  :
 * Is there a problem?  :


 * A string entirely composed of Zyyy, Zinh, and / or Zzzz characters is, by this definition, right-to-left, right? Yet the same string of characters is also Latin (if I understand what   does).  Perhaps one or both of those functions need a tweak to require that the source string contains some minimal percentage of characters that are members of the target script(s)?
 * —Trappist the monk (talk) 23:36, 15 August 2018 (UTC)
 * Yes, that's the way the functions behaved. I've changed them to be more accurate, meaning now they will return false instead of true if their input consists of nothing but Zinh, Zyyy, or Zzzz characters. Do you think there would be a benefit to requiring a certain percentage of Latin or right-to-left characters?
 * I intentionally didn't fix, because the text supplied to  almost always contains letter characters belonging to a particular script. But for   the inaccuracy would have a greater cost, and   might as well be more accurate too.
 * Now that I look into it a little, I wonder if tying right-to-left direction to the script is correct, because bidirectional class is the actual basis for the Unicode bidirectional algorithm (see ). I don't know how exactly the text direction in HTML or CSS relates to the bidirectional classes of characters. But English Wiktionary ties text direction to script (see wikt:MediaWiki:Common.css) and it seems to work well enough there. — Eru·tuon 02:50, 16 August 2018 (UTC)
 * I don't know what a minimal percentage might be. It could be that a string composed of only a single proper right-to-left character and any number of Zyyy, Zinh, and / or Zzzz characters is sufficient.  This, I think is pretty much what   now recognizes, right?
 * I would be perfectly content not to automate rtl detection because that mechanism doesn't fix the mishmash that occurs in the edit window when left-to-right digits follow right-to-left text as is the exemplar case here.
 * —Trappist the monk (talk) 14:58, 16 August 2018 (UTC)
 * Yes, that's how the function behaves right now. — Eru·tuon 18:39, 16 August 2018 (UTC)
 * Incorrect text direction in the textbox doesn't take away from the fact that automatic detection would make the template more convenient. (I'm not seeing a mishmash in the textbox here, unless I copy the example as plain text and paste it into the textbox, but I've seen it elsewhere, for instance in wikt:Module:ckb-translit.)
 * Editors wouldn't have to add yes and there would be fewer text-direction rendering errors, because  would almost always be added when necessary even if the editor knows nothing about it. If automatic detection had already been implemented, this thread wouldn't exist, because the rendering error wouldn't have happened.
 * The cases in which automatic detection would fail because the text contains both right-to-left and left-to-right scripts seem to be rare. For instance, a search for text containing Arabic-block and basic Latin characters in ( hastemplate:"lang" insource:/\{\{ *lang *\|[^|]+\| *([؀-ۿ]+[؀-ۿ ]*[a-zA-Z]|[a-zA-Z][؀-ۿ ]*[؀-ۿ]+)/ ) only gives a few results, most of which need to be corrected so that English text or transliteration isn't incorrectly tagged. — Eru·tuon 23:41, 18 August 2018 (UTC)
 * In my browser's edit box, latest chrome win7, the exemplar template looks like this:
 * Auto-detecting rtl in won't unscramble the stuff that editors work with.
 * —Trappist the monk (talk) 10:37, 19 August 2018 (UTC)
 * Oh yeah, so Firefox (my default browser) doesn't scramble the text, while Chrome does. — Eru·tuon 18:39, 19 August 2018 (UTC)
 * —Trappist the monk (talk) 10:37, 19 August 2018 (UTC)
 * Oh yeah, so Firefox (my default browser) doesn't scramble the text, while Chrome does. — Eru·tuon 18:39, 19 August 2018 (UTC)

Unconverted lang- templates
Please would somebody look at the template to determine either (i) whether it should be converted to Module:Lang, or (ii) explain why it should not be converted. -- Red rose64 &#x1f339; (talk) 19:24, 22 August 2018 (UTC)
 * Because renders the text using ; because  has special code and parameters for romanization and other scripts; in short, because it doesn't fit neatly into the  model.  The  issue might be solvable with template styles; the special parameter functions might be fixable by code tweaks; or not.
 * —Trappist the monk (talk) 20:01, 22 August 2018 (UTC)

Also can anybody explain why we have both and ? -- Red rose64 &#x1f339; (talk) 19:32, 22 August 2018 (UTC)
 * takes language name from Module:Language/data/iana_languages which is a list of the accepted language codes used for IETF tagging. Code   has two accepted spellings the first of which (and the one used by  is Uighur; the second is Uyghur used by .  This is fixable given a determination of which name Uighur or Uyghur is preferred. (Chrome's spell-checker prefers Uighur; for whatever that is worth.)
 * —Trappist the monk (talk) 20:01, 22 August 2018 (UTC)

Bug: italicization of non-Latin text
This template has a bug where it italicizes non-Latin text if it is encoded as HTML entities. For example,  produces 𐘀, but   produces  &#x10600; . Gorobay (talk) 00:58, 22 September 2018 (UTC)
 * One approach (decoding HTML character references), or maybe in this case italicization could be turned off based on the script subtag (Lina) instead. — Eru·tuon 04:36, 22 September 2018 (UTC)
 * I've added a test to disable auto-italics when there is a script subtag that is not Latn. To test this I disabled your suggested fix; I tested my tweak with Cyrl because on my browser Linear A is just a little square box:
 * → – fails because of the 'x'
 * It seems to me that the  fix for this properly belongs in Module:Unicode data.
 * —Trappist the monk (talk) 12:37, 22 September 2018 (UTC)
 * I'll work on that. I'd envisioned  as a function only operating on UTF-8-encoded characters, but on a wiki it's more convenient if it decodes HTML character references. [Edit: Done.] — Eru·tuon 20:11, 22 September 2018 (UTC)
 * —Trappist the monk (talk) 12:37, 22 September 2018 (UTC)
 * I'll work on that. I'd envisioned  as a function only operating on UTF-8-encoded characters, but on a wiki it's more convenient if it decodes HTML character references. [Edit: Done.] — Eru·tuon 20:11, 22 September 2018 (UTC)

Linking "lit."?
If a lang-xx template is called with the addition of a literal translation (using the parameter lit), then this translation will be prefixed by the abbreviation "lit.". I've just noticed that this abbreviation will by default get displayed as a wikilink, as in the following example:
 * Savyasācin-: Savyasācin-

Now, this linking could be turned off via no (which would also unlink the language name), but is the default behaviour desirable at all? First off, the meaning of the abbreviation is given in a tooltip anyway, so the addition of a link seems like a bit of an overkill. It adds visual clutter, and it doesn't quite fit into our linking philosophy: we don't link common terms whose articles are incidental to the text they appear in. – Uanfala (talk) 18:27, 23 September 2018 (UTC)
 * Module:Lang does not add a tool tip to the lit. link. The tool tip that you are seeing is the normally provided tool tip that comes with any Wiki link; Sanskrit in your example also has a tooltip.  When no Module:lang does not link to Literal translation but instead renders the 'lit.' static text wrapped in <abbr ></abbr>. Module:lang does not do both.
 * —Trappist the monk (talk) 20:02, 23 September 2018 (UTC)
 * Sorry, my mistake: I had in mind the tooltip that usually comes with the abbr tags: that's the one visible when link is set to "no", as here:
 * Savyasācin-: Savyasācin-
 * So the question remains: why is the current default behaviour to have "lit." linked rather than formatted with abbr tags? – Uanfala (talk) 20:33, 23 September 2018 (UTC)
 * Module:Lang descends from several older templates. One of them is, the source of the lit. link.  Until now, no one has thought to question why lit. is linked – the link has been in that template from the beginning (9 November 2015).
 * —Trappist the monk (talk) 20:56, 23 September 2018 (UTC)

Are there times when the template should not be used with foreign words?
The template page list multiple very good reasons for using it in the rationale section and I was wondering if there were cases in an article where use of the template should be specifically avoided or if there is such a thing as over use of the lang template. —The Editor's Apprentice (talk) (contribs) 14:54, 27 September 2018 (UTC)
 * should never be used in any of the cs1|2 citation-template parameters listed here. Otherwise, I don't know of any other places where non-English text should not be wrapped in .  If the template shows an error message, fix the template; if unfixable, report the circumstances here.  It is possible to over-use any template because MediaWiki will only allow template expansion to 2MB; see (Post-expand include size).
 * —Trappist the monk (talk) 15:10, 27 September 2018 (UTC)
 * We still need to hash out a block version of this template, which I have been meaning to chase. That's one spot where this template should probably not be used ("technical limitations"). --Izno (talk) 17:37, 27 September 2018 (UTC)

Pretty sure that I did something about that: *a list item
 * another list item
 * and yet another list item


 * a list item
 * another list item
 * and yet another list item

—Trappist the monk (talk) 18:36, 27 September 2018 (UTC)
 * There is a bit of guidance for the OP at MOS:FOREIGNITALIC about loanwords that have become English words. – Jonesey95 (talk) 18:38, 27 September 2018 (UTC)

Messed up formats
Could you guys matybe verify what recent changes have done to articles such as Luceafărul (poem)? Dahn (talk) 05:22, 4 October 2018 (UTC)
 * Done. has a lang parameter that should be used. — Eru·tuon 06:03, 4 October 2018 (UTC)

One word in multiple languages in one template?
Is there a way to put more than one ISO code into lang? For example, instead of saying:

The Huli language word is anga, and it is also anga in the Duna language. The Huli language word is anga, and it is also anga in the Duna language.

I could write: The word is anga in the Duna and Huli languages. The word is duc in the Duna and Huli languages.

I tried in my sendbox, and I couldn't tell if it added the right categories. --Nessie (talk) 15:15, 22 October 2018 (UTC)
 * This will not work (and cannot be made to work). You will need to use a construction similar to your first, though you might employ semicolons and parentheses or some such. --Izno (talk) 15:31, 22 October 2018 (UTC)

Macrolanguage categories
Hi, I'm not sure I immediately see the point of the redirect. What am I missing? – Uanfala (talk) 12:37, 3 November 2018 (UTC)
 * Hi
 * I presume that before posting, you tried Special:WhatLinksHere/Nepali (macrolanguage) language. So you will have seen there that the redirect is linked to by Category:Articles containing Nepali (macrolanguage)-language text.  Currently empty, but wasn't when I created it.
 * Such categories use a template which generates a link to "Foo language".
 * When "Foo" includes the word "language", the resulting ugly construct needs a redirect, which I created. As I have done for hundreds of other such cases. -- Brown <span style="display:inline-block;transform:rotate(-3deg)">Haired Girl (talk) • (contribs) 12:46, 3 November 2018 (UTC)
 * Ah, it didn't occur to me to check that. Hmm, isn't Category:Articles containing Nepali (macrolanguage)-language text now superseded by Category:Articles containing Nepali-language text, which is what you get when calling lang with the language code set to either "nep" or "ne"? Using "npi" (the code for the individual langauge) seems to add the non-existent Category:Articles containing Nepali (individual language)-language text. Pinging, who knows this system better than anyone else. – Uanfala (talk) 13:02, 3 November 2018 (UTC)
 * yes no longer populates Category:Articles containing Nepali (macrolanguage)-language text, which I guess is why the cat is now empty.
 * To be honest, I am not much interested in this. i just created those cats to fill redlinks per WP:REDNOT. I presume that since I did so, some llokup table was modified. -- Brown <span style="display:inline-block;transform:rotate(-3deg)">Haired Girl (talk) • (contribs) 13:10, 3 November 2018 (UTC)
 * Some language names defined in ISO 639-1, -2, -3 are parenthetically disambiguated by the custodians so those disambiguations are made part of the language lists that uses.  Disambiguators are:
 * 'macrolanguage' and 'individual language' – Dogri (macrolanguage) and Dogri (individual language)
 * country, state, or other political division names – Aniu (China) and Aniu (Japan)
 * time periods – Old English (ca. 450-1100), Egyptian (Ancient)
 * institutional names – Interlingua (International Auxiliary Language Association)
 * abbreviations – Hawai'i Sign Language (HSL)
 * Complicating all of this, is Module:Language/data/wp languages which contains a list of ISO 639 codes and names without disambiguation (this is where gets 'Nepali').  The provenance of the data in this module is unknown, unclear, and as such, suspect.  /wp languages existed before I created Module:Lang to consolidate most of the  and  templates using codes and names from the custodian sources (en.wiki should not be in the business of making up codes and names).
 * I'm not sure that Module:lang should remove disambiguators when adding categories though I suppose that it could be argued that removing 'macrolanguage' and 'individual language' would be acceptable. This, of course, is a topic for Template talk:Lang.
 * —Trappist the monk (talk) 14:53, 3 November 2018 (UTC)
 * Moved to the template talk page. – Uanfala (talk) 15:08, 3 November 2018 (UTC)
 * Moved to the template talk page. – Uanfala (talk) 15:08, 3 November 2018 (UTC)

New parameter idea
Shouldn't there be a new parameter for Lang-XX templates, which will give appropriate punctuations, brackets, styling, etc., in accordance with what the subject is (like Book title, Episode title, Film title, etc.)? JSH-alive/talk/cont/mail 08:09, 9 November 2018 (UTC)
 * If I understand what it is that you are suggesting, I think that I have already proposed a wrapper template for that would have done that.  For want of support, the proposals died.
 * —Trappist the monk (talk) 09:47, 9 November 2018 (UTC)
 * Well, suppose I put a Korean title in, and put a parameter named something like . If I give some value like "film title", "TV title", "album title" and "book title", the title will be wrapped in 《》, while other values like "song title", "episode title", "chapter title" and "article title" will make it wrapped in 〈〉. JSH-alive/talk/cont/mail 14:20, 9 November 2018 (UTC)
 * This is much better left to the editor using the template. -- Michael Bednarek (talk) 14:37, 9 November 2018 (UTC)
 * and the templates attempt to adhere to en.wiki's manual of style.  At MOS:QUOTEMARKS curly ( “” ), low-high („ “), and guillemets (« ») as quotation marks are prohibited.  I suspect that use of 〈〉and 《》 as quotation marks are similarly inappropriate in en.wiki text so for  to add those marks would be a violation of the attempt-to-adhere-to-MOS rubric.
 * —Trappist the monk (talk) 14:53, 9 November 2018 (UTC)
 * I see. JSH-alive/talk/cont/mail 15:02, 9 November 2018 (UTC)
 * I see. JSH-alive/talk/cont/mail 15:02, 9 November 2018 (UTC)

Translation issue
In the module Module:lang, in line number 1082, should the word language which is present inside single quotes be translated into local language while translating it into malayalam? I am getting around thousand errors as in the page [Hindi].Adithyak1997 (talk) 18:44, 24 November 2018 (UTC)
 * I have done nothing to internationalize Module:Lang. It's on the TODO list but ...
 * The first thing that I noticed about ml:ഹിന്ദി is the script error. You don't have the current version of Module:Unicode_data/scripts.
 * —Trappist the monk (talk) 20:13, 24 November 2018 (UTC)
 * Updated ml:ഘടകം:Unicode data/scripts to fix module error in ഹിന്ദി. — Eru·tuon 02:34, 25 November 2018 (UTC)
 * Updated ml:ഘടകം:Unicode data/scripts to fix module error in ഹിന്ദി. — Eru·tuon 02:34, 25 November 2018 (UTC)

Arabic in western alphabet
Why does  render as Allahu Akbar, with a different font to the rest of this post, and no underscore? Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 17:25, 12 December 2018 (UTC)
 * And without the link:  as: Allahu Akbar.  Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 17:27, 12 December 2018 (UTC)
 * And without italics:  as: Allahu Akbar.  Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 17:29, 12 December 2018 (UTC)
 * For comparison; with no template: Allahu Akbar; and italicised: Allahu Akbar. Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 22:54, 12 December 2018 (UTC)
 * Transliterated non-English text is rendered in italic font; your example is an Arabic transliteration written with Latin script. Perhaps the better template for this example is ; cf:
 * → Allahu Akbar → Allahu Akbar
 * → Allahu Akbar → Allahu Akbar
 * alternately:
 * → Allahu Akbar → Allahu Akbar
 * No underscore because because you did not include an underscore in the wikilink text; here I did:
 * → Allahu_Akbar
 * —Trappist the monk (talk) 18:10, 12 December 2018 (UTC)
 * Apologies; I meant underline, not underscore. Your first three examples all appear identical (to each other, and to my first example; but not to the template-free version) to me, in the latest version of Firefox, on recently-patched Win 10; and in the latst Opera on the same device. Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 22:51, 12 December 2018 (UTC)
 * Probably the Arabic text has a different font because your browser is rendering text that is marked as Arabic (enclosed in a HTML tag with the attribute ) in a font appropriate for the Arabic script, even though the characters are actually from the Latin alphabet. I've seen a similar problem, Japanese romanization tagged with   or   being rendered in a font appropriate for Japanese script. (I think it makes the Latin characters extra wide.) Adding a script code  and putting a CSS rule like   (language attribute includes "Latn") or   (language attribute ends with "Latn") in your common.css should override the browser's font rules and force the text to render in the font of the surrounding paragraph. — Eru·tuon 20:44, 12 December 2018 (UTC)
 * It hadn't occurred to me that the difference was browser-specific; I'll do some testing, later. Thanks for the CSS tips, but I'm more concerned about how it appears for general readers, than me personally. Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 22:50, 12 December 2018 (UTC)

Use in links
Can anyone tell me why the markup in failed, please? Andy Mabbett ( Pigsonthewing ); Talk to Andy; Andy's edits 13:56, 14 January 2019 (UTC)
 * Because in mainspace, adds a category link:
 * Add yes.
 * —Trappist the monk (talk) 14:09, 14 January 2019 (UTC)
 * —Trappist the monk (talk) 14:09, 14 January 2019 (UTC)