Template talk:Language with name/for

Uses
what uses does this template have? No policy or guideline suggests this should be used. I see no obvious accessibility features (such as those offered by Template:lang concerning screen readers). Does this simply produce a wikilink to the language and transclude the word "for"? — Preceding unsigned comment added by Finnusertop (talk • contribs) 14:35, 13 February 2016 (UTC)
 * Yes, that's precisely what it does -- and it's extremely useful (not to mention gramatically correct) in preference to Template:lang, in situations where it is needed. I would like to see a "no-link" feature added to this template, such that the language name appears optionally only as a word. I'd also like to see quote marks added by default around the word or phrase being translated.
 * For example, consider the opening sentence of this featured article:


 * Musca (fly) is a small constellation in the deep southern sky.
 * Musca is a small constellation in the deep southern sky.


 * The first implies that "fly" is Latin for "Musca". The second clarifies what we really meant -- that "Musca" is Latin for "fly".— Hugh (talk) 01:30, 21 December 2017 (UTC)
 * Umm, no:
 * —Trappist the monk (talk) 01:44, 21 December 2017 (UTC)
 * Thanks! I hadn't read the docs closely enough. I still think the quote marks should be there by default -- you shouldn't have to add them manually. — Hugh (talk) 02:22, 21 December 2017 (UTC)
 * WP:SOFIXIT. I would recommend single quote to match the rendering style of the translation parameter used in the  templates.  Cleanup shouldn't be too onerous since there are only about 200 transclusions of this template.
 * —Trappist the monk (talk) 10:31, 21 December 2017 (UTC)
 * I replicated your fix on today's main page so now this template is cascade protected but that should go away in the normal course.
 * —Trappist the monk (talk) 10:49, 21 December 2017 (UTC)
 * —Trappist the monk (talk) 10:49, 21 December 2017 (UTC)

Thank you. I attempted to make these changes and also add some TemplateData, but it doesn't appear to have worked so I reverted my changes. Can you please help? Thanks! — Hugh (talk) 19:59, 21 December 2017 (UTC)
 * I think that what you wanted to do is something like this (quote marks around ):
 * But, looking at that, I have to wonder why the template is there.  It appears that most instances of this template are written in one of two forms (ignoring redirects):
 * the empty positional parameter (same as the omitted 1) is  in the snippet of code above.  Even if editors wrote template instances with that first positional parameter, the result would very likely be wrong if the point of this template is to identify the preceding text as some-other-language-than-English and text as the English translation.  So, at best,   or 1 should be   which makes the  template markup text as English text (in the English Wikipedia) which is all pointless.
 * the empty positional parameter (same as the omitted 1) is  in the snippet of code above.  Even if editors wrote template instances with that first positional parameter, the result would very likely be wrong if the point of this template is to identify the preceding text as some-other-language-than-English and text as the English translation.  So, at best,   or 1 should be   which makes the  template markup text as English text (in the English Wikipedia) which is all pointless.
 * the empty positional parameter (same as the omitted 1) is  in the snippet of code above.  Even if editors wrote template instances with that first positional parameter, the result would very likely be wrong if the point of this template is to identify the preceding text as some-other-language-than-English and text as the English translation.  So, at best,   or 1 should be   which makes the  template markup text as English text (in the English Wikipedia) which is all pointless.
 * the empty positional parameter (same as the omitted 1) is  in the snippet of code above.  Even if editors wrote template instances with that first positional parameter, the result would very likely be wrong if the point of this template is to identify the preceding text as some-other-language-than-English and text as the English translation.  So, at best,   or 1 should be   which makes the  template markup text as English text (in the English Wikipedia) which is all pointless.


 * If all of that gibberish is right, then perhaps what it is that you really want is something like this:
 * we don't care about the rtl parameter because English has no use for it.
 * we don't care about the rtl parameter because English has no use for it.


 * The next step, of course, is to complete the task by removing extraneous quote marks from the templates in article space. After that, ending the need for the empty parameter or the need to use 2 and 3 is, I think, the final step.  Semi-automated editing tools like WP:AWB would be helpful in these tasks.
 * —Trappist the monk (talk) 20:50, 21 December 2017 (UTC)

Language codes
Why does this template only accept the name of the language (e.g. German) instead of language codes (e.g. de)? Other templates like Lang, In lang, citation templates and infoboxes accept ISO codes, for good reasons I assume. – Finnusertop (talk ⋅ contribs) 14:15, 1 March 2023 (UTC)
 * The template does accept language tags but in doing so it produces unexpected results; cf (taken from the example of the template's doc page):
 * → federal state of Thüringen
 * → federal state of Thüringen
 * Notice in the rendering of the second example that the 'for' word is italicized; if you mouse over that word you get a tooltip that says 'German-language text'. That makes no sense to me.  Further, the word 'Thüringen' (outside of the template) is German so it should be wrapped in a  template.
 * The obvious simple fix is to remove the call to and use   as a preferred alternate to  .  An awb script might then be written to rewrite existing templates to add the appropriate language tag and delete the language name.  Sometime down the road perhaps the template could be rewritten so that   is the lead-in word (Thüringen in the above examples):
 * federal state of Thüringen ( for 'Thuringia')
 * would always be optional so that other stuff (IPA etc) could be inserted between the non-English term and the template.  When   is omitted, the automatic parentheses would be suppressed.
 * —Trappist the monk (talk) 15:19, 1 March 2023 (UTC)
 * I have hacked the sandbox to make the obvious simple fix described above:
 * no
 * term in italics:
 * If this is acceptable, I'll update the live template.
 * —16:36, 1 March 2023 (UTC)Trappist the monk (talk)
 * There having been no comment, I have updated the live template from its sandbox.  tracks  templates that use   (language name).  Templates on those pages should be fixed so that   has the correct language tag and   is blank.
 * —Trappist the monk (talk) 23:09, 4 March 2023 (UTC)
 * no
 * term in italics:
 * If this is acceptable, I'll update the live template.
 * —16:36, 1 March 2023 (UTC)Trappist the monk (talk)
 * There having been no comment, I have updated the live template from its sandbox.  tracks  templates that use   (language name).  Templates on those pages should be fixed so that   has the correct language tag and   is blank.
 * —Trappist the monk (talk) 23:09, 4 March 2023 (UTC)
 * If this is acceptable, I'll update the live template.
 * —16:36, 1 March 2023 (UTC)Trappist the monk (talk)
 * There having been no comment, I have updated the live template from its sandbox.  tracks  templates that use   (language name).  Templates on those pages should be fixed so that   has the correct language tag and   is blank.
 * —Trappist the monk (talk) 23:09, 4 March 2023 (UTC)
 * —16:36, 1 March 2023 (UTC)Trappist the monk (talk)
 * There having been no comment, I have updated the live template from its sandbox.  tracks  templates that use   (language name).  Templates on those pages should be fixed so that   has the correct language tag and   is blank.
 * —Trappist the monk (talk) 23:09, 4 March 2023 (UTC)