What should language_link do with the alt-text if the main text already contains links? I presume that if given something like ], it shouldn't actually use the alt text, just add the language name. So how should it handle this? —CodeCat 21:29, 29 March 2013 (UTC)
What should we do in cases like {{l|en|a ]|tēxt}}
? Current code will return a ]
. I think value of alt shouldn't affect output in this case either. If we create more links, all of them will have "tēxt" as their link title. --Z 02:50, 31 March 2013 (UTC)
a ]
. —CodeCat 03:51, 31 March 2013 (UTC)I made this a function that doesn't receive a frame on purpose. What if another Lua function wants to make a link? It would be a bit silly if it had to call the template... —CodeCat 14:51, 30 March 2013 (UTC)
{{l}}
and {{term}}
aren't the only ones that make links, we also have the form-of templates (which really work like {{term}}
because they also have "annotations", but with some extras), and {{head}}
which could use this module. Provided that it's made in such a way that nothing is written to work only for {{l}}
, at least. —CodeCat 16:32, 30 March 2013 (UTC)
<word> (<tr>, "<gloss>")
, and l: <word> (<tr>) <g> ("<gloss>")
. --Z 17:02, 30 March 2013 (UTC)
{{term}}
does, with only a single set of brackets instead of two. —CodeCat 17:16, 30 March 2013 (UTC)
What is this function actually meant to do? What are the parameters for? Could it have a better name? Also, the way the parameters are assigned is just wrong; it creates global variables which should be avoided, especially in this case. A better way of doing it would be:
local args = frame:getParent().args
local gloss = args or ""
—CodeCat 19:11, 30 March 2013 (UTC)
(alt or text)
" --Z 19:31, 30 March 2013 (UTC)
Aren't we going to support parameters for gender and number or what? --Z 17:36, 31 March 2013 (UTC)
{{l}}
supports it, so I suppose we'll have to. I don't really like the idea of putting grammatical information into a template like this, but for now we should focus on making the existing template work so we can convert it. We can discuss actual changes later on. —CodeCat 18:25, 31 March 2013 (UTC){{l}}
so they shouldn't be in this either, not until after we have converted {{l}}
and are sure that it works. —CodeCat 18:28, 31 March 2013 (UTC)
If this module is going to be used as a general module for linking, then I think it should include the functionality provided by {{wlink}}
, {{wlink2}}
, and {{makelink}}
. Also, most or all of export.template_l should be moved into more general functions. --Yair rand (talk) 22:27, 7 April 2013 (UTC)
{{wlink|]}}
= Template:wlink, {{wlink|test}}
= Template:wlink. --Yair rand (talk) 22:35, 7 April 2013 (UTC)
{{l-self}}
, by the way. --Yair rand (talk) 01:13, 9 April 2013 (UTC)
{{l}}
, it was removed again. And I think that's a good idea for now. —CodeCat 01:24, 9 April 2013 (UTC)
In prepare_title, la-utilities is imported if the language is Latin. Rather than setting up a whole bunch of unique functions for every language, perhaps we should just copy over the altForms table from WT:EDIT:
var altForm = { ang: {from:"ĀāǢǣĊċĒēĠġĪīŌōŪūȲȳ", to:"AaÆæCcEeGgIiOoUuYy", strip:"\u0304\u0307"}, //macron and above dot ar: {strip:"\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652"}, fa: {strip:"\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652"}, ur: {strip:"\u064B\u064C\u064D\u064E\u064F\u0650\u0651\u0652"}, chl: {from:"ÁáÉéÍíÓóÚú", to:"AaEeIiOoUu",strip:"\u0304"}, //acute accent he: {strip:"\u05B0\u05B1\u05B2\u05B3\u05B4\u05B5\u05B6\u05B7\u05B8\u05B9\u05BA\u05BB\u05BC\u05BD\u05BF\u05C1\u05C2"}, hr: {from:"ȀȁÀàȂȃÁáĀāȄȅÈèȆȇÉéĒēȈȉÌìȊȋÍíĪīȌȍÒòȎȏÓóŌōȐȑȒȓŔŕȔȕÙùȖȗÚúŪū", to:"AaAaAaAaAaEeEeEeEeEeIiIiIiIiIiOoOoOoOoOoRrRrRrUuUuUuUuUu", strip:"\u030F\u0300\u0311\u0301\u0304"}, la: {from:"ĀāĒēĪīŌōŪūȲȳ", to:"AaEeIiOoUuYy",strip:"\u0304"}, //macron lt: {from:"áãàéẽèìýỹñóõòúù", to:"aaaeeeiyynooouu", strip:"\u0340\u0301\u0303"}, nci: {from:"ĀāĒēĪīŌōŪūȲȳ", to:"AaEeIiOoUu",strip:"\u0304"}, //macron ro: {from:"ŞŢşţ", to:"ȘȚșț"}, ru: {strip:"\u0300\u0301"}, uk: {strip:"\u0300\u0301"}, be: {strip:"\u0300\u0301"}, bg: {strip:"\u0300\u0301"}, mk: {strip:"\u0300\u0301"}, sh: { from:"ȀȁÀàȂȃÁáĀāȄȅÈèȆȇÉéĒēȈȉÌìȊȋÍíĪīȌȍÒòȎȏÓóŌōȐȑȒȓŔŕȔȕÙùȖȗÚúŪūѝӣ", to: "AaAaAaAaAaEeEeEeEeEeIiIiIiIiIiOoOoOoOoOoRrRrRrUuUuUuUuUuии", strip:"\u030F\u0300\u0311\u0301\u0304" }, sr: { from:"ȀȁÀàȂȃÁáĀāȄȅÈèȆȇÉéĒēȈȉÌìȊȋÍíĪīȌȍÒòȎȏÓóŌōȐȑȒȓŔŕȔȕÙùȖȗÚúŪū", to:"AaAaAaAaAaEeEeEeEeEeIiIiIiIiIiOoOoOoOoOoRrRrRrUuUuUuUuUu", strip:"\u030F\u0300\u0311\u0301\u0304" }, sl: {from: "áÁàÀâÂȃȂȁȀéÉèÈêÊȇȆȅȄíÍìÌîÎȋȊȉȈóÓòÒôÔȏȎȍȌŕŔȓȒȑȐúÚùÙûÛȗȖȕȔệỆộỘẹẸọỌəł", to: "aAaAaAaAaAeEeEeEeEeEiIiIiIiIiIoOoOoOoOoOrRrRrRuUuUuUuUuUeEoOeEoOel", strip: "\u0301\u0300\u0302\u0311\u030f\u0323"}, tr: {from:"ÂâÛû", to:"AaUu",strip:"\u0302"}, zu: {strip_init_hyphen: 1} };
--Yair rand (talk) 22:37, 7 April 2013 (UTC)
This is magic to me. How can I remove breve marks in Latin words? In "ăquā" it only removes the macron. --Vriullop (talk) 12:38, 30 June 2013 (UTC)
What is wrong with Module:gender and number that it can't be used in this module? It works fine for {{nl-noun}}
and {{ca-noun}}
. —CodeCat 17:02, 10 April 2013 (UTC)
mw.text.listToText(list, ", ", " and ")
. (2) it doesn't differ between genders and numbers: m, f, sg
or m, f and sg
should be m and f sg
. --Z 17:15, 10 April 2013 (UTC)
{{l}}
currently works, so this should be changed by fixing all the entries that use {{l}}
with more than one gender. g1=m g2=p should be changed into g=m-p . —CodeCat 17:59, 10 April 2013 (UTC)
if gender and gender then
if mw.ustring.match(gender .. gender .. gender, "-") then
local gen = require("Module:gender and number")
text = text .. " " .. gen.format(gender)
else
text = text .. " " .. frame:expandTemplate{title = gender, args = {gender, gender}}
end
{{#if:{{{g2|}}}{{{g3|}}}|]}}
in Template:l's code to get a list of pages that should be updated by bot. --Z 12:45, 11 April 2013 (UTC)
{{{g1|}}}
should be in there as well (it's redundant to g=). —CodeCat 12:52, 11 April 2013 (UTC)
{{l}}
to use the module, inform users about how they should use gender parameters from now on, and then update the pages in Category:l with g1, g2 or g3 (too lazy to renew my TS account, and my Internet connection is ridiculously slow and limited to update so many pages, anybody interested in doing this part?!) --Z 14:10, 11 April 2013 (UTC)There are a few script templates, such as {{Kore}}
and {{unicode}}
, that give class names that are different from their template names. Module:links uses the script codes themselves as classes instead of using the script templates, so I think we should probably first edit the script templates to be consistent and see if any problems come up (and make any necessary CSS changes), before starting to use this module. --Yair rand (talk) 11:21, 16 April 2013 (UTC)
language_link() can already do this. --Z 16:21, 16 May 2013 (UTC)
#invoke
d and the kind of auto-linking it does might be actually undesired. But yes, I actually borrowed some code from it. Keφr (talk) 19:44, 16 May 2013 (UTC)I notice that 10 of the tests at Module talk:links/testcases are failing, and five of those are giving actual script errors. Anyone know what happened to cause this? --Yair rand (talk) 21:52, 2 June 2013 (UTC)
I think it makes more sense to create a table that contains informations of language, language = languages
(the variable for language code is currently lang
), instead of having a variable for language code and calling the big table languages
everywhere. But in that case, we would need to add a field for language code in language
. On the other hand, if we do this change, and alter the lang (string for language code) argument to language (table that contain language info), it will make the job a bit harder for functions that are supposed to be invoked directly from templates and use these functions. --Z 08:26, 24 June 2013 (UTC)
We can improve the script detection feature in a way that it check each term that is going to be linked separately, rather than considering the input as a text that is written in a single script and checking the whole input text once: {{term|] / ] / ]|lang=ja}} (so that we won't have to write {{term|鳥居|lang=ja}} / {{term|とりい|lang=ja}} / {{term|torii|lang=ja}}). For doing this, we have to merge language_link() to annotated_link(), but this has some disadvantages... --Z 19:27, 24 June 2013 (UTC)
{{recons}}
is sometimes used without the first parameter. This removes the link, and just applies formatting to the bare word. These are now causing script errors, the module apparently requires the word parameter. But it should only be required for {{l}}
(I think?) not for {{term}}
or {{recons}}
. —CodeCat 20:25, 5 July 2013 (UTC)
I'm going to merge template_l and template_term functions, like this (tests), template's title (either "l" or "term") should be provided to the module through the parameter "template". Any objections/suggestions? Any suggestions about the name of the new function? --Z 22:39, 27 July 2013 (UTC)
One of the consequences of this is that the forth parameter in {{l}}
can do the the job of the horrible "gloss" parameter and makes it deprecated, so we can get the rid of it and make the two templates more similar to each other. --Z 22:50, 27 July 2013 (UTC)
Also, "id" will be available in {{term}}
, so will be "lit" and "pos" in {{l}}
. --Z 22:52, 27 July 2013 (UTC)
{{term}}
and {{l}}
use either the gloss= parameter or the parameter that follows alt. It's not a problem (so that both are equivalent until we decide which one to keep), but if you add that then you should check any usages of {{l}}
that currently already have a 4th parameter, and any usages of {{term}}
that already have gloss=, just in case someone provided those parameters in the past and they are still present in entries. We don't want those old mistakes to be interpreted wrongly when those parameters suddenly become valid. The same applies to g= for {{term}}
and to pos= and lit= for {{l}}
, as these templates did not originally support those parameters.{{rfscript}}
with "sc or langinfo.scripts". Why not just sc?sc = langinfo.scripts
part inside the "if (term or alt) then" block, yesterday, so sc may be nil. In this case, the template itself checks for the name of the script, but it is faster to be done directly in the module.{{term}}
Unlike other major linking templates {{l}}
and {{t}}
, {{term}}
takes the language code through the named "lang" parameter. There were discussions and efforts regarding fixing this, which went nowhere. the The module is ready to be used in {{term}}
, though, since we can use the "compat" option. See tests (see the "Actual" column, ignore the "Expected"). BUT: it's the best time to do any other changes and improvements on the template. The easiest way to get the rid of the "lang" parameter is creating a Lua-ized version of {{term}}
under another, better title and replace usages of {{term}}
(when the "lang" is specified) with the new one. Any thoughts? Here is a discussion about using {{g}}
instead of the gender templates, if we do this, we can choose {{m}}
(mentioned term; the best title IMO) as the new title, and by this change we can probably use {{mt}}
(mentioned term). --Z 21:50, 28 July 2013 (UTC)
{{m}}
, we could enjoy our Lua-ized {{term}}
with its new title long time ago and put our time and energy that is being wasted to improve it instead. --Z 22:41, 28 July 2013 (UTC)
Why do we even need a template like {{term}}
? The only difference from {{l}}
is that it italicizes, right? Is it worth having a separate template just for italicizing? Besides, only Latin-script words are italicized. --Vahag (talk) 23:04, 28 July 2013 (UTC)
What about {{M}}
? We can move it to {{m}}
later when we removed the gender templates. --Z 18:37, 30 July 2013 (UTC)
Here are the options we have right now:
{{term}}
, using the compat mode. We have to use "lang" in this case.{{term}}
under another title, say {{M}}
, and consider {{term}}
a deprecated template.{{m}}
and use that.The advantage of 2 is that we can temporally enjoy using the template without "lang", and having a short title. Later we may decide to change it to another title, e.g. {{m}}
. We will run a bot on all pages that have used {{term}}
with the "lang" specified, and replace them with the new template. For those which doesn't have "lang", we have two options: (2.1) converting them to the new template by human, who add a language code to the new template, or (2.2) replacing them with {{M/m||...}}
, by bot.
By choosing 1, the job will be a bit harder: first we should add "|lang=" by bot to all usages of {{term}}
which doesn't have "lang". Then we can change the module in a way that if "lang" is specified (even by having an empty string as value) then use the old parameters (use "lang" instead of the first parameter and so forth), therefore people would be able to use {{term}}
by passing the language code to the first parameter, too. Then we can run a bot on all usages of {{term}}
to remove "|lang=(...)" and pass its value (which may be empty string) to the first parameter. I said we should add "|lang=" and not "|lang=und" because the latter means undetermined, while in this case they are unspecified; although the current code consider them identical, but we may (should) change the behavior in future. Later we may decide to change it to another title, e.g. {{m}}
.
The third option is the best, but we can't choose it without convincing the community and removing the gender templates.
We should choose one of these ASAP. It's ridiculous that we have features but the community still can't use it. --Z 21:29, 30 July 2013 (UTC)
{{label}}
next to {{context}}
), but we can't just suddenly switch over because there are many entries to fix. Providing the language code to 20 thousand entries is going to be a huge task, so I think it may be better if we migrate only the cases that have a language code, leaving the rest as {{term}}
. Even if we do have a consensus to use {{m}}
, that template is still added to entries by bots (yeah... instead of {{head}}
... :/). So if we orphan it, we can't be sure that someone's bot won't add it somewhere and break things in ways we hadn't foreseen. On the other hand, the new {{m}}
would require a language code as the first parameter, so if someone's bot starts adding it to entries, it will start triggering script errors and alert us to the problem. —CodeCat 21:48, 30 July 2013 (UTC)
{{M||text}}
and the module will behave exactly like {{term|text}}
. --Z 22:10, 30 July 2013 (UTC)
{{M|und|text}}
. I don't think people will write {{M||text}}
or {{M|und|text}}
when the language is not undetermined, the main reason that they didn't specified language code for so many {{term}}
s is actually because it had a named parameter, compare {{l}}
for which users have always specified the language code. --Z 22:30, 30 July 2013 (UTC)
{{term}}
to Lua first. Hopefully that won't give too many problems. We also need to work on {{termx}}
, which should be orphaned altogether, but only once {{term}}
can support reconstructed languages. —CodeCat 02:16, 31 July 2013 (UTC)
{{termx}}
and {{recons}}
in the last few days, and I've been trying to deal with the script errors that have been showing up. That will probably take a day or two. {{compound}}
and {{suffix}}
have also been converted to Lua. {{compound}}
is "nice" as far as code goes, but {{suffix}}
is a bit more hackish because I focused more on replicating existing behaviour instead of changing or adding new things. That's for later, when we decide what we want. {{prefix}}
and {{confix}}
will need to be converted as well, that won't take too long. —CodeCat 00:23, 4 August 2013 (UTC)The current version of the module will happily create links to appendix pages when the language is "und". But this is undesirable. Links to "und" are ok for the main namespace; the section id should be empty then. But for appendix pages, there should really be no link at all. This should be added to language_link but I'm not sure how. The best way seems to me that language_link should just return nil when it's not able to make a link. So language_link("attested", "alt", "und")
should give ]
(without a #), but language_link("*reconstructed", "alt", "und")
should give alt
with no link at all.
I'm not sure what it should do when the term contains embedded wikilinks. What if someone writes: language_link("] ]", nil, "und")
? The most sensible thing to me would be to try to process each individual link the same as it would normally, so that this gives ] *reconstructed
. I suppose that the function should only return nil if it could not create any links at all, so language_link("] ]", nil, "und")
should return nil, but I don't know if that is feasible.
An alternative we could try is to just return the link-less text instead of nil, but that seems to go slightly against the idea of making "links". What would be more useful? —CodeCat 22:37, 28 July 2013 (UTC)
{{term}}
is still missing the language code on about 20 thousand entries, and the module currently treats this as "und"... which would then remove the link. I don't think we want that. —CodeCat 23:06, 28 July 2013 (UTC)
{{term}}
was not a problem though: since it is not used to link to any appendix so far, all we actually need is if term and (compat or lang ~= "und") then
attested ]
is unlikely to appear in the term variable while the lang is und. Editors should be aware that we don't link to reconstructed terms. We have already made linking to reconstructed terms complicated, I'm not sure if this highly unlikely case is worth it to make the code even much more complicated because of it. So we should not call language_link when the have "*" at the beginning. There's a way to always fix this though: replace "]" with the second capture. But I fear if we continue to handle such rare issues like this the code eventually become full of fixes of fixes of fixes... --Z 23:45, 28 July 2013 (UTC)
{{l}}
, {{term}}
and {{recons}}
. So we can't just ignore it. And the handling of "und" must be done inside language_link, because that function is not used by just {{l}}
and {{term}}
, other modules also use it. It's better to make the code robust now, rather than regret it later when things start behaving strangely. —CodeCat 23:57, 28 July 2013 (UTC)
I noticed that we have two different formats for genders, inflections and annotations. Which one we use depends on the template:
{{head}}
: term (tr) gender (inflections){{term}}
and {{l}}
: term gender (tr, glosses){{t}}
: term (tr) genderI think we should make all of these show the same, but I'm not sure which way. I think the transliteration should come right after the term, but that would look like this on {{term}}
when other glosses are also given: term (tr) gender (glosses). And if there's no gender (which is most of the time) then it becomes: term (tr) (glosses). That doesn't look so nice. So what should we do? —CodeCat 12:47, 1 August 2013 (UTC)
tumė́ti should link to tumėti, vil̃na should link to vilna and similar. See more on w:Lithuanian accentuation and w:Latvian_language#Pitch_accent. --Ivan Štambuk (talk) 22:59, 15 August 2013 (UTC)
When it shouldn't be, see etymology at: ναῦς. --Ivan Štambuk (talk) 09:39, 18 August 2013 (UTC)
Shouldn't we remove it? --Z 19:50, 20 August 2013 (UTC)
detect_script
should probably do something special with the *, while it should be removed before transliterating. —CodeCat 20:22, 20 August 2013 (UTC)It's broken when used in {{term/t}}
. Why don't you do test edits on some test module, instead of live system?! --Ivan Štambuk (talk) 13:45, 26 August 2013 (UTC)
target2 == export.make_pagename(linktitle, lang)
that you added at the end of the "core" function. Linking to appendix with an alt which doesn't start with "*" is not allowed now (see the tests 10, 11, 12 of Module talk:links/testcases). Is it a good idea? --Z 14:28, 26 August 2013 (UTC)
make_pagename
would trigger errors like that. I don't think it's necessarily a bad idea either though, because we caught the above "mistake" thanks to it. Otherwise, the * would have been missing from the displayed link, and there wouldn't have been an indication that it's reconstructed. —CodeCat 14:42, 26 August 2013 (UTC)
{{l|sla-pro|*] ]}}
, but they won't work after your change... --Z 14:56, 26 August 2013 (UTC)
{{l|xx|term|alt}}
can be safely converted into {{l|xx|alt}}
. —CodeCat 15:32, 26 August 2013 (UTC)
"*" .. linktitle
(instead of linktitle
) to make_pagename
. --Z 10:53, 27 August 2013 (UTC)
make_pagename
. But it doesn't seem to be working. —CodeCat 11:19, 28 August 2013 (UTC)
{{l|gem-pro|*]}}
. It's not a serious issue, but worth noting. —CodeCat 16:09, 28 August 2013 (UTC)
{{l|gem-pro|*]}}
(but not {{l|gem-pro|]}}
etc.) because *]
will be turned into ]
at the "fix for linking to unattested terms (...)" part, which itself becomes ]
in core
. We can fix this by checking if new
is equal to target
AND new
is not equal to linktitle
, after the line new = export.make_pagename(new, lang)
, in this case, it shouldn't be marked as redundant. --Z 16:27, 28 August 2013 (UTC)See: запахи следοв (zapaxi sledοv). The declension suffixes should be linked. I think this module is responsible for it. Keφr 09:11, 12 September 2013 (UTC)
Please fix this. Keφr 14:46, 16 September 2013 (UTC)
|2=
, in this case), otherwise, if the new line is added mistakenly, I think it should be fixed from the page code, the page in which the template is used. --Z 15:28, 16 September 2013 (UTC)
See Heisenberg uncertainty principle. Keφr 18:09, 17 September 2013 (UTC)
There are many more international punctuation symbols to be removed (e.g. Tibetan), I have added for removal a few more:
text = gsub(text, "$", "")
There are all used at the end of sentences (except for Spanish inverted ¿ and ¡), so they shouldn't cause problems for other languages. --Anatoli (обсудить/вклад) 00:44, 24 October 2013 (UTC)
I think {{l}}
should accept a |face=
parameter, to be used for example in headword templates (which may need to set |face=bold
). template_l_term
will need to be extended. Keφr 19:52, 5 November 2013 (UTC)
{{l}}
, and if I put them inside the template (as in, {{l|und|''']'''}}
), it breaks some of the functionality provided by the template (like handling already-marked-up links; although it is somewhat doubtful that headwords would or should take advantage of it). Are you planning on staying, or am I asking too soon? Keφr 22:11, 5 November 2013 (UTC)
{{l}}
to not show a transliteration by using tr=-
. So this will work: '''{{l|xx|something|tr=-}}'''
. —CodeCat 23:15, 5 November 2013 (UTC)
Is this piece of code still required? I've asked CodeCat but got no reply here. Every single Russian entry gets added to these categories (Category:Link alt form tracking/redundant and Category:Link alt form tracking/redundant/ru) when e.g. genitive sg and nominative pl (nouns) are added to the headword.
if target == new then tracking = tracking .. "]]" end
--Anatoli (обсудить/вклад) 02:54, 6 December 2013 (UTC)
]
becomes just á
. It would help a lot if you could do this. I will look at the headword templates, but can you give an example where it occurs? зуб мудрости is not really a good example because the problem is in the linked display form, which has a redundant piped link. I've fixed it now: diff. —CodeCat 03:32, 6 December 2013 (UTC)
{{ru-noun-1}}
an example, which doesn't have a page name part? --Anatoli (обсудить/вклад) 03:40, 6 December 2013 (UTC)
{{ru-noun-3-а}}
is the first in the category of templates that hasn't been changed. You will probably notice that after you fix the templates, some of the parameters are actually no longer used anywhere by the template. This is ok; it just means that the templates and the entries that use them will need to be looked at and fixed to change the parameters around, but you don't need to do that unless you want to (you would need a bot to make it easy). —CodeCat 03:47, 6 December 2013 (UTC){{ru-noun-3-а}}
now, to show what needs to be done: diff. I hope that helps. —CodeCat 03:53, 6 December 2013 (UTC)
Sindhi diacritics should work the same way as Arabic, Persian and Urdu, so it should be the same treatment. The translation adder made: لُغَتُ on dictionary#Translations but it should be just لُغَتُ (currently shows in red) with diacritics automatically removed. The tool knew how to link to the entry without diacritics but used "alt=". (I haven't added the transliteration but it's something like "luğatu"). --Anatoli (обсудить/вклад) 02:29, 3 February 2014 (UTC)
It fails on this module when there is a manual transliteration. There are thousands of translations with manual transliteration and in this case it's desirable because it capitalises proper nouns (romaja is usually capitalised for place names:
--Anatoli (обсудить/вклад) 05:57, 28 May 2014 (UTC)
I have answered in Module talk:ru-pron. --Anatoli (обсудить/вклад) 07:02, 28 May 2014 (UTC)
I noticed that the module links to reconstructed terms while lang is "und": {{l|und|*term}} -> *term, as far as I recall we had fixed this before. --Z 13:57, 3 July 2014 (UTC)
I can't think of a situation in which this kind of use would arise and be needed (hence it isn't a problem per se that it doesn't work), but I noticed on one of my user-subpages that {{term|*?|lang=sca-pro}} produces a module error saying "Lua error in Module:links at line 102: The specified language Proto-Siouan-Catawban is unattested, while the given word is not marked with '*' to indicate that it is reconstructed" (even though the word is marked with '*'), while {{term|*??|lang=sca-pro}} works fine. - -sche (discuss) 01:27, 21 August 2015 (UTC)
*
, which I guess is a special case to be able to link to asterisks, and the second one links to Appendix:Proto-Siouan-Catawban/? with just one question mark. --WikiTiki89 01:40, 21 August 2015 (UTC)
*
alone is a special case. The issue is that the asterisk is included in the code that removes the question mark, so it thinks the text consists of more than a question mark alone. Perhaps the "proper" solution is for the asterisk to be stripped before passing it to the conversion function. However, this edge case is so specific that it might not be worth the effort. —CodeCat 00:23, 30 October 2016 (UTC)Is there a way to disable auto-translit if the link text equals — or —? KarikaSlayer (talk) 13:55, 6 July 2016 (UTC)
This thread was moved from Module talk:links/documentation.
It seems like format_link_annotations()
doesn't need lang
anymore. Ping @CodeCat who seems to have made the relevant edit at diff.
In addition, full_link()
seems to be able to do undocumented things such as at Module:fr-verb, where lang
is not the first item given to the function. —suzukaze (t・c) 10:36, 27 August 2016 (UTC)
Two recent discussions suggest to me that it would be ideal if this template automatically substituted plain apostrophes with a better-looking character in link text. In the Beer parlour (Wiktionary:Beer parlour/2016/October § ASCII vs. Unicode apostrophes in French entries) @Angr describes it as the usual practice to create French entry names with the plain apostrophe but to display the curly apostrophe (right single quotation mark) in headwords. In Wiktionary talk:About Ancient Greek § Symbol to mark apocope, I proposed that a similar thing be done for Ancient Greek headwords.
Anyway, I thought a similar thing should be done for links. It looks like the function makeLangLink
, which deals with link text, would be the place to insert the code. I don't have template editor privileges, but I think the code would to perform this replacement would look something like this:
if lang:getCode() == "fr" or lang:getCode() == "grc" then
link.display = mw.ustring.sub(link.display, "\'", "’")
end
This would hopefully make {{m|fr|d'où}}
automatically display as d’où, as if it had been produced by the code {{m|fr|d'où|d’où}}
. Similarly, {{m|grc|ἀλλ'}}
would automatically display as ἀλλ’ (all'), like {{m|grc|ἀλλ'|ἀλλ’}}
.
Ideally the curly apostrophe should also be used in the transliteration – ἀλλ’ (all’). Perhaps the replacement should be done somewhere other than in the function makeLangLink
, so that both the link text and the text used to make the transliteration already have the curly apostrophe. — Eru·tuon 00:13, 30 October 2016 (UTC)
makeEntryName
. —CodeCat 00:16, 30 October 2016 (UTC)
|alt=
parameter? The effect is the same; the only difference is that there is less repetitive work involved. — Eru·tuon 01:53, 30 October 2016 (UTC)
{{l|fr|c’est}}
can link to c'est, but {{l|fr|c'est}}
should not display "c’est". --WikiTiki89 01:59, 30 October 2016 (UTC)
Alt
and 0145
to get a right single quotation mark, or navigate to the correct EditTools menu and select the character. Both are a hassle. It would make things much easier if the module did the work for me. So once again, why do you oppose having a module do it? — Eru·tuon 02:19, 30 October 2016 (UTC)
c'est
as c’est than to have to change '
to ’
wherever it occurs in French text. Of course, perhaps there is no such consensus regarding French. It would be easier to develop consensus for Ancient Greek, which I would think has a smaller group of editors. — Eru·tuon 03:41, 30 October 2016 (UTC)@CodeCat, Wyang, I know this was mentioned elsewhere, but I'd like to bring it up directly. @Erutuon has moved the transliteration override data to mod:languages's data. If the phonetic_extraction data were similarly moved there, would this solution be amenable to all parties? —JohnC5 20:27, 14 March 2017 (UTC)
translit_module
option points to that module, or the current Module:th-translit were modified to call it, then there would be no need for the custom code. —CodeCat 20:31, 14 March 2017 (UTC)
translit_module
. If it were just done that way, like all the hundreds of languages besides Thai already do, we wouldn't have this mess. —CodeCat 21:05, 14 March 2017 (UTC)
@Erutuon This seems like a perfect candidate to be moved into a data subpage to me. —JohnC5 15:25, 24 March 2017 (UTC)
@Erutuon, I think your recent edits here did something wonky to the fonts for the transliterations. Could you check it out? — justin(r)leung { (t...) | c=› } 04:14, 19 May 2017 (UTC)
lang="ja"
to Japanese transliteration caused transliterations to display with fonts more appropriate for Japanese script, but I changed it to lang="ja-Latn"
, which may not have the same effect. If it does have that effect, there is a discussion on this topic at Wiktionary:Grease pit/2017/May § CSS classes for transliterations. I do have an idea for how to solve this problem, which I mentioned in that discussion. — Eru·tuon 04:26, 19 May 2017 (UTC)
lang="language code-Latn"
. Rōmaji in Japanese headwords displays wrong, because it has class="Jpan"
; but that has nothing to do with my recent changes. (I can't figure out how to fix it, unfortunately.) Could you point me to an entry in which you see the problem that you are talking about? — Eru·tuon 04:44, 19 May 2017 (UTC)
-Latn
part of the language attribute and just look at the language code part, applying fonts appropriate to the ordinary script of the language, but not appropriate for transliteration. That would be an argument for using class="tr-language code"
instead. — Eru·tuon 04:53, 19 May 2017 (UTC)class="tr-language code"
might work better across browsers. — justin(r)leung { (t...) | c=› } 05:26, 19 May 2017 (UTC)
{{t+|ja|水|sc=Jpan|tr=みず, mizu}}
. Both transliterations are supplied in the same parameter, so they are tagged the same way (and incorrectly for the Kana one). That's bad. — Eru·tuon 15:38, 19 May 2017 (UTC)
{{t+|ja|水|sp2=みず|tr=mizu}}
. I don’t know whether there would be use cases for other languages, but I suggest that the parameter be intended generally for equivalent respellings within an integrated writing system (in this case Jpan
), and not for completely separate writing systems (e.g. Latin/Cyrillic, etc.). Of course, this would require a bot run through our Japanese/Japonic translations, and maybe a change to the Translation Adder, but I think it’s the best way to avoid these code errors and to structure our data appropriately. Also, another solution such as having Lua run through the transliteration looking for different script characters would make {{t}}
more bloated. – Krun (talk) 14:07, 24 May 2017 (UTC)@Erutuon Please replace lines 342-343 with the following:
local class = "" if data.accel then class = "form-of lang-" .. data.lang:getCode() .. " " .. data.accel end -- Only make a link if the term has been given, otherwise just show the alt text without a link link = m_scriptutils.tag_text(data.term and export.language_link(data, allowSelfLink, dontLinkRecons) or data.alt, data.lang, data.sc, face, class)
—CodeCat 12:46, 20 August 2017 (UTC)
Per this discussion, can someone please add these lines. Thanks.
After line 288:
elseif itemType == "ts" then tag = { '<span class="ts mention-ts Latn">/', '/</span>' }
Replace lines 321-322:
-- Transliteration and transcription if data.tr or data.ts then
Replace line 330:
if data.tr and data.ts then table_insert(annotations, require("Module:script utilities").tag_translit(data.tr, data.lang, kind) .. " " .. export.mark(data.ts, "ts")) elseif data.ts then table_insert(annotations, export.mark(data.ts, "ts")) else table_insert(annotations, require("Module:script utilities").tag_translit(data.tr, data.lang, kind)) end
--Victar (talk) 15:24, 8 March 2018 (UTC)
@JohnC5, Victar, Wikitiki89 Could one of you please add information on the correct use of |ts=
to Template:link/documentation? I see from the discussion at Wiktionary:Beer parlour/2018/February#Transcription parameter again that most people consider it undesirable to use |ts=
for IPA transcriptions, but that's exactly how I've been using it for Burmese, since the pronunciation is not easily deducible from the transliteration. Wikitiki reverted me once because that wasn't the intention behind |ts=
, but I'm still not convinced it's such a bad idea. —Mahāgaja (formerly Angr) · talk 12:19, 4 April 2018 (UTC)
|ts=
parameter is that IPA should be formatted with IPA fonts and non-IPA without, and so one or the other will be formatted incorrectly. Or maybe it's acceptable to put both in an IPA font, if some transcriptions are IPA. (I have no objection to the transcription of Burmese using the IPA otherwise, as long as we specify that you can't, for instance, provide an IPA transcription of English in a linking template.) But this is perhaps not the best place for these remarks.... — Eru·tuon 17:43, 4 April 2018 (UTC)
{{my-IPA}}
relies on a lot of ad-hoc devices (apostrophes, plus signs, etc.) to get the IPA right; and there are words like ဘတ်စ်ကား (bhatcka:) whose spelling is so weird {{my-IPA}}
fails on them and their transcription and pronunciation have to be added manually. —Mahāgaja (formerly Angr) · talk 19:05, 4 April 2018 (UTC)
{{my-IPA}}
generates /t͡ɕʰɪ̀ɴθḛ/ if it's not supplied a respelling. (I could be wrong because I don't know Burmese.) — Eru·tuon 19:29, 4 April 2018 (UTC)
|ts=
per Mahāgaja and not just for Burmese but other languages as well. Let's take Chinese (Mandarin) word 人民幣/人民币 (rénmínbì) for example. Some people might wonder why in the Russian transcription/transliteration of Mandarin the initial "r-" is rendered ж (ž), not р (r) in Russian, e.g. жэньминьби́ (žɛnʹminʹbí) (). With 人民幣 / 人民币 (rénmínbì /ʐən³⁵ min³⁵ pi⁵/) it would make a little clearer that Mandarin "r" is actually /ʐ/, for which the Russian /ʐ/ is almost identical and a much better fit than a Russian /r/ would be but in English it's /r/ which sounds closer to Mandarin /ʐ/. --Anatoli T. (обсудить/вклад) 23:20, 4 April 2018 (UTC)
|ts=
for that. Pinyin is already pronunciation-faithful, you just have to know what the symbols stand for. —Mahāgaja (formerly Angr) · talk 11:31, 5 April 2018 (UTC)
{{IPAchar}}
, outside the {{m}}
template, and not with |ts=
. But for Burmese, where the transliteration doesn't tell you whether certain consonants are voiced or not and whether certain vowels are reduced or not, I'd prefer to use |ts=
. And wasn't the whole battle between Rua and Wyang regarding Thai transcription last year ultimately about the fact that one of them wanted a more spelling-based tranliteration and the other wanted a more pronunciation-based transcription? Using |ts=
for Thai would allow them both to have what they want, wouldn't it? —Mahāgaja (formerly Angr) · talk 18:39, 5 April 2018 (UTC)
|ts=
is not a shortcut for the same thing. It's intended for an entirely different purpose. --WikiTiki89 13:42, 9 April 2018 (UTC)|pron=
or, more unambiguously, |ipa=
. As you say, IPA shouldn't have hardcoded brackets because it could be either phonetic or phonemic, and it needs to have the IPA class attribute (class="IPA"
) so that the proper fonts are applied and so that it can be located on a page if anyone wants to mess with it further using CSS or JavaScript. — Eru·tuon 19:29, 7 April 2018 (UTC)|ts=
to convey IPA-level of pronunciation accuracy. In the example of ခြင်္သေ့ (hkrangse.), I can't say I know much of anything about Burmese, but t͡ɕʰəðḛ clearly an IPA rendering, not a transcription, and therefore should not be placed in |ts=
. --Victar (talk) 00:30, 7 April 2018 (UTC)
|ts=
originally, it was made very explicit that it should not be used for IPA and should not overlap with the function of the "Pronunciation" section, whose purpose is to give narrow pronunciation information about a word. The transcription parameter was created to include information traditionally associated with/reconstructed for a term but not automatically generatable from the transliteration, all without interfering with the transliteration. The whole point is to give the representations of lemmata that the user is most likely to find in a dictionary (native script, transliteration, (reconstructed) transcription), not narrow pronunciation information. I'd brought up the notion before of limiting the distribution of this parameter to scripts that were deficient enough in information to merit transcription (abjads, syllabaries, cuneiform) so as to avoid this parameter being abused. —*i̯óh₁n̥C 00:48, 7 April 2018 (UTC)
|ts=
. In the example of ခြင်္သေ့ (hkrangse.) again, hkrangse. gives us enough information to both disambiguate and get a general understanding has to how to pronounce the word. Anything more is overreach. --Victar (talk) 01:15, 7 April 2018 (UTC)@Erutuon any chance we can get a <span class="mention-pos"></span>
around the |pos=
so users can apply custom CSS? --{{victar|talk}}
23:10, 27 December 2018 (UTC)
{{m}}
and other templates using the same face (confusing term; see Module:script utilities/documentation § tag text) or in the faces used by {{l}}
and {{t}}
as well? I ask because if it's the latter, then mention-pos
is a misleading name because the face used by {{m}}
is called "mention"; not sure what would be a good replacement. — Eru·tuon 23:37, 27 December 2018 (UTC)
{{victar|talk}}
23:53, 27 December 2018 (UTC)
annotation-pos
or link-annotation-pos
would make sense, because it would allow for other similar classes for the other annotations. — Eru·tuon 21:25, 24 January 2019 (UTC)
annotation-pos
sounds good to me. --{{victar|talk}}
05:24, 25 January 2019 (UTC)
|pos=
just about every day and find them often used? --{{victar|talk}}
20:49, 28 January 2019 (UTC)
|g=
and we have <span class="gender"></span>
for that. --{{victar|talk}}
21:24, 28 January 2019 (UTC)
.ann-pos
. While we're at it, .gender
could be renamed to .ann-g
. --{{victar|talk}}
21:38, 28 January 2019 (UTC)class="ann-pos"
to the part of speech annotation. I decided against changing class="gender"
around the gender annotation because some JavaScript and CSS relies on it. Unfortunately the class names for the various annotations have very little rhyme or reason to them.... — Eru·tuon 01:20, 5 February 2019 (UTC)
.a-pos
, but if you think .ann-pos
is short enough, then that's fine with me. --{{victar|talk}}
02:50, 5 February 2019 (UTC)This module seems not able to handle character entity references correctly. {{l|en|&}}
results in "&", with the semicolon removed in the link, while {{l|en|&}}
results in "&" as expected, with the numeric reference replaced with the actual character. It looks like the substitution for numeric references at makeLangLink
is unwittingly removing semicolons where it shouldn't. Not sure if this is urgent but just putting it out there. Nardog (talk) 15:56, 16 May 2019 (UTC)
makeEntryName
in Module:languages. That's useful in Ancient and Modern Greek at least, where the semicolon is a question mark; it's our convention to omit question and exclamation marks in page titles but to show them in headword lines and probably in links to the entry. Not sure if leaving semicolons would have bad effects in other languages (that is, make links go to the wrong pages). — Eru·tuon 22:35, 16 May 2019 (UTC)
'
, but that made the rōmaji link at あっ generated by {{ja-pos}}
not work (spotted by TAKASUGI Shinji), so I changed it to the decimal reference. Nardog (talk) 11:02, 17 May 2019 (UTC)dontLinkRecons
The dontLinkRecons
parameter to several of the linking functions seems to have had no effect for more than two years, and asterisked terms can be prevented from linking using alt
parameters, so I think there's no need for it. I removed it from the module and the documentation. If this isn't correct, please let me know here. See also Module talk:anagrams#dontLinkRecons. — Eru·tuon 21:10, 3 December 2019 (UTC)
For example, on Sinn machen
{{m-self|de|Sinn machen}}
(with a regular space) is bolded and unlinked, but{{m-self|de|Sinn machen}}
(with a U+00A0 NO-BREAK SPACE) and{{m-self|de|Sinn machen}}
are unbolded links.These are equivalent for MediaWiki (]
→ Sinn machen works just fine and links to the right page), so the module should probably recognize it as a self-link as well. (The same goes for {{l-self}}
, too, of course.) The incorrect behavior can be observed in the titles of the conjugation tables in the said entry: there shouldn’t be links. —Tacsipacsi (talk) 21:40, 13 November 2020 (UTC)
empty {{desc}}
's causing term requests in the maintanance entries, like on ZomBear's page and sandbox. Vininn126 (talk) 17:09, 9 February 2022 (UTC)
@Benwing2: Apparently, the namespace matters when creating links to other Wiktionaries, see and compare it to how it looks when I use the same code here:
I don't think this is intended behavior. — Fytcha〈 T | L | C 〉 22:13, 1 November 2022 (UTC)
{{l|de|de:Haus}}
into the textbox, and setting the page name to either "Module talk:links" or "User:Fytcha/Sandbox". The resulting link code for either title is ]
.{{l|de|:de:Haus}}
results in the same behavior, because normally prefixing an interwiki link with a colon prevents it from being displayed in the sidebar. The raw link code generated is ]
. I guess that prefixing with :
doesn't escape interwiki links in the same way that :
does. 98.170.164.88 22:35, 1 November 2022 (UTC)At აპირებს#Conjugation and many more pages like this, the conjugation table is chaotic: sometimes there is a line break between a word and its transliteration, sometimes not. I want to make it consistent and make sure there is always a line break. How do I do that with this or any other module/template? Gradilion (talk) 10:33, 7 June 2023 (UTC)
@Theknightwho: May there be any potential problem beyond transliteration with loading the alternative display supplied to full_link() with stateless Unicode formatting characters, such as soft hyphens (U+00AD SHY) and word joiners (U+2060 WJ)? RichardW57m (talk) 10:34, 12 June 2023 (UTC)
@Theknightwho Since Jan, allow_self_link
is being ignored, contrary to the docs. Can you explain the logic here? I tried to enable self links in Module:place line 195, but the term 'Mexico' still shows up as a bold unclickable link regardless. Benwing2 (talk) 04:34, 9 March 2024 (UTC)
the use of the Unicode character "fullwidth solidus" is inappropriate for all languages apart from CJK scripts, the following code in the line 966 should be changed as such:
if i < #terms then insert(output, "<span class=\"Zsym mention\" style=\"font-size:100%;\">/</span>") end
becomes:
if i < #terms then insert(output, "<span class=\"Zsym mention\" style=\"font-size:100%;\"> / </span>") end
Juwan (talk) 22:25, 16 December 2024 (UTC)
//
is only used for Chinese, is it not? AFAIK, /
was introduced by {{zh-l}}
. As such, whether it cooperates well with other languages does not matter; the primary audience is Chinese, and /
is aesthetically superior. @JnpoJuwan, Benwing2, Theknightwho —Fish bowl (talk) 01:54, 11 January 2025 (UTC)
//
may have been introduced for Chinese but other languages use it. If you want the full-width solidus, we need to check the language to make sure it's Chinese. Benwing2 (talk) 01:58, 11 January 2025 (UTC)