Template talk:Language with name

From Wikipedia, the free encyclopedia
  (Redirected from Template talk:LangWithName)
Jump to: navigation, search

Usage[edit]

This template should not be used directly in individual articles. Instead, a template with the name lang-xx shold be created, where the xx is the ISO 639 language code. The contents of this template should take the form:

{{langWithName|xx|language-name|{{{1}}}}}

Where xx is again the ISO 639 code, and language-name is the name of the language.

In turn, when calling a lang-xx template, it should be called in the form:

{{lang-xx|your-text-here}}

See also[edit]

template:rtl-langWithName (uses template:rtl-lang) (Actually, this one fits better for the Arabic example.)

Example[edit]

The lang-ar template contains the following text:

{{langWithName|ar|Arabic|{{{1}}}}}

If it is called as follows:

{{lang-ar|لووووول}}

it yields:

Arabic: لووووول‎‎

This template is very harmful[edit]

This has to be some kind of record in meta-template harmfulness. I'm stunned that people would go to this much trouble, creating so many complicated templated just to avoid typing a few extra letters. In most cases the amount of characters saved is amazingly small and people actually use some of the sub-templates to replace existing links at times. Please don't create any more of these. Ever.

Peter Isotalo 20:19, 15 October 2005 (UTC)

Please see related talk at template talk:lang-uk. These templates are useful and cause no harm, but are being unilaterally removed by this user. Michael Z. 2005-10-16 22:27 Z
I agree this is rather harmful, but I'm not going to edit-war about it :) dab (𒁳) 10:35, 24 July 2007 (UTC)

Similar template[edit]

ko:Template:Llang seems to achieve a similar effect by including ko:Template:언어 이름 (언어 이름 = “language name(s)”), but without the need of creating dozens of other templates. If you like its approach, perhaps something like that can replace this template and most lang-xx templates.—Wikipeditor 05:44, 2 February 2006 (UTC)

No italics[edit]

I've created a variant, {{LangWithNameNoItals}}, to be used for languages whose writing systems do not lend themselves to being written in italics (Hebrew, East Asian languages, etc.) —Angr 11:04, 17 January 2007 (UTC)

this template now forces no italics either. Italics are rather inserted in the "lang-xx" templates transcluding this one. dab (𒁳) 10:34, 24 July 2007 (UTC)

iw[edit]

{{editprotected}} Add no:Mal:LangWithName (Why so many templates protected so only administrators at en:wp can edit them?) Nsaa 18:04, 29 August 2007 (UTC)

Done. A lot of templates are protected here to prevent vandalism, since vandalism on templates can affect many pages. Many templates are being changed so the documentation and interwikis are on a subpage so they can be edited without administrator assistance, but this one hasn't been changed over yet. --- RockMFR 23:21, 29 August 2007 (UTC)
It is now. Rich Farmbrough, 22:54 17 December 2008 (UTC).

Bolding problem with this template.[edit]

See, for example, the Filipino language article. the relevant wikitext there is "'''Filipino language''' ({{lang-fil|Wikang Filipino}})", which renders here as "Filipino language (Filipino: Wikang Filipino)". However, in the Filipino language article, it renders improperly (and in violation ofWP:LEDE#Format of the first sentence, "do not boldface foreign names not normally used in English") as "Filipino language (Filipino: Wikang Filipino)". This is because this template tries to place a self-referential wikilink.

It seems to me that the fix for this would involve magic words and parser functions—about which I am aware but which I don't often use. Could someone who is a better template coder than I please fix this? Thanks. -- Boracay Bill (talk) 06:05, 30 January 2009 (UTC)

Delinking[edit]

I added an optout, |links=no, to make this template not link the language names (should be useful in articles where you're using it over and over and there are overlinking concerns). To make it functional in the shell templates, however,

|links={{{links|yes}}}

or something alone those lines needs to be added to the templates that call this one. For example, I did this to a bunch of the Chinese templates; this make it so someone can use {{zh-sp|s=something|p=something|links=no}} and have it remove the links (for example, in the lede paragraph of Not One Less).

Anyway, whoever wants to help out is welcome to add this code to the other templates to expand the functionality of this, since there are thousands of these templates and I'm in no mood to do it to all of them (I basically just updated the few templates that I myself use). rʨanaɢ talk/contribs 03:12, 17 September 2009 (UTC)

Not using a "language" suffix redirects[edit]

Could someone help fix the issue with articles that don't include the suffix "... language" in their article-titles, e.g. Latin is the actual title, but {{lang-la}} links to Latin language. Please and thank you. :) -- Quiddity (talk) 17:26, 1 July 2010 (UTC)

I don't know of a way to do something like that automatically, but I guess we could hard-code the language codes into this template for languages such as Latin ("la") so the "language" part doesn't show up in the link. However, I gotta ask if it's really that big of a deal and worth the hassle? As long as "Foo language" properly redirects to "Foo", what seems to be the problem?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); July 1, 2010; 17:58 (UTC)
For impetus, I thought we generally tried to fix, or avoid using, redirects in templates. Someone else had requested a fix at Template talk:Lang-la 2 years ago; I was seconding the query.
But you're probably right, that it's not worth adding extra template-complexity just to fix redirect(s).
Perhaps if someone else knows of many other languages that have the same issue, a fix might become warranted. -- Quiddity (talk) 00:35, 2 July 2010 (UTC)
Hmm, you are right about the redirects in templates... I forgot about that. Here's another suggestion then. Instead of overloading this template with the conditionals which will be processed every time but are only going to kick in for a handful of cases (such as Latin), why not copy this template verbatim to another title (such as {{LangWithShortName}}), tweak it so the "language" part doesn't show up, and have {{lang-la}} (and other similar templates, if someone can think of any) call it instead? Granted, we'll have two almost identical templates, but I think considering how heavily this template is used it would be an acceptable compromise?—Ëzhiki (Igels Hérissonovich Ïzhakoff-Amursky) • (yo?); July 2, 2010; 02:01 (UTC)
I found another language that has a redirect issue. The template {{lang-sr-Cyrl}} creates a link to Serbian Cyrillic language. "Serbian Cyrillic" is not a language, but rather one of two standard writing systems for the Serbian language (along with Latin). "Serbian Cyrillic language" is a redirect to Serbian Cyrillic alphabet. — Dale Arnett (talk) 21:37, 12 October 2010 (UTC)
Redirects exist for a reason. Just document the limitation in the template, as I have at Template:Lang-en-GB/doc, and don't complicated the parser code. — SMcCandlish   Talk⇒ ɖ∘¿¤þ   Contrib. 12:56, 1 March 2012 (UTC)

Colon has to be escaped or definition lists get hosed[edit]

Please, ASAP, change the line:

}}: {{{3}}}<noinclude>

to

}}&#58; {{{3}}}<noinclude>

Without this fix, this template cannot be used in ;/: wkimarkup definition lists without causing them to barf.

Test cases

Template structured glossary format[edit]

{{term|1=tyre |content={{lang-en-GB|tyre}}}}
{{term|1=tire |content={{lang-en-US|tire}}}}
{{defn|1=A resilient wheel covering usually made of vulcanized rubber.}}
British English: tyre
American English: tire
A resilient wheel covering usually made of vulcanized rubber.

Results: YesY Correct.

Manually-formatted wikimarkup[edit]

; [[British English]]&#58; {{lang|en-GB|tyre}}
; [[American English]]&#58; {{lang|en-US|tyre}}
: A resilient wheel covering usually made of vulcanized rubber.
British English: tyre
American English: tire
A resilient wheel covering usually made of vulcanized rubber.

Results: YesY Correct.

Wikimarkup + Template:Language with name[edit]

; {{lang-en-GB|tyre}}
; {{lang-en-US|tire}}
: A resilient wheel covering usually made of vulcanized rubber.
British English: tyre
American English: tire
A resilient wheel covering usually made of vulcanized rubber.

Results: N FAIL

SMcCandlish   Talk⇒ ɖ∘¿¤þ   Contrib. 13:04, 1 March 2012 (UTC)

Done Anomie 04:58, 2 March 2012 (UTC)

This scheme should be streamlined[edit]

Instead of having individual templates for every language transcluding this meta template we should have one template only with a parameter for language. As it stands now, if we add a parameter to this template, as I'm going to propose next, then each of the transcluding templates will have to be updated, including user instructions. That is exceedingly cumbersome and impractical. __meco (talk) 09:28, 20 April 2012 (UTC)

Request for added parameter[edit]

I propose a new parameter be added to this template, |silent=yes, which, when active, will cause the name of the language to be suppressed altogether. The cases where this would be used are when the foreign-language term precedes the English name. Then the only effect of using the template would be to categorize the article into the relevant multilingual support category.

A more neat solution to this would perhaps be to modify the existing |links= parameter to handle a different set of values. That would probably mean to give it a new name, e.g. |show=, with the possible values yes (default), unlink and no. This proposal must be seen in connection with my proposal for streamlining this scheme altogether in the previous section. __meco (talk) 09:39, 20 April 2012 (UTC)

Linking language name[edit]

WP:OVERLINK says languages are not usually linked. This template links the language name by default; shouldn't that be changed? Ihardlythinkso (talk) 03:52, 20 January 2014 (UTC)

I think I agree: Obviously the more obscure the language, the stronger the case for linking, especially if it is out of linguistic context. All the best: Rich Farmbrough16:24, 4 July 2014 (UTC).

Suggestion: An optional literal translation[edit]

Hi,

I am an admin, so I can edit this template, but, since it is high use, I thought I should discuss my idea here first.

I think it would be really useful to be able to have an optional literal translation. Then we could have something like the following:

The Prime Minister of Italy (Italian: Presidente del Consiglio dei Ministri, literal translation: President of the Council of Ministers) is the head of government of the Italian Republic.

I am open to suggestion on formatting, for example we could have some kind of abbreviation.

Yaris678 (talk) 19:45, 26 June 2014 (UTC)

I've done some work in the sandbox. What do we think of this?
Italian: Presidente del Consiglio dei Ministri, lit. 'President of the Council of Ministers'
For the benefit of future readers, I will subst the same wikicode below, so that people will know what the template looked like, if it is edited further.
Italian: Presidente del Consiglio dei Ministri, literal translation: President of the Council of Ministers
Yaris678 (talk) 15:29, 4 July 2014 (UTC)
Your subst is another sandbox... so I subt'd that! I think it is a good idea. Is it worth introducing a "link=yes" parameter which would make linking the language name default to no-link, per the above section? All the best: Rich Farmbrough16:27, 4 July 2014 (UTC).
"literally" might be enough (or even "lit." if this were print). And one minor thing, I don't think "small" text is appropriate or needed. All the best: Rich Farmbrough16:29, 4 July 2014 (UTC).
Agreed on both counts. "Lit:" without additional markup is clear enough. I concur that this is a welcome feature, if one that we might want to warn against using too much. Chris Cunningham (user:thumperward) (talk) 16:54, 4 July 2014 (UTC)
I have removed the small-text markup and used the abbreviation. I've used the capitalisation and punctuation suggested by Rich. New subst:
Italian: Presidente del Consiglio dei Ministri, lit. President of the Council of Ministers
Feel free to edit the sandbox yourselves.
Yaris678 (talk) 03:16, 5 July 2014 (UTC)

Roll out[edit]

I have applied the change to Template:Language with name and Template:Lang-it. No one has objected to it. Is it time to roll out the change to all the other Lang-xx templates?

What do we think the best way of doing that is? A bot? AWB? One big push? Slowly but surely?

Yaris678 (talk) 11:43, 15 August 2014 (UTC)

I would suggest doing half a dozen of the most common languages. This should encourage any criticism at the cost of little effort (and while reverting is easy). Give it a few days then use AWB for the rest. All the best: Rich Farmbrough15:32, 15 August 2014 (UTC).

Some questions/suggestions regarding this template[edit]

  1. Do all Lang-x templates templates use {{Language with name}} (or, at least, are they all supposed to)? As far as I can tell, {{Lang-grc}} doesn't, for instance.
  2. If they don't (i.e. intentionally), would it be possible for them to all be converted to use it? That way, they would all get to use |links=.
  3. While we're on it, could we supplement |links= with:
    1. A parameter (something like |language=no) to avoid printing the language name altogether (useful if you're using more than one {{lang-fr}} or whatever in a row, giving you in read mode e.g. "This comes from the French: φ and χ", instead of "This comes from the French: φ and the French: χ")?
    2. A parameter (something like |separator=&#32;) to avoid the colon being printed after the name of the language (it might sometimes fit the sentence the template is embedded in better)?

It Is Me Here t / c 18:19, 1 September 2014 (UTC)

re 3.1: edit proposal is below (|name=no would prevent showing the name).
re 1, 2: Same question for me. I'd like to see it in {{lang-he}}, and for the same reason. Is there a reason they are not using this template?
ping @It Is Me Here: -DePiep (talk) 00:46, 16 October 2014 (UTC)

Why the colon?[edit]

In every Wikipedia context I've seen, the colon in this template is unnecessary, ugly, and different from the usual formatting in other printed matter. Can anyone point to examples in professionally typeset material that uses the colon? In all the books I've looked at recently, you see things like

from French carton
this word, from the French carton, has now ...
from Greek τρόπος

and the like, and never

from French: carton
this word, from the French: carton, has now ...
from Greek: τρόπος

Why do we use the colon? I recommend we get rid of it. --Macrakis (talk) 22:02, 20 September 2014 (UTC)

re Macrakis. See below for a edit request. -DePiep (talk) 01:10, 16 October 2014 (UTC)

Protected edit request on 16 October 2014[edit]

Please copy full Template:Language with name/sandbox code (this edit) into live template code. There are two changes:


Change 1: Parameter |name= added. Option |name=no prevents mentioning of the language name at all.

Example (German; sandbox stack is in place as of today):

Regular:

{{lang-de/sandbox|Bitte}} → German: Bitte
{{lang-de/sandbox|Bitte|links=no}} → German: Bitte

New:

{{lang-de/sandbox|Bitte|name=no}} → German: Bitte

Goal 1: This option is useful when the template (and so the language name) the language name is not to be repeated in a sentence, paragraph or table that has multiple elements of the same language, while the template should be used for its other functions. (rephrase -DePiep (talk) 16:13, 16 October 2014 (UTC))

-DePiep (talk) 00:41, 16 October 2014 (UTC)

Change 2: Parameter |sep=} (for separator) added:

Regular

{{lang-de/sandbox|Bitte}} → German: Bitte

New:

{{lang-de/sandbox|Bitte|sep=xyz}} → German: Bitte
{{lang-de/sandbox|Bitte|sep=}} → German: Bitte

Goal 2: the colon might not always be the right punctuation in a given situation (sentence). See also the two posts above.

Next step

Templates using this metatemplate, like {{lang-de}}, should follow (pass through parameters |name={{{name|yes}}} and |sep={{{sep|&#58;}}}).

-DePiep (talk) 01:00, 16 October 2014 (UTC)

See also Template:Language with name/testcases. -DePiep (talk) 21:57, 16 October 2014 (UTC)
  • Support all of these. I don't want to implement the changes myself, since I suggested something similar above. It Is Me Here t / c 11:13, 16 October 2014 (UTC)
  • Paused. I have put the request on hold, to research more changes. -DePiep (talk) 06:59, 25 October 2014 (UTC)

Problems with Template:Lang-la[edit]

There's a little annoyance that I have noticed. {{lang-la}} produces the redirecting link [[Latin language|Latin]], which redirects to Latin. It seems {{lang-la}} uses {{language with name}} to create the link. I don't understand how this template works, so I can't answer this question: Is there a way that {{language with name}} can be modified to produce the sequence [[x]] instead of [[x language|x]] in the cases of languages like Latin and Old English, whose article names do not end in language? — Eru·tuon 02:32, 18 December 2014 (UTC)

There would be no advantage to this, since all the redirects are in place. The good sense is to keep the template as simple as possible to use and to maintain. All the best: Rich Farmbrough, 23:27, 24 July 2015 (UTC).

Requirements of parameters for lang-x template[edit]

Hi,
Kindly enable the parameters links and lit for {{Template:lang-fa}} as in {{Template:lang-ar}} ({{Language with name|ar|Arabic|{{{1}}}|links={{{links|yes}}}|rtl=yes|lit={{{lit|}}}}}).
Reference: see User talk:Harithvh § Language with name.
(harith (talk) 12:21, 28 September 2015 (UTC))

Would you kindly provide a list of templates needing to be changed? How many are protected? — Martin (MSGJ · talk) 14:04, 28 September 2015 (UTC)
 Done I think. Let me know if there are any others. — Martin (MSGJ · talk) 19:56, 28 September 2015 (UTC)
@MSGJ: Face-wink.svg Thanks, I have not checked all, but the ones I have noted that needed to changed are as follows, the bold ones are those I wanted to change yesterday, but somehow missed: (harith (talk) 02:46, 29 September 2015 (UTC))
Extended content

      {{Template:Lang-bh}}
      {{Template:Lang-bpy}}
      {{Template:Lang-ckb}}
      {{Template:Lang-dv}}
      {{Template:Lang-gju}}
      {{Template:Lang-hin}}
      {{Template:Lang-hif}} (may use italics)
      {{Template:Lang-hnd}}
      {{Template:Lang-khw}}
      {{Template:Lang-kmr}}
      {{Template:Lang-knn}}
      {{Template:Lang-kok}}
      {{Template:Lang-ks}}
      {{Template:Lang-ku}}
      {{Template:Lang-ku-Arab}}
      {{Template:Lang-ku-Cyrl}}
      {{Template:Lang-mar}}
      {{Template:Lang-mzn}}
      {{Template:Lang-ne}}
      {{Template:Lang-pa}}
      {{Template:Lang-pal}}
      {{Template:Lang-peo}}
      {{Template:Lang-phr}}
      {{Template:Lang-pi}}
      {{Template:Lang-pka}}
      {{Template:Lang-pra}}
      {{Template:Lang-ps}} (parameter lit only)
      {{Template:Lang-psu}}
      {{Template:Lang-pun}} (parameter lit only)
      {{Template:Lang-raj}}
      {{Template:Lang-sdh}}
      {{Template:Lang-si}}
      {{Template:Lang-skr}}
      {{Template:Lang-tg}}.

@Harithvh: a lot of these are not protected. Could you just list those that you need help with? — Martin (MSGJ · talk) 12:41, 29 September 2015 (UTC)
@MSGJ:Hi, Thanks for the notification, the ones needed help are {{Template:Lang-ku}}, {{Template:Lang-ne}}, and {{Template:Lang-pa}}. —(harith·discuss) 03:23, 30 September 2015 (UTC)
 Done — Martin (MSGJ · talk) 08:32, 30 September 2015 (UTC)

Abbreviation for literally[edit]

 Done

The abbreviation for "literally" should marked up semantically. The lightweight option is <abbr title="literally">lit.</abbr> which returns: lit.. A complete example would be:
French: déjà vu, lit. already seen
instead of
French: déjà vu, lit. already seen
Thoughts? —LLarson (said & done) 17:58, 21 January 2016 (UTC)

I updated the sandbox with this proposal, and updated {{lang-fr/sandbox}}, {{lang-ht/sandbox}}, and {{lang-de/sandbox}}, to look to the sandbox instead of the live version of the template. All the pieces come together in testcases, where the demonstration now is live. —LLarson (said & done) 20:41, 24 March 2016 (UTC)
@SMcCandlish: I submitted this proposal almost three months ago and presented a modified sandbox with testcases almost three weeks ago and there have been no objections. Would you consider updating the template? —LLarson (said & done) 21:16, 12 April 2016 (UTC)
@LLarson: Done. Seems straightforward enough. We shouldn't add that around every abbreviation everywhere. We don't need it for "Dr[.]", for example, and it would be pointless if done to an abbr. used shortly after the expanded version, since it's already clear what it means in context. But it makes sense in a case like this, where it's usually the first (possibly only) occurrence on the page. The only downside I can think of is if it's used several times in the same block of text, e.g. to translate an English colloquial phrase into rough but not literal versions in 5 other languages. We don't do that often, though.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  21:00, 13 April 2016 (UTC)

Single quotes for value of "lit" parameter[edit]

Per MOS:SINGLE, it should also be generating single quotes around the gloss supplied in |lit= (i.e. appearing after the text "lit.". I've implemented this in the sandbox, so the test cases in the above thread also testcase this. I implemented it as &apos;, so that it does not accidentally trigger any parsing problems, e.g. when used with a value that leads or ends with the same character, which would put two in a row and turn on italicization accidentally. The only downside I can think of is that in a few cases where people have included single quotes around a value manually (e.g. as {{lang-es|mi casa es su casa|lit='my house is your house'}} that it will produce output like: Spanish : mi casa es su casa, lit. ''my house is your house''. But this is not a big problem. It just looks like double quotes (which many cases already incorrectly have), and it's not any more incorrect that the majority use (no quotes at all) that we're stuck with in the vast majority of cases. A bot can fix it; just look for any string in this template, occurring after |[optional whitespace]lit[optional whitespace]=[optional whitespace] that both begins and ends with a ' (or, while we're at it, any other quotation-character pairs). I could probably cobble up the regular expression to do this myself.  — SMcCandlish ¢ ≽ʌⱷ҅ʌ≼  21:29, 13 April 2016 (UTC)

You know I’m pretty fond of you and your work, but this doesn’t look quite right to me; apologies if I got the order of operations wrong, but I brought it up on MOS talk instead of here. Thank you, again. —LLarson (said & done) 16:48, 14 April 2016 (UTC)