Module talk:Wikt-lang

Italicisation of Halkomelem

 * This discussion moved to Template talk:Lang, as it pertains to .

missing data?
Am I mistaken, or should every language tag that is listed in the  table have both of   and   entries? If that is so then:

these are missing :

these are missing : In the above list the language names are the names that Module:Lang associates with the language tag. When a second name is listed, Module:Lang and Wiktionary definitions of the language tag disagree. In the case of the IETF-like language tags, Module:lang does not support extlangs and the extlangs that Wiktionary uses are not defined in the IANA language-subtag-registry file. Wiktionary names used above were taken from one of: Am I mistaken? Is there a reason that these language tags do not have both of  and  ?
 * –, wikt: Rwanda-Rundi
 * –, wikt: Penobscot
 * –, wikt: Egyptian
 * –, wikt: Montagnais
 * –, wikt: Proto-Celtic
 * –, wikt: East Central German
 * –, wikt: German Low German
 * –, wikt: Proto-Slavic
 * –, wikt: Penobscot
 * –, wikt: Egyptian
 * –, wikt: Montagnais
 * –, wikt: Proto-Celtic
 * –, wikt: East Central German
 * –, wikt: German Low German
 * –, wikt: Proto-Slavic
 * –, wikt: Montagnais
 * –, wikt: Proto-Celtic
 * –, wikt: East Central German
 * –, wikt: German Low German
 * –, wikt: Proto-Slavic
 * –, wikt: Proto-Celtic
 * –, wikt: East Central German
 * –, wikt: German Low German
 * –, wikt: Proto-Slavic
 * –, wikt: East Central German
 * –, wikt: German Low German
 * –, wikt: Proto-Slavic
 * –, wikt: Proto-Slavic
 * wikt:Module:languages/data/3/a
 * wikt:Module:languages/data/3/b
 * wikt:Module:languages/data/3/e
 * wikt:Module:languages/data/3/f
 * wikt:Module:languages/data/3/g
 * wikt:Module:languages/data/3/j
 * wikt:Module:languages/data/3/m
 * wikt:Module:languages/data/3/o
 * wikt:Module:languages/data/exceptional

—Trappist the monk (talk) 15:50, 14 December 2023 (UTC)
 * @Editor Erutuon: you are (apparently) the original author of this module. Do you have an answer for my questions?
 * —Trappist the monk (talk) 20:32, 17 December 2023 (UTC)
 * It's been a long time since I looked at this module. It doesn't currently use the  field in any code that can be invoked by a template.  uses the   field, but it's orphaned and apparently I never tested it, because it would give a "tried to concatenate nil" error for language codes that don't have an   field or don't have a   or   field. I think I meant to use it in another invokable module function that would prepend the language name like  does, and never got around it. But it would probably be better to have Module:lang generate that language name. So for now the   field is unnecessary.
 * The  field is used to specify the canonical name (the name of the language used in level-2 headers in Wiktionary entries). If I remember right, in the code that is invoked by templates, it is only needed when   doesn't return the canonical name. Thus,   doesn't have a   field because   returns , the canonical name; but   has a   field with the canonical name   because   returns   and   has   because   returns nil.
 * The  fields are incomplete because I hadn't worked out how to fully populate the list of idiosyncratic Wiktionary language names and keep it up to date. There's no way for Lua modules on Wikipedia to access data modules on Wiktionary, so unless someone manually copies modules from Wiktionary to Wikipedia every time there is a change, the syncing would have to be done with JavaScript or an off-wiki script.
 * We don't use real extlang subtags on Wiktionary or IETF language tags, but only use idiosyncratic codes identifying languages that can have entries, or language families, or variants (dialects for instance) of languages or language families, or variants of variants. This Wikipedia module only cares about languages that have entries. (It could also be made to handle codes of variants of those languages, if we wanted to figure that out; they are listed in wikt:Module:etymology languages/data along with variants of language families.) Some languages that have entries use ISO 639 language codes (probably sometimes with a different circumscription from what ISO prescribes), and others use codes that are sequences of two or three sequences of two or three letters joined by hyphens. (The codes for languages that have entries all match a regex, but according to this table, most hyphenated codes have segments of three letters.) There's logic to how the language codes are made, such as that the first segment is usually an existing code, but as far as I know, those making Wiktionary language codes never look at the IANA subtag registry.
 * Wiktionary puts these idiosyncratic language codes in  attributes in the HTML. When they happen to be valid IETF language tags (as many are), it's because Wiktionary uses an ISO language code and the IANA registry also uses it. There has been talk about translating Wiktionary language codes into IETF tags, but no work on it so far. If Wiktionarians do that, we'll have to come up with some private-use tags, as Wikipedia has done with , and it could simplify things if Wiktionary and Wikipedia use the same private-use tags.
 * Anyway, that's a lot of background information. Syncing the  field from the Wiktionary language data modules requires 1. grabbing all the pairs of codes and canonical names of languages that have entries from wikt:Module:languages/code to canonical name (this can't be done in Lua on Wikipedia), 2. filtering out the names that are equal to the output of , 3. writing the remaining codes and names to a new data module on Wikipedia (separate from Module:Language/data, which contains some data that has to be manually edited), 4. making this module use the new data module. The   field could then be removed from Module:Language/data. There are several other problems in this module, but this would solve the   problem. — Eru·tuon 21:49, 17 December 2023 (UTC)
 * Ah, thank for that. My purpose is to add a level-2-header anchor to a wiktionary interwiki link.  With what you've written above, it looks like a two step process.  Step one is to query Module:Language/data for the Wiktionary preferred name.  When that query returns , then step two: attempt to fetch the language name from MediaWiki using  .  When both fail, use the value in anchor if present and emit an error category; when anchor is missing or empty, emit an error message and an error category so that the underlying data can be fixed.  It ain't pretty but it will work I think.
 * —Trappist the monk (talk) 23:38, 17 December 2023 (UTC)
 * Looks good. That's roughly what does already, apart from not having a anchor parameter. — Eru·tuon 22:06, 30 December 2023 (UTC)

Samaritan
example (the code for Samaritan Hebrew language) adds a page to Category:Articles containing Samaritan-language text but Samaritan language redirects to Samaritan Aramaic language sam. -- Error (talk) 20:06, 17 January 2024 (UTC)
 * That is not a 'failing' of Module:Language (because that module is not used by ). It may be a failing of Module:Lang which when queried gives these results:
 * The ISO 639-3 custodian assigns  to Samaritan.  Similarly, the IANA language-subtag-registry file also assigns   to Samaritan.  Apparently, no one at en.wiki has cared enough about which article is linked when   is used in  to gain a consensus to override the ISO 639-3 name or to repoint the Samaritan-language-redirect so that it points elsewhere.
 * Issues involving, , and other templates that use Module:Lang, should be discussed at Template talk:Lang, not here. Where is it best to discuss repointing the Samaritan-language-redirect?  I don't know, except to say that such discussion should not be here.
 * —Trappist the monk (talk) 20:48, 17 January 2024 (UTC)
 * Thanks. Asked at Template talk:lang --Error (talk) 01:23, 18 January 2024 (UTC)
 * The ISO 639-3 custodian assigns  to Samaritan.  Similarly, the IANA language-subtag-registry file also assigns   to Samaritan.  Apparently, no one at en.wiki has cared enough about which article is linked when   is used in  to gain a consensus to override the ISO 639-3 name or to repoint the Samaritan-language-redirect so that it points elsewhere.
 * Issues involving, , and other templates that use Module:Lang, should be discussed at Template talk:Lang, not here. Where is it best to discuss repointing the Samaritan-language-redirect?  I don't know, except to say that such discussion should not be here.
 * —Trappist the monk (talk) 20:48, 17 January 2024 (UTC)
 * Thanks. Asked at Template talk:lang --Error (talk) 01:23, 18 January 2024 (UTC)
 * Thanks. Asked at Template talk:lang --Error (talk) 01:23, 18 January 2024 (UTC)

Mis-italicization
This should not be applying italics automatically in the case of, only for non-English material (MOS:FOREIGN, MOS:ITALICS). If an English-language term is being used in a words-as-words manner, it can be italicized manually or by a template parameter. — SMcCandlish ☏ ¢ 😼  18:22, 25 June 2024 (UTC)
 * I have hacked Module:Language/sandbox to create a common function (permalink) that chooses how the 'text' is rendered. Default rendering is:
 * Latn-script text is rendered in italic except when
 * the language tag is  (English text renders in upright font)
 * no
 * English text may be rendered in italics for MOS:WORDSASWORDS by setting yes (or  or  )
 * non-Latn-script text is rendered in upright font except when
 * yes (or  or  )
 * See Template:Wikt-lang/testcases.
 * Keep? Discard?
 * —Trappist the monk (talk) 19:50, 27 June 2024 (UTC)
 * —Trappist the monk (talk) 19:50, 27 June 2024 (UTC)

Requested move 9 July 2024

 * The following is a closed discussion of a requested move. Please do not modify it. Subsequent comments should be made in a new section on the talk page. Editors desiring to contest the closing decision should consider a move review after discussing it on the closer's talk page. No further edits should be made to this discussion.

The result of the move request was: moved. Admin: Please double check the subpages associated with this page to ensure nothing else needs to be moved, otherwise it looks like this should be fairly straightforward. (closed by non-admin page mover) ASUKITE  17:42, 17 July 2024 (UTC)

Module:Language → Module:Wikt-lang – This module has a very misleading name. It is solely used to create Wiktionary links with a language anchor, and should not be confused with Module:Lang which is used for most other language related usages. This move will match the template name at Template:Wikt-lang. Gonnym (talk) 12:31, 9 July 2024 (UTC)


 * Note: not all of the /data sub-modules actually belong to the module so will need to be checked when disentangling this. Gonnym (talk) 12:34, 9 July 2024 (UTC)
 * @Gonnym or whoever understands how these work, from digging through the subpages the only one I found that didn't mention Wiktionary was Module:Language/data/iso 15924 and its doc page, would those potentially need to be moved to Module:Lang/data/iso 15924? ASUKITE  16:27, 17 July 2024 (UTC)
 * No. Module:Language/data/iso 15924 is not a submodule of Module:Lang.  Do not move it there.
 * —Trappist the monk (talk) 16:35, 17 July 2024 (UTC)
 * Thanks, that was the only one that was unclear, don't want us to break anything! ASUKITE  16:38, 17 July 2024 (UTC)
 * Rename per nom. * Pppery * it has begun... 16:10, 9 July 2024 (UTC)

The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

Uncaught error
Currently using the template without a text value produces a Lua error -. This should be more gracefully handled like the error in line 248. Gonnym (talk) 12:14, 19 July 2024 (UTC)
 * Caught:
 * —Trappist the monk (talk) 13:53, 19 July 2024 (UTC)
 * —Trappist the monk (talk) 13:53, 19 July 2024 (UTC)
 * —Trappist the monk (talk) 13:53, 19 July 2024 (UTC)