Template talk:Lang/Archive 14
Possible bugAt the bottom of the page, List of transgender public officeholders in the United States is in the category "Category:Articles containing Neapolitan-language text", despite not having any Neapolitan text. I'm not seeing anything labeled {{lang|nap}} or anything like that, either. Snowman304|talk 13:47, 15 September 2024 (UTC)
Template-protected edit request on 18 September 2024
Can someone please categorise the template {{lang-ku}} under Category:Iranian multilingual support templates instead of Category:Indo-Iranian multilingual support templates, and the templates {{lang-bn}}, {{lang-hi}}, {{lang-ne}}, {{lang-pa}}, {{lang-sa}} and {{lang-ur}} under Category:Indo-Aryan multilingual support templates instead of Category:Indo-Iranian multilingual support templates, because the categories 'Indo-Aryan multilingual support templates' and 'Iranian multilingual support templates' are more specific than the category 'Indo-Iranian multilingual support templates'? PK2 (talk; contributions) 03:44, 18 September 2024 (UTC)
a way to mark something as being in multiple languagesMaybe this is pie-in-the-sky, or a different matter entirely, but it would be nice if there were a way to mark something as being in multiple languages, e.g., Czech and Slovak from Chort: A chort (Russian: чёрт, Belarusian and Ukrainian: чорт, Serbo-Croatian čort or črt, Polish: czart and czort, Czech and Slovak: čert, Slovene: črt) Snowman304|talk 19:12, 18 September 2024 (UTC)
Is it applied to transliterarions?Please see Talk:Kompromat#Why_is_the_word_so_small?. Two issues: (2) the complaint abouot fontsize and (1) (my question: Is the usage {{lang|ru|Kompromat}} (Kompromat) valid or only {{lang|ru|компромат}} makes sense? --Altenmann >talk 23:54, 4 October 2024 (UTC)
Italics in foreign-language textI'm struggling with what to do with foreign-language text containing italic text while following default rules on foreign-language italicization. Specifically, I'm working on Template:Translated blockquote. The default rules are described at Template:Lang#Automatic italics and defined at Module:Lang#L-996.
I have edited Template:Lang/with italics (permalink) as a proof-of-concept that can accept the following kinds of markup:
My implementation is really klunky, so this isn't an edit request. It just seemed easier for me to implement in the template rather than the Lua module. Questions:
Daask (talk) 20:08, 18 September 2024 (UTC)
Georgian italicsIn Langx, Georgian (code "ka") is currently italicized by default but shouldn't be, per WP:FOREIGNITALIC. — Goszei (talk) 22:54, 12 October 2024 (UTC)
Error when displaying Japanese textI don't know if this is the right place for a bug report, but instead of the Japanese text and romaji equivalent I get this message: "Lua error in Module:Lang at line 1422: attempt to concatenate a nil value.". The text was displaying correctly until I clicked on the donate button with the scroll-wheel (which opened the page in a new tab). Now any page I go on has this error message instead of the Japanese text, even when I refresh or close and reopen a page. I am using Firefox and Ecosia. Luu-meer (talk) 15:44, 13 October 2024 (UTC) Lua error in Module:Lang at line 1422: attempt to concatenate a nil valueThis error show on the page Wicked City (1987 film). 118.3.227.103 (talk) 15:40, 13 October 2024 (UTC)
merge language-specific templatesFor years I've wanted to create a We might:
No doubt I've missed something here, not the least of which is community approval to make this change. —Trappist the monk (talk)
Replace and delete the approximately 1145
{{lang-??}} templates listed at [[]] with the single template {{langx}} .
The
Like
BreakI've came across Template:Lang-az-Cyrl and Template:Lang-lmo-IT that aren't in Category:Lang-x templates (not sure why) and aren't in the TfD nomination. Should they be? --Gonnym (talk) 09:05, 30 September 2024 (UTC)
Moldovan CyrillicAn editor moved {{Lang-mo-Cyrl}} to {{Moldovan Cyrillic}}, which broke the documentation nicely. Many of the transclusions were replaced with the new name. It may need some special attention during the migration. – Jonesey95 (talk) 14:23, 9 October 2024 (UTC)
lang-en![]() {{langx}} shouldn't say "The non-English text to display." when |en| is allowed (as it should, since lang-en is being merged with it). Or at least "Text" shouldn't be a "Required field" as I can put "Literal translation". Web-julio (talk) 03:31, 19 October 2024 (UTC)
Helpful guide for when to use this versus |
Template | Languages | Scripts | Transliterations | Translation | Labels |
---|---|---|---|---|---|
{{Hani}}
|
Any | — | — | No | No |
{{CJKV}}
|
Yes | Always | |||
{{lang-zh}}
|
Chinese |
|
|
Yes | Optional |
{{Nihongo}}
|
Japanese | Japanese writing system[a] | Hepburn | Yes | Optional |
{{Nihongo2}}
|
Japanese | Japanese writing system[a] | — | No | No |
{{Korean}}
|
Korean |
|
Yes | Optional | |
{{Hanja}}
|
Korean | Hanja | — | No | Always |
{{Vi-nom}}
|
Vietnamese | Chữ Nôm | — | No | No |
{{Lang}}
|
Any | Any | Any | No | No |
{{Langx}}
|
Any | Any | Any | Yes | Optional |
- ^ a b c No parameter for giving a kana transcription; mixed orthography can be used.
- ^ A single "Korean" parameter—suitable for giving a Hangul transcription of a written word used in multiple languages, but not transcribing hanja in a Korean-specific context.
- ^ A single "Vietnamese" parameter—suitable for giving a transcription of a written word used in multiple languages, but not transcribing in a Vietnamese-specific context.
--HarJIT (talk) 13:54, 25 October 2024 (UTC)
extra params?
|anglicization=
/ |anglisation=
and |romanization=
/ |romanisation=
would be useful, |translation=
and |transliteration=
and |lit=
provide a translation, transliteration, and literal meaning; but if something has an older anglicization, that should also be available (ie. Crackow, etc), and a romanized form that is different from transliteration, because of some oddball or non-English choices in letter/character use, or because the language uses both latin and non-latin script, making the latin script version not a transliteration ; also for extended latin alphabets to basic latin alphabetic forms -- 65.92.246.77 (talk) 11:32, 30 October 2024 (UTC)
Missing languages
We need the ability to feed languages outside ISO, for example, such as Old West Norse, Old East Norse, Old Swedish, Early Modern Swedish, Late Modern Swedish, etc. Blockhaj (talk) 08:27, 30 October 2024 (UTC)
- No we do not, in my opinion. Remsense ‥ 论 09:19, 30 October 2024 (UTC)
- Ur reasoning? Why limit ourselfs. Blockhaj (talk) 10:34, 30 October 2024 (UTC)
- Same reason as always: it serves insufficient concrete benefit to editors or readers, while increasing technical, conceptual, and potentially epistemological complexity. At this level of diachronic granularity, whose schemas are we meant to use? There's a reason ISO took on the task of producing a standard for this to begin with, wouldn't you agree? Remsense ‥ 论 10:44, 30 October 2024 (UTC)
- I disagree with the argument "insufficient concrete benefit to editors or readers". Current limits are limiting in a bad way. I feel we should instead strive for commonality with Wiktionary, whos expanded schemas i propose we use. Blockhaj (talk) 11:23, 30 October 2024 (UTC)
- As you are locking in the argument that there are concrete issues to be solved, would you mind directly articulating what they are? Remsense ‥ 论 22:20, 30 October 2024 (UTC)
- I disagree with the argument "insufficient concrete benefit to editors or readers". Current limits are limiting in a bad way. I feel we should instead strive for commonality with Wiktionary, whos expanded schemas i propose we use. Blockhaj (talk) 11:23, 30 October 2024 (UTC)
- Same reason as always: it serves insufficient concrete benefit to editors or readers, while increasing technical, conceptual, and potentially epistemological complexity. At this level of diachronic granularity, whose schemas are we meant to use? There's a reason ISO took on the task of producing a standard for this to begin with, wouldn't you agree? Remsense ‥ 论 10:44, 30 October 2024 (UTC)
- Ur reasoning? Why limit ourselfs. Blockhaj (talk) 10:34, 30 October 2024 (UTC)
- If there is sufficient need, we can create IETF private use tags for languages not directly supported in the IANA language-subtag-registry file. The list of currently supported private-use tags is at Template:Lang § Private-use language tags.
- Language templates based on Module:Lang will not adopt the mishmash of nonstandard tags that are supported at wiktionary.
- —Trappist the monk (talk) 13:15, 30 October 2024 (UTC)
Private-use language tags
I propose the addition of the following private-use tags:
- Old East Norse: non-x-east
- Old Norwegian: nor-x-old
- Middle Norwegian: nor-x-middle
- Old Norwegian: nor-x-old
- Old West Norse: non-x-west
- Old Swedish: swe-x-old
- Early Modern Swedish: swe-x-ems
- Late Modern Swedish: swe-x-lms
- Early Modern Swedish: swe-x-ems
- Middle Danish: dan-x-middle
- Modern Danish: dan-x-modern
- Old Swedish: swe-x-old
Blockhaj (talk) 17:18, 1 November 2024 (UTC)
lang-my outputs tofu on my browser (FF)
I've been removing lang-my where I come across it because it turns burmese script into tofu. Not sure what the problem is, but assume it's forcing a script to display that I don't have installed. I have a number of burmese scripts, though, including generic ones like Noto, so display shouldn't be a problem. — kwami (talk) 09:26, 31 August 2024 (UTC)
- Don't do that without evidence that
{{lang-my}}
is at fault. Here are examples of differently written Burmese text:- မြန်မာအက္ခရာ ← plain text; no markup
- မြန်မာအက္ခရာ ←
<span>မြန်မာအက္ခရာ</span>
- မြန်မာအက္ခရာ ←
<span lang="my">မြန်မာအက္ခရာ</span>
- {{lang-my|မြန်မာအက္ခရာ}} ←
{{lang-my|မြန်မာအက္ခရာ}}
{{lang-my|မြန်မာအက္ခရာ}}
- For me, all of the above render correctly (win 10, chrome). Do any of the above render correctly for you?
- We have had discussions with you about fonts in the past:
- None of those discussions revealed a problem with
{{lang}}
, the various{{lang-xx}}
, or Module:Lang. - —Trappist the monk (talk) 13:54, 31 August 2024 (UTC)
- The results of 1 and 2 display correctly (as well as the code of all 5). lang="my" appears to be the problem, and lang-my appears to inherit that problem. — kwami (talk) 14:16, 31 August 2024 (UTC)
- It is your browser that interprets the
lang="my"
attribute. If it does not interpret the attribute correctly, you will get rubbish for a rendering. Here I have switched the language tags (don't do this in mainspace):- မြန်မာအက္ခရာ ←
<span lang="ja">မြန်မာအက္ခရာ</span>
–lang="my"
switched tolang="ja"
- မြန်မာအက္ခရာ ←
<span lang="ru">မြန်မာအက္ခရာ</span>
–lang="ru"
switched tolang="ru"
- မြန်မာအက္ခရာ ←
- For me, they both render correctly.
- —Trappist the monk (talk) 14:40, 31 August 2024 (UTC)
- Okay, it's my browser then. Formatting those as 'ja' or 'ru' works for me too, but 'my' ruins it. Bizarre that FF doesn't render 'my' by default. I'll look for overrides. Thanks. — kwami (talk) 15:13, 31 August 2024 (UTC)
- Huh, same for Geʽez script. A bit of tofu in the basic block; the subsequent blocks are completely tofu except for the last, the obscure Extended-B, which displays perfectly, just as the obscure Burmese block does. But in this case, changing the language setting to 'ja' or 'ru' doesn't help. — kwami (talk) 05:07, 6 October 2024 (UTC)
- I was reminded recently that it isn't the browser that maintains fonts but rather it is the operating system. When the browser wants to display something, it uses the operating system to do it. If your operating system doesn't support these fonts then no display. At Geʽez script, my browser (chrome, win 10) displays all of the unicode characters except those in Ethiopic Extended-B. These are from Ethiopic Extended-A and display correctly both as plain text and when marked up by
{{lang}}
:- ꬁꬂꬃꬄꬅꬆ ← plain text
- ꬁꬂꬃꬄꬅꬆ ←
<span title="Ge'ez-language text"><span lang="gez">ꬁꬂꬃꬄꬅꬆ</span></span>
←{{lang|gez|ꬁꬂꬃꬄꬅꬆ}}
- —Trappist the monk (talk) 13:56, 6 October 2024 (UTC)
- Thanks for that. What's weird is that I get the opposite results. I'd expect that anything that supports Extended-B would support anything earlier. If nothing past a certain point was displayed, I'd think I needed to update something. But its stuff earlier than a certain point that's the problem. — kwami (talk) 21:43, 6 October 2024 (UTC)
- Help:Multilingual support (Indic) might help. – Jonesey95 (talk) 03:45, 8 October 2024 (UTC)
- Thanks. — kwami (talk) 03:50, 8 October 2024 (UTC)
- Help:Multilingual support (Indic) might help. – Jonesey95 (talk) 03:45, 8 October 2024 (UTC)
- Thanks for that. What's weird is that I get the opposite results. I'd expect that anything that supports Extended-B would support anything earlier. If nothing past a certain point was displayed, I'd think I needed to update something. But its stuff earlier than a certain point that's the problem. — kwami (talk) 21:43, 6 October 2024 (UTC)
- I was reminded recently that it isn't the browser that maintains fonts but rather it is the operating system. When the browser wants to display something, it uses the operating system to do it. If your operating system doesn't support these fonts then no display. At Geʽez script, my browser (chrome, win 10) displays all of the unicode characters except those in Ethiopic Extended-B. These are from Ethiopic Extended-A and display correctly both as plain text and when marked up by
- It is your browser that interprets the
- The results of 1 and 2 display correctly (as well as the code of all 5). lang="my" appears to be the problem, and lang-my appears to inherit that problem. — kwami (talk) 14:16, 31 August 2024 (UTC)
{{lang-my}}
has been deleted; see Wikipedia:Templates_for_discussion/Log/2024_September_27/lang-??_templates. Calls to that template in this discussion have been disabled.
—Trappist the monk (talk) 19:20, 7 November 2024 (UTC)
tracking sr usage with issues
@Trappist the monk I noticed {{lang-sr}} was deleted after the bot replaced its usage, but it also had a couple of semantic problems previously discussed at Template talk:Lang-sr and Talk:Romanization of Serbian that were never resolved:
- a lot of text is marked as just "Serbian" but we don't know if it's Latin, in which case it should be italicized, or if it's Cyrillic, in which case it shouldn't
- for example the lead section of Belgrade has:
- Serbian: Београд / Beograd
- and the latter part of that fails MOS:FOREIGNITALIC
- for example the lead section of Belgrade has:
- its third parameter was sometimes used to show the other script, but would mark it as "romanization", which may or may not be good - when discussing 500-year-old sources it's probably fine, but when discussing something from the last 50 years it's basically very weird
- for example as it was before this fix:
- and there is no "romanization" in the latter half of the 20th century, the company's name in Latin was of the same significance as its name in Cyrillic
How can we address these now with langx? Can we get at least some tracking categories if these symptoms are detected, so they can be checked? --Joy (talk) 09:54, 8 November 2024 (UTC)
- If this is such a problem, why wasn't
{{lang-sr}}
deleted long ago? Didn't we create{{lang-x2}}
,{{lang-sr-Cyrl-Latn}}
, and{{lang-sr-Latn-Cyrl}}
specifically to address this issue? Also,{{lang-sr-Cyrl}}
and{{lang-sr-Latn}}
? - This crude search finds about 4900 articles that use
{{langx|sr|...}}
and this crude search finds about 1500 articles that have{{langx|sr|<parameter>|<another parameter>|...}}
.<another parameter>
could be a named parameter or a 'transliteration'. - I am opposed to one-off special-case code. Module:Lang/langx has a list of unsupported language tags. Use of
{{langx}}
with any of those tags adds the page to Category:Langx uses unsupported language tag. I will addsr
to that list. In future, some of the currently unsupported language tags will be converted to supported private use tags. After that, I expect that the module will be tweaked so that the remaining unsupported language tags will cause the module to emit error messages. - —Trappist the monk (talk)
14:26, 8 November 2024 (UTC)15:19, 8 November 2024 (UTC) additional templates- I would guess the reason is that nobody in the know really wanted to create a TfD that would have required a check and possibly a change to 5k articles when lang-sr can be perfectly fine if the input text is only one Cyrillic parameter. We don't want to emit error messages to readers for that. How can we best manage this process of converting to different tags?
- BTW I also noticed that the old template had code to add Category:Instances of Lang-sr using second unnamed parameter since 2016, so the removal of this part is a bit of a regression. --Joy (talk) 16:55, 8 November 2024 (UTC)
- The day after I created Module:Lang/langx, I made myself a TODO-note wondering if
{{langx}}
couldn't auto-italicize in a manner similar to{{lang}}
. Sometime later I wrote a hack to do just that. I have moved that hack into Module:Lang/sandbox. What the{{langx/sandbox}}
renderings look like compared to the live{{lang}}
and{{langx}}
template renderings can be seen in this version of my sandbox (permalink). The hack should probably be rewritten so that Module:Lang will work for those other-language wikis that don't / won't support{{langx}}
. Any{{lang-??}}
templates that remain after the conversion will need to be checked to ensure that they continue to work as they were intended. - —Trappist the monk (talk) 20:44, 8 November 2024 (UTC)
- OK so if I read that right, overall the outcome would be that Serbian Latin would be italicized, and combinations still need manual interventions en masse? --Joy (talk) 21:41, 8 November 2024 (UTC)
- Of course, but you knew that. The new:
{{langx|sr|Београд / Beograd|lit=White City}}
- is just as broken as the old:
{{lang-sr|Београд / Beograd|lit=White City}}
- which is why you wrote
{{lang-sr-Cyrl-Latn}}
and its companions: - I imagine that you might write an awb script that is sufficiently clever to create
{{lang-sr-Cyrl-Latn}}
from{{langx|sr|Београд|Beograd|White City}}
. Mayhaps even from{{langx|sr|Београд / Beograd|lit=White City}}
. - —Trappist the monk (talk) 23:01, 8 November 2024 (UTC)
- Okay, but none of this addresses my original point - how do we find them first. This issue may affect sr, sh, cnr and uz IIRC, can't we just have a tracking category for this whole class of lang-x2 languages? --Joy (talk) 10:19, 9 November 2024 (UTC)
- Did I not suggest how to find articles that use
{{langx|sr|...}}
? Repeating the second of those suggested searches here with similar searches for the other three language tags: - I am opposed to special-case code.
- —Trappist the monk (talk) 19:41, 9 November 2024 (UTC)
- I mean we can genericize it even further - Category:Articles containing Serbian-language text shows 20.5k, why wouldn't we simply distinguish those 1.5k... and in turn why not have a tracking category for labeled vs. not labeled for each language. Is there a particular cost to having two subcategories instead of just one? --Joy (talk) 21:33, 9 November 2024 (UTC)
- I have written a simple awb script that trawls the search results above and lists those articles that have
{{langx}}
templates that are candidates for conversion to{{lang-<tag>-Cyrl-Latn}}
. I have put the four lists in your user space; see User:Joy/candidate articles for lang-xx-Cyrl-Latn. - —Trappist the monk (talk) 19:05, 10 November 2024 (UTC)
- I have written a simple awb script that trawls the search results above and lists those articles that have
- I mean we can genericize it even further - Category:Articles containing Serbian-language text shows 20.5k, why wouldn't we simply distinguish those 1.5k... and in turn why not have a tracking category for labeled vs. not labeled for each language. Is there a particular cost to having two subcategories instead of just one? --Joy (talk) 21:33, 9 November 2024 (UTC)
- Did I not suggest how to find articles that use
- Okay, but none of this addresses my original point - how do we find them first. This issue may affect sr, sh, cnr and uz IIRC, can't we just have a tracking category for this whole class of lang-x2 languages? --Joy (talk) 10:19, 9 November 2024 (UTC)
- Of course, but you knew that. The new:
- OK so if I read that right, overall the outcome would be that Serbian Latin would be italicized, and combinations still need manual interventions en masse? --Joy (talk) 21:41, 8 November 2024 (UTC)
- The day after I created Module:Lang/langx, I made myself a TODO-note wondering if
Next steps?
Nice job with clearing and deleting all the templates from the TfD!
From the left over templates, we have
- those at Category:Lang-x templates with other than ISO 639. I think that if we aren't planning on deleting them, then we should support them with the private use range.
- templates with IPA support like Template:Lang-rus. Can we add
|ipa=
support built-in to the module?
Another question which I have is regarding the script templates at Category:Script–font templates. If font support is needed for specific languages, why don't we support it via the module? Is the text less clear with us not always using it? Are some of these outdated with newer Unicode support?
Regarding #Tracking categories, I think making the difference between lang and langx only being the label is the right way to handle this, as the label=no situation is not only unnecessary code in text, but it also disables all other labels. Gonnym (talk) 10:11, 12 November 2024 (UTC)
- Of the templates originally in Category:Lang-x templates with other than ISO 639, several have been converted to be usable by
{{lang}}
and{{langx}}
:- Template:Lang-ast-leo → Leonese: text → added
ast-ES
language tag (used internally by{{lang}}
) to Module:Lang/data - Template:Lang-az-Arab → [text] Error: {{Langx}}: Latn text/non-Latn script subtag mismatch (help) →
az-Arab
is a properly formed IETF language tag that was ignored by wrapped{{Language with name}}
template - Template:Lang-fr-gallo → Gallo: text → added
fr-gallo
to Module:Lang/data - Template:Lang-fra-que → Canadian French: text → added
fr-CA
to Module:Lang/data - Template:Lang-ku-Cyrl → [text] Error: {{Langx}}: Latn text/non-Latn script subtag mismatch (help) →
ku-Cyrl
is a properly formed IETF language tag; converted from{{Language with name}}
- Template:Lang-lmo-IT → Bergamasque: text → added
lmo-x-berg
to Module:Lang/data - Template:Lang-oc-gascon → Gascon: text →
oc-gascon
is a properly formed IETF language tag ignored by wrapped{{Language with name}}
- Template:Lang-ast-leo → Leonese: text → added
- which leaves us with these:
- Template:Lang-1ca – Old Anatolian Turkish is a defunct Turkic language; private use tag might be possible:
trk-x-oldanat
; don't know iftrk
is the right base tag - Template:Lang-est-sea – Seto is a dialect of Estonian; private use tag might be possible:
et-x-seto
- Template:Lang-fra-frc – private use tag might be possible:
fr-x-frainc
- Template:Lang-1ca – Old Anatolian Turkish is a defunct Turkic language; private use tag might be possible:
- These are not languages so we probably ought not support them with Module:Lang; that being the case, these templates don't belong in Category:Lang-x templates with other than ISO 639:
- Template:Lang-sq-definite – definiteness is a linguistic construct
- Template:Lang-uniturk – Uniform Turkic Alphabet is a writing system
- Template:Lang-vi-chunom – chữ Nôm is a writing system; applies custom styling with
{{Vi-nom}}
- Template:Lang-vi-hantu – chữ Hán is a writing system; applies custom styling with
{{Vi-nom}}
- I don't currently have an opinion about styling templates. I suspect that there are editors who will demand styling because they prefer the styled for over the default form:
- I suspect that there would be a deal of work to be done were we to attempt to consolidate the various scripts and their (sometimes) attendant css files.
- I don't really understand what you mean by your #Tracking categories comment. And, if that comment was a continuation of that other discussion, doesn't the comment belong there?
- —Trappist the monk (talk) 19:06, 12 November 2024 (UTC)
- Nice, good job again on shortening the list!
- Regarding
1ca
, looking at the article,trk
seems the most correct. est-sea
's linguage in the article seems a bit confusing. It says it's a South Estonian but that article's infobox does not list Estonian as a parent (the lead does though). It's most recent parent according to the infobox is Võro language. Not sure ifet-x-seto
is the most correct.fr-x-frainc
seems good.- Regarding script templates, I thought the reason was not just visible preference but because it renders it correctly, but maybe that isn't true, or always true. I think though that it's probably better for the wiki if we use consistent fonts so we don't have instances of the the above Hebrew translation which look different, even on the same page. It will also make for shorter code on the pages themselves if we don't need to apply the script template manually.
- Some templates that use script and currently can't be merged: Template:Lang-ku-Arab
- Others:
- Template:Lang-ka and Template:Transl-grc usages can be converted if we support an automatic transliteration (
|auto=yes
or something), which will call their respected templates (if they exist). - Template:Lang-rus can be converted if we support
|IPA=
or, if we remove support of IPA from outside that template. In general though, I don't think it's smart of us to have lang-rus around as that's an opening for yet another batch of templates created in similar style.
- Template:Lang-ka and Template:Transl-grc usages can be converted if we support an automatic transliteration (
- Regarding
- Gonnym (talk) 10:59, 13 November 2024 (UTC)
- Nice, good job again on shortening the list!
auto italics for {{langx}}
At present, {{langx}}
uses a list of language tags scraped from those now deleted {{lang-??}}
templates that called lang_xx_inherit()
. That function sets the initial rendering style for a {{lang-??}}
template to upright. The list of tags is in Module:Lang/langx at lines 1–536 (permalink).
In the sandbox, I have adapted the auto italics code used by {{lang}}
so that we aren't limited by the hard-coding in the inherit_t
list. Serbian is a good example. That language gives equal status to Cyrillic and Latin text. Currently, the live version of {{langx|sr|<text>}}
renders <text>
in an upright font regardless of script. The proposed sandbox version renders Cyrillic <text>
in an upright font and Latin <text>
in an italic font. {{lang}}
renderings here for reference:
- српски језик ←
{{lang|sr|српски језик}}
- Serbian: српски језик ←
{{langx|sr|српски језик}}
- Serbian: српски језик
uncoded: MooMoo is the best cow ← {{langx/sandbox|sr|српски језик}}
- srpski jezik ←
{{lang|sr|srpski jezik}}
- Serbian: srpski jezik ←
{{langx|sr|srpski jezik}}
- Serbian: srpski jezik
uncoded: MooMoo is the best cow ← {{langx/sandbox|sr|srpski jezik}}
Without objection, I shall update the live version of the module to support auto italics.
—Trappist the monk (talk) 23:28, 12 November 2024 (UTC)
- Good idea on making the source of information of both styles the same. Gonnym (talk) 11:03, 13 November 2024 (UTC)
lang error that currently can't be fixed within the template
At Adoptionism#Ebionites (and I've seen this issue in many other places), the code used is {{lang|hbo|אביונים|ebyonim}}
, this produces an error as {{lang}} does not support transliteration. This can be fixed by changing to use {{langx}}, however the label it will produce for the language isn't wanted there. |label=none
can be used, but then it also removes the label for the romanization, which is wanted there. One can remove the transliteration outside the template, but that just defeats the purpose of the template.
What should happen in my opinion, and I've said this somewhere in one of the above sections, is that {{lang}} and {{langx}} should have the same secondary features regarding transliteration and literal translation, with the difference being that Langx produces a language label and Lang does not (but does produce labels for the other parts). Gonnym (talk) 17:00, 14 November 2024 (UTC)
Tracking categories
Could you add the following tracking categories to the module?
- Unknown parameters (Module:Check for unknown parameters or manually)
- When langx is used with
|label=none
, since that usage should just be converted to lang instead.
Gonnym (talk) 08:30, 14 October 2024 (UTC)
- We might do an unsupported parameters test in future.
- We might create a maint cat for
|label=none
, but:{{lang-es|casa|lit=house|label=none}}
→ {{lang-es|casa|lit=house|label=none}}{{langx|es|casa|lit=house|label=none}}
→ casa, 'house'{{lang|es|casa|lit=house}}
→ [casa] Error: {{Lang}}: invalid parameter: |lit= (help)
- There is a set of parameters that are common to both
{{lang}}
and{{langx}}
:|code=
,{{{1}}}
,|text=
,{{{2}}}
,|rtl=
,|italic=
,|italics=
,|i=
,|size=
,|proto=
,|nocat=
,|cat=
- We must not categorize any
{{langx}}
with|label=none
that uses parameters not supported by{{lang}}
:|translit=
,|translit-std=
,|translit-script=
,|translation=
,|lit=
,{{{4}}}
,|label=
,|link=
,|script=
,|region=
,|variant=
,|engvar=
- —Trappist the monk (talk) 14:27, 14 October 2024 (UTC)
- It's great that you still know the ins and outs of this module. I really only thought the difference between these two templates is the existence of a label, not that langx has other unique features. Gonnym (talk) 14:32, 14 October 2024 (UTC)
- Related to this, is the fact that these features aren't offered for lang a deliberate decision? Gonnym (talk) 14:35, 14 October 2024 (UTC)
- If a deliberate decision taken, I was not party to it. My goal when creating Module:Lang was to provide a uniform support structure for as many
{{lang-??}}
templates as possible. The commonalities between{{lang}}
and the{{lang-??}}
were not considered except to reuse code that supports both. - Before you suggest it, I'm not interested in thinking about expanding the
{{lang}}
parameter set; too much other going on right now. Let us first finish consolidating{{lang-??}}
into{{langx}}
. - —Trappist the monk (talk) 14:52, 14 October 2024 (UTC)
- If a deliberate decision taken, I was not party to it. My goal when creating Module:Lang was to provide a uniform support structure for as many
- Related to this, is the fact that these features aren't offered for lang a deliberate decision? Gonnym (talk) 14:35, 14 October 2024 (UTC)
- It's great that you still know the ins and outs of this module. I really only thought the difference between these two templates is the existence of a label, not that langx has other unique features. Gonnym (talk) 14:32, 14 October 2024 (UTC)
- I suggested earlier that
[we] might do an unsupported parameters test in future
. I have implemented that:{{lang/sandbox|ar|نص العنصر النائب|script=Arab}}
→ [نص العنصر النائب] Error: {{Lang}}: invalid parameter: |script= (help)
|script=
,|region=
, and|variant=
parameters are not supported by{{lang}}
because those IETF subtags can/should be part of the language tag. This same should also apply to{{langx}}
but because we didn't think about this while Monkbot/task 20 was running we may be stuck with these as{{langx}}
parameters. On the other hand, these searches:- suggest that we might deprecate these parameters. We could write an awb script to create proper IETF language tags from the
|code=
/|script=
/|region=
/|variant=
subtag parameters and then remove support for them. I have added|script=
/|region=
/|variant=
parameter detection to{{langx}}
which will add a maintenance message and Category:Langx deprecated parameters when any of these parameters are used:{{langx/sandbox|es|region=419|Casa}}
→ [Casa] Error: {{Langx}}: invalid parameter: |region= (help)
uncoded: MooMoo is the best cow
- Once cleared, that maint category and message go away to be replaced with the invalid parameter error message.
- For completeness, these searches for
{{lang}}
with|script=
,|region=
, and|variant=
parameters: - (all articles returned by these searches will end up in Category:Lang and lang-xx template errors)
- —Trappist the monk (talk) 17:15, 13 November 2024 (UTC)
- Is the fix for the above to move the value from the script/region/variant to the code area? So
ar-Arab
? Gonnym (talk) 18:34, 13 November 2024 (UTC)- Yes – except that
Arab
is not a valid script subtag forar
:{{lang/sandbox|ar-Arab|نص العنصر النائب}}
→ [نص العنصر النائب] Error: {{Lang}}: script: arab not supported for code: ar (help)
- but:
{{lang/sandbox|ar|Placeholder text|script=Latn}}
→{{lang/sandbox|ar-Latn|Placeholder text}}
→<span title="Arabic-language text"><i lang="ar-Latn">Placeholder text</i></span>
→ Placeholder text
- —Trappist the monk (talk) 18:52, 13 November 2024 (UTC)
- Is
|rtl=
used by langx or does it detect automatically the languages that use that? Gonnym (talk) 16:53, 14 November 2024 (UTC)- When certain scripts are specified (see here),
{{lang}}
and{{langx}}
will applydir="rtl"
:{{langx|es-Arab|text}}
→[text] <span style="color:#d33">Error: {{Langx}}: Latn text/non-Latn script subtag mismatch ([[:Category:Lang and lang-xx template errors|help]])</span>
→ [text] Error: {{Langx}}: Latn text/non-Latn script subtag mismatch (help)
- When certain languages are specified (see here),
{{langx}}
will applydir="rtl"
:{{langx|ydg|text}}
→[[Yidgha language|Yidgha]]: <i lang="ydg" dir="rtl">text</i>
→ Yidgha: text
- These lists are not comprehensive. I suspect that
dir="rtl"
is rarely actually needed except in cases where the browser gets confused (ltr digits mixed with rtl text) so the ~/langx mechanism can probably go away; maybe the ~/data list too. - —Trappist the monk (talk)
17:43, 14 November 2024 (UTC)18:59, 14 November 2024 (UTC) fix ~/langx link
- When certain scripts are specified (see here),
- Is
- Yes – except that
- Is the fix for the above to move the value from the script/region/variant to the code area? So
Use in headers
If there is non-English text in section headers, should we use this template? E.g. == Hello ({{lang|ko|안녕}}) ==
seefooddiet (talk) 23:31, 15 November 2024 (UTC)
- Isn't this a question for the appropriate WP:MOS talk page? Templates and wikilinks are discouraged in section headings; see MOS:HEADINGS.
{{lang}}
is a template and, unless|nocat=yes
will create a category wikilink. I can imagine that we could make{{lang}}
subst-able in a way that it knows that it is being subst'd so won't emit a category. Once subst'd you'd end up with a header that looks like this:== Hello (
<span title="Korean-language text"><span lang="ko">안녕</span></span>
) ==
- I don't know if there are any rules regarding html markup in headings so posing your question elsewhere would be a good idea. Start at WT:MOS?
- —Trappist the monk (talk) 00:24, 16 November 2024 (UTC)
text/script mismatch
I've been picking away at Category:Langx deprecated parameters and noticed multiple instances of {{lang}}
and {{langx}}
templates where <text>
does not match the script specified by the script subtag. For example, this:
{{langx|tly-Latn|Фәхрәддин Әбосзодә}}
→ [Фәхрәддин Әбосзодә] Error: {{Langx}}: Non-latn text (pos 1: Ф)/Latn script subtag mismatch (help)
In that template, <text>
is clearly not Latn
script but {{langx}}
doesn't notice and so incorrectly renders <text>
in italic form.
So, in the sandbox, I've fixed that, at least partially. To support auto-italics, Module:Lang evaluates <text>
to see if it is wholly Latn script. When it is not, <text>
is rendered upright (unless overridden by |italic=
). Since we know that <text>
is or is not Latn script, we can check the script subtag (if present) to see that it is appropriate. In the example above, the Cyrillic <text>
does not match the -Latn
subtag.
Conversely, when <text>
is Latn script, a mismatch exists when the script subtag is not -Latn
:
{{langx|tly-Cyrl|Text}}
→ [Text] Error: {{Langx}}: Latn text/non-Latn script subtag mismatch (help)
Again {{langx}}
does not notice so <text>
is incorrectly rendered in upright form.
Fixed in the ~/sandbox:
{{langx/sandbox|tly-Latn|Фәхрәддин Әбосзодә}}
→ [Фәхрәддин Әбосзодә] Error: {{Langx}}: Non-latn text (pos 1: Ф)/Latn script subtag mismatch (help)
uncoded: MooMoo is the best cow
{{langx/sandbox|tly-Cyrl|Text}}
→ [Text] Error: {{Langx}}: Latn text/non-Latn script subtag mismatch (help)
uncoded: MooMoo is the best cow
Same applies to {{lang}}
so:
{{lang/sandbox|tly-Latn|Фәхрәддин Әбосзодә}}
→ [Фәхрәддин Әбосзодә] Error: {{Lang}}: Non-latn text (pos 1: Ф)/Latn script subtag mismatch (help){{lang/sandbox|tly-Cyrl|Text}}
→ [Text] Error: {{Lang}}: Latn text/non-Latn script subtag mismatch (help)
Without objection, I shall implement this in the live module.
—Trappist the monk (talk) 16:15, 17 November 2024 (UTC)
Category renames
Now that almost all lang-xx have been deleted, the categories should be renamed to "Lang and langx".
Also, Template:My has ended in deletion, so if the bot can help with that replacement it would be great. Gonnym (talk) 16:20, 18 November 2024 (UTC)
- Switching
{{my}}
to{{lang}}
is outside of the Monkbot/task 20 remit. One might write an awb task to do the job though I notice that there are others already doing the work. Unless{{my}}
lingers for longer than it should (don't know how long that is) I guess I wouldn't worry about it. - Yeah, categories should be renamed. I suppose that can happen at any time so long as it happens at about the same time that we update Module:Lang to use the new names. The module should continue to support the existing names for those wikis that don't support
{{langx}}
. - —Trappist the monk (talk) 17:09, 18 November 2024 (UTC)
fn lang_xx_inherit parameter values removed
Trappist the monk recently did a major overhaul of Module:Lang in order to implement Template:Langx. (Thanks!) In the process, he removed |fn=lang_xx_inherit
, |fn=lang_xx_italic
, and |fn=lang
from Module:Lang as "no longer required". However, this broke Template:Translated blockquote, which depended on this feature, and is used in mainspace articles.
Based on the old documentation, I believe this documents the equivalent replacements:
Old code | New code |
---|---|
{{Lang |
{{Lang |
{{Lang |
{{Langx |
{{Lang |
{{Langx |
Please correct me if the old and and new code columns above are not exactly equivalent. I thought I would document this here in case any other template editors experienced similar errors from the removal of this functionality. I have yet to fix Template:Translated blockquote but plan on it in the next few days. Daask (talk) 21:03, 18 November 2024 (UTC)
- Restored in Module:Lang/sandbox.
|fn=lang_xx_inherit
and|fn=lang_xx_italic
were created so that editors didn't have to create yet another{{lang-??}}
template;|fn=lang
just came along for the ride. With the advent of{{langx}}
that generic use is no longer required. - We don't check parameter use for the useful utilities:
|fn=is_ietf_tag
,|fn=is_lang_name
,|fn=name_from_tag
, and|fn=tag_from_name
;name_from_tag
shown here for completeness. - Test the fix in
{{Translated blockquote/sandbox}}
by switching{{lang}}
to{{lang/sandbox}}
. - —Trappist the monk (talk) 00:15, 19 November 2024 (UTC)
- @Trappist the monk: Template:Lang/sandbox, and Template:Translated blockquote/sandbox, which now uses it, work as expected. Do you intend to restore these features to Template:Lang? Daask (talk) 14:24, 19 November 2024 (UTC)
- Yeah, I think I have to. Some version of Module:Lang is used on ~160 MediaWiki sites. There may be sites that rely on
|fn=
. - —Trappist the monk (talk) 15:15, 19 November 2024 (UTC)
- Yeah, I think I have to. Some version of Module:Lang is used on ~160 MediaWiki sites. There may be sites that rely on
- @Trappist the monk: Template:Lang/sandbox, and Template:Translated blockquote/sandbox, which now uses it, work as expected. Do you intend to restore these features to Template:Lang? Daask (talk) 14:24, 19 November 2024 (UTC)
Putting lang inside of langx?
I was curious if there is any point of putting lang inside of langx? for examples, see any of these. these are all single nestings, but I have also see cases with multiple {{lang}} inside of one {{langx}}. Frietjes (talk) 15:44, 19 November 2024 (UTC)
- None that I can think of unless the editor felt that the tool-tip was a requirement. Regardless, such constructs result in improper html and pointless category link duplication. For example:
{{langx|ain|{{lang|ain-Kana|アィヌ}}}}
→[[Ainu language|Ainu]]: <span lang="ain"><span title="Ainu (Japan)-language text"><span lang="ain-Kana">アィヌ</span></span>[[Category:Articles containing Ainu (Japan)-language text]]</span>[[Category:Articles containing Ainu (Japan)-language text]]
- the first category link (in English) is marked up as Ainu.
- The above was a conversion from:
{{lang-ain|アィヌ}}, {{transl|ain|Aynu}}
- to:
{{lang-ain|{{lang|ain-Kana|アィヌ}}, {{lang|ain-Latn|Aynu}}
- at this edit by SrpskiAnonimac.
- I can see no real useful reason why
{{lang}}
/{{langx}}
should be nested. Don't do that. - The fix for the above, as it currently exists in Ainu people § Names, is:
{{langx|ain-Kana|アィヌ}}
→ Ainu: アィヌ
- For others like this one from Roman province § Republican period where the two language tags are different:
{{langx|el|{{lang|grc|ἐπαρχίᾱ}}}}
- the fix is to use the language tag that directly wraps the text (no doubt there will be exceptions):
{{langx|grc|ἐπαρχίᾱ}}
→ Ancient Greek: ἐπαρχίᾱ
- —Trappist the monk (talk) 16:51, 19 November 2024 (UTC)
Errors in the template documentation
I am seeing what I believe are new errors in the template documentation. In the table headed "Langx |italic= parameter operation", I see many cells with output like "script= (help)". I suspect that an unescaped pipe in the error message output may be causing something unwanted to happen. – Jonesey95 (talk) 15:06, 20 November 2024 (UTC)
- Yep, fixed.
- —Trappist the monk (talk) 15:24, 20 November 2024 (UTC)
- Much better; thank you. – Jonesey95 (talk) 19:04, 20 November 2024 (UTC)