Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a28a69be8ae26102

Jump to content

Template talk:R from alternative language

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
(Redirected from Template talk:R from alternative language/testcases)
Latest comment: 6 months ago by Paine Ellsworth in topic Edit request 8 January 2026

The template does not recognize English varieties

[edit]

As of writing this Space Opera Theater (permalink) is a member of Category:Redirects from non-English-language terms. This is because the "from" language is "en-us" but the template does not account for this. While this specific redirect can be fixed by changing "en-us" to "en" I still think the underlying bug should be fixed as well. Warudo (talk) 16:37, 23 September 2025 (UTC)Reply

To editor Warudo: have the various forms of English each been given its own ISO 639-1 code? This template was formed to recognize only those languages that have ISO codes. As far as I know, "en" is an ISO code; is "en-us" an ISO code? P.I. Ellsworth, ed.  welcome!  16:47, 23 September 2025 (UTC)Reply
@Paine Ellsworth The template also supports IETF language tags according to its documentation Entries in those categories should be placed into more specific language categories when the "from" and "to" languages are known by using ISO 639 codes or appropriate IETF language tags, such as "en" for English, "la" for Latin, "en-au" for Australian English (see code list). This is a feature that should work correctly according to the docs but doesn't. Warudo (talk) 17:01, 23 September 2025 (UTC)Reply
That was added to the /doc in 2018 as "wishful thinking" and was found to be too complicated for an already too complicated template. It should have been removed from the documentation long ago, so I will do so now. P.I. Ellsworth, ed.  welcome!  17:09, 23 September 2025 (UTC)Reply
I don't agree with that removal. IETF language tags work fine in other cases, like in Laiki Enotita which is tagged with "el-latn" and correctly placed in Category:Redirects from Greek-language terms. I use them pretty often with this template because I know they work. The template should be fixed to handle English varieties instead. Warudo (talk) 17:13, 23 September 2025 (UTC)Reply
The template is not broken. There must be a category that matches the language tag because this code:
{{#if:{{{1|}}}{{{from|}}}{{{lang|}}}
 | [[Category:Redirects from {{#ifexist:Category:Redirects from {{#invoke:Lang|name_from_tag|{{{1|{{{from|{{{lang|}}}}}}}}}}}-language terms
  | {{#invoke:Lang|name_from_tag|{{{1|{{{from|{{{lang|}}}}}}}}}}}
  | non-English
 }}-language terms]]
 | {{#ifeq:{{SUBPAGENAME}}|sandbox||[[Category:Redirects from undetermined-language terms]]
  }}
is looking for:
[[:Category:Redirects from {{#invoke:Lang|name_from_tag|en-us}}-language terms]]Category:Redirects from American English-language terms
create the category.
Trappist the monk (talk) 17:20, 23 September 2025 (UTC)Reply
@Trappist the monk The fallback in case the category does not exist should have been to place the page in Category:Redirects from English-language terms because "en-us" starts with "en-" which shows its English. The fact that the page ended up in Category:Redirects from non-English-language terms is a bug. Warudo (talk) 17:23, 23 September 2025 (UTC)Reply
Also, I created the category based on Category:Redirects from Australian English-language terms but they are both under Category:Redirects from English-language terms so something is still wrong. Warudo (talk) 17:29, 23 September 2025 (UTC)Nevermind, that's an easy fix Warudo (talk) 17:42, 23 September 2025 (UTC)Reply

Edit request 8 January 2026

[edit]

Description of suggested change: This change introduces the {{Title language}} template to ensure that titles of redirects from an alternative language are italicized correctly. I have already implemented the change in the sandbox and it can be tested by applying {{R from alternative language/sandbox}} to any page.

Xoontor (talk) 16:42, 8 January 2026 (UTC)Reply

Please don't paste code blobs into a talk page. The template's sandbox should be quite sufficient to indicate exactly what needs to be altered. --Redrose64 🌹 (talk) 08:49, 9 January 2026 (UTC)Reply
 Completed. P.I. Ellsworth, ed.  welcome!  16:34, 9 January 2026 (UTC)Reply
@Paine Ellsworth: Your edit broke the template in the case where it is used multiple times on the same page, see {{R to English}} § Multiple usage, example: Galiza.
More importantly, italicization can't be suppressed for proper names, like people, places and organizations, see MOS:BADITALICS. Paradoctor (talk) 18:43, 9 January 2026 (UTC)Reply
I see. It caused some {{DISPLAYTITLE:}} conflicts. What do you think about adding a |changetitle= parameter that, when set to "no", prevents the template from using {{Title language}} to change how the title is displayed? I have implemented this in the sandbox. Xoontor (talk) 18:57, 9 January 2026 (UTC)Reply
I've undone the edit until a fix can be found. I'm not sure about adding another parameter to this template in that manner. Maybe the Title language template needs to be made more flexible? P.I. Ellsworth, ed.  welcome!  19:03, 9 January 2026 (UTC)Reply
Thanks for the reply! I think the main problem with my approach is that the {{Title language}} template gets invoked multiple times on some pages, because the {{R from alternative language}} template is used repeatedly there. What changes do you think could make the {{Title language}} template more flexible? Xoontor (talk) 15:29, 11 January 2026 (UTC)Reply
The challenge appears to be that the proposed parameter, |changetitle=no, would have to be added to every redirect page that applies {{R from alternative language}} multiple times (and other DISPLAYTITLE conflicts) before this edit is implemented. If this edit is implemented first, then all those pages will break until the |changetitle=no parameter is added. Gnarly.
As for tweaking the {{Title language}} template, that was just a thought. After studying it I find that it might be better to leave that template as it is. P.I. Ellsworth, ed.  welcome!  00:02, 12 January 2026 (UTC)Reply
I updated the code in the sandbox and added a new parameter (|italic=). When set to "no", the template does not italicize the title but still applies the appropriate language tags. I also added checks to prevent italicizing or adding tags to the title when the redirect language is set to "und", "en", or starts with "en-".
About the redirects that might have problems with my changes, could we make a list of all redirects that use the {{R from alternative language}} template more than once, or combine it with {{DISPLAYTITLE:}}, and add the |changetitle= parameter set to "no" to them? Xoontor (talk) 16:10, 12 January 2026 (UTC)Reply
You might want to review MOS:FOREIGNITALICS and MOS:BADITALICS. Paradoctor (talk) 16:43, 12 January 2026 (UTC)Reply
Are there any issues with my approach? Xoontor (talk) 17:30, 12 January 2026 (UTC)Reply
Did you review them? Does your code comply with them? Paradoctor (talk) 17:43, 12 January 2026 (UTC)Reply
I think it does, though some titles, such as foreign organization names, will have to be set manually using the |changetitle= and |italic= parameters. Xoontor (talk) 19:05, 12 January 2026 (UTC)Reply
@Paine Ellsworth: Do you think it would be possible to create the list of redirects that I mentioned above? Xoontor (talk) 18:10, 13 January 2026 (UTC)Reply
That's a good question, editor Xoontor. I know of no way to separate those out from redirects that only use the rcat template once (vast majority). From what I've seen, the few that have more than one instance of {{R from alternative language}} will have anywhere from two up to six instances of the rcat template. I've been looking at the Aragón redirect, which has two instances, and I'm unable to discern a way to sort it out from the redirects that have only one instance of the rcat template. If you do find a way, please let me know. P.I. Ellsworth, ed.  welcome!  19:26, 13 January 2026 (UTC)Reply