Jump to content

Help talk:Citation Style 1/Archive 34

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Lowercase sigmabot III (talk | contribs) at 05:16, 27 June 2017 (Archiving 1 discussion(s) from Help talk:Citation Style 1) (bot). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Archive 30Archive 32Archive 33Archive 34Archive 35Archive 36Archive 40

|ol= prefix

In its present incarnation, {{cite Q}} is a meta-template using {{citation}}. It uses parameter values obtained from wikdata. Wikidata holds OpenLibrary identifiers that begin with an 'OL' prefix. cs1|2 emits an error message when the value assigned to |ol= has an 'OL' prefix. Because this situation is reminiscent of this discussion, I have modified the |ol= error checking to quietly accept OL identifiers with the OL prefix. The appearance of the rendering has not changed:

Cite book comparison
Wikitext {{cite book|ol=OL7130221M|title=Treasure Island}}
Live Treasure Island. OL 7130221M.
Sandbox Treasure Island. OL 7130221M.

Trappist the monk (talk) 10:19, 28 May 2017 (UTC)

Thank you for this. It is a good application of Postel's Law. Andy Mabbett (Pigsonthewing); Talk to Andy; Andy's edits 14:24, 28 May 2017 (UTC)
Thanks from me also. What's old is new again (link to previous discussion, September 2014). – Jonesey95 (talk) 14:35, 28 May 2017 (UTC)

single quote for an ASCII quote

As the Module talk:Citation/CS1/COinS seems to be moribund, I decided to post here.

It took me a hour or more to work out that this was the cause of a problem that I have, because I read Help:CS1 and could not see that it was an obvious feature (so I assumed it was some sort of hidden character in the string or a fault in my scripting):

* {{cite encyclopedia
  |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]]
<!-- |encyclopedia=A well known encyclopedia -->
}}

Works

* {{cite encyclopedia
  |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]]
|encyclopedia=A well known encyclopedia
}}

Does not work because the has been replaced with '

The reason for this substitution is in Module:Citation/CS1/COinS line 177:

value = value:gsub ('<span class="nowrap" style="padding%-left:0%.1em;">&#39;(s?)</span>', "'%1");	-- replace {{'}} or {{'s}} with simple apostrophe or apostrophe-s

What is the thinking behind this line? -- PBS (talk) 12:57, 25 May 2017 (UTC)

HO-hum it seems that is unlikely to be the line as &#39; is an ordinary ASCII single quote ' so presumably the conversion is elsewhere. -- PBS (talk) 13:13, 25 May 2017 (UTC)

Line 177 in Module:Citation/CS1/COinS is not the problem. That line is looking for all of the styling that is transcluded when the {{'}} and {{'s}} templates are part of a cs1|2 parameter value because we don't want all of that extraneous html and css in the metadata.
The bug you found is in the function kern_quotes() in Module:Citation/CS1. There, the and characters (U+2018 & U+2019) are replaced with simple typewriter quotes, perhaps a bit overzealously. I've tweaked the sandbox to limit that replacement so that only those curly quotes that are the first and last characters to the title are replaced:
{{cite encyclopedia/new |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] |encyclopedia=A well known encyclopedia}}
"fr:Dictionnaire universel d'histoire et de géographie Bouillet Chassang/Spenser (edmond)" . A well known encyclopedia.
Your example that 'worked', worked because the title is not rendered in quotes; it was instead rendered in italics. Kerning is only applied to titles that the cs1|2 templates wrap in quote marks.
Trappist the monk (talk) 13:55, 25 May 2017 (UTC)

When I was trying to understand the example, I was distracted by what I perceived as errors in writing the citation. Maybe the following would be less distracting:

* {{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)| SPENSER (Edmond)]] |encyclopedia = Dictionnaire universel d'histoire et de géographie | last1 = Bouillet | first1 = Marie-Nicolas | last2 = Chassang | first2 = Alexis }}

  • Bouillet, Marie-Nicolas; Chassang, Alexis. "SPENSER (Edmond)" . Dictionnaire universel d'histoire et de géographie.

As in PBS's report, Wikisource can't find the article. Note that I intentionally changed the curly single quote (used as an apostrophe) to a straight quote in the encyclopedia parameter. Jc3s5h (talk) 14:35, 25 May 2017 (UTC)

The problem is that it can not easily be solved with redirects on Wikisource because as with this book, the will be hundreds subpages under the main page for many Wikisource sources. See for example:
This also affects links into sections within a page where, unlike Wikipedia, Wikisouce often uses ‘’ “” so potentially we have a problem that to access a section on Wikisource an ASCII single quote 's would be needed in the section header even though the rest of the text uses ’s. -- PBS (talk) 16:40, 25 May 2017 (UTC)
" I've tweaked .. those curly quotes that are the first and last characters to the title are replaced". Given that the links can be to sections this might not be sufficient as like this one s:1911 Encyclopædia Britannica/Great Rebellion#The "Crowning_Mercy" it is possible that a funny quotation mark may be at the end of a title string (or at least before a | or a ]]) — this particular example has been hacked to use strait double quotes in the anchor, but the text has a pair of “”.
This explains why a link using {{cite EB1911}} fails on trying to link to that section, but does link to the one immediately before it.
-- PBS (talk) 17:04, 25 May 2017 (UTC)

First things first: the reason that your {{cite EB1911}} example does not work has nothing to do with any kind of quotes. The link doesn't work because a space (or underscore) is missing from between 'Crowning' and 'Mercy'. If I rewrite that example as:

{{cite EB1911|short=x|wstitle=Great Rebellion#The "Crowning Mercy"}}
"Great Rebellion#The "Crowning Mercy". Encyclopædia Britannica (11th ed.). 1911.

the link works and takes me to the proper place in the wikisource text.

Now quotes and kerning. cs1|2 renders certain titles inside double quote marks. Sometimes titles, especially news article titles, contain single or double quote marks: Alien abduction survivor: 'They've got Elvis!' Without kerning, the terminal quote mark in my example would be placed directly adjacent to the trailing double quote mark applied by the cs1|2 template; kerning inserts a small amount of space so that the two quote marks can be distinguished. When I originally wrote the kerning code, I deferred support for wikilinked title text that cs1|2 would render in quotes because, in general, there is relatively little need for linking to en.wiki articles about a chapter or news article (if there are any such articles). Of course that ignores interwiki links to WikiSource among others.

The problem with wikilinked quoted title text is that kern_quotes() is looking for a single or double quote mark as the first and/or last character in the title text. With wikilinks, the wiki markup gets in the way and there are two forms of wikilink. For the time being, and until I noodle out an appropriate solution, for wikilinks like the first example below, kern_quotes() shall do nothing because there is no 'label' for that link. In the second example, because there is a label, kern_quotes() does insert the space to separate quote marks:

Cite encyclopedia comparison
Wikitext {{cite encyclopedia|encyclopedia=Encyclopædia Britannica|title=[[Wikisource:1911 Encyclopædia Britannica/Great Rebellion#The "Crowning Mercy"]]}}
Live "1911 Encyclopædia Britannica/Great Rebellion#The "Crowning Mercy". Encyclopædia Britannica.
Sandbox "1911 Encyclopædia Britannica/Great Rebellion#The "Crowning Mercy". Encyclopædia Britannica.
Cite encyclopedia comparison
Wikitext {{cite encyclopedia|chapter=[[Wikisource:1911 Encyclopædia Britannica/Great Rebellion#The "Crowning Mercy"|The “Crowning Mercy”]]|encyclopedia=Encyclopædia Britannica|title=Great Rebelion}}
Live "The "Crowning Mercy". Great Rebelion. Encyclopædia Britannica.
Sandbox "The "Crowning Mercy". Great Rebelion. Encyclopædia Britannica.

I have restored the curly quote replacement code because kerning shall not be applied to the link portion of a wikilink. The example above, uses curley quotes in the label part of the wikilink. The example below shows that even with the curley quote replacement code restored, the link to wikisource works:

Cite encyclopedia comparison
Wikitext {{cite encyclopedia|encyclopedia=A well known encyclopedia|title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]]}}
Live "fr:Dictionnaire universel d'histoire et de géographie Bouillet Chassang/Spenser (edmond)" . A well known encyclopedia.
Sandbox "fr:Dictionnaire universel d'histoire et de géographie Bouillet Chassang/Spenser (edmond)" . A well known encyclopedia.

Trappist the monk (talk) 17:15, 26 May 2017 (UTC)

The sandbox version of the first "Crowning Mercy" example now has properly kerning.
Trappist the monk (talk) 19:39, 26 May 2017 (UTC)

Sorry for the mistake, and thanks for pointing it out. "kerning" is nice to have, however not having it is not a show stopper. How soon can the fix to access to "wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Index alphabétique - A" be available in production? -- PBS (talk) 12:25, 28 May 2017 (UTC)

I have made an interim change to the live module that permits:
{{cite encyclopedia |title=[[wikisource:fr:Dictionnaire universel d’histoire et de géographie Bouillet Chassang/Spenser (edmond)]] |encyclopedia=A well known encyclopedia}}
"fr:Dictionnaire universel d'histoire et de géographie Bouillet Chassang/Spenser (edmond)" . A well known encyclopedia.
Kerning in this live version is still broken.
Trappist the monk (talk) 13:38, 28 May 2017 (UTC)
Thanks for the improvement. -- PBS (talk) 09:18, 29 May 2017 (UTC)

Categorization for multiple languages in para language

Why there is only one category (for first language) added when there are two or more languages entered in para |language=? --Obsuser (talk) 03:03, 3 June 2017 (UTC)

Please link to an example article when raising questions like this. Thanks. – Jonesey95 (talk) 05:10, 3 June 2017 (UTC)
Good catch. Because of an oversight on the part of the programmer. The function add_prop_cat() has a primary purpose of preventing the addition of multiple duplicate categories of the same kind at the end of the rendered citation. When there are multiple languages in |language=, add_prop_cat() receives one of two key values: foreign_lang_source or foreign_lang_source_2. If add_prop_cat() has never seen these keys previously while processing |language=, then the property category is added to the list. Once seen, no more of that kind of property cat will be added.
I have modified language_parameter() append the ISO 639 language code to the property's key to make each key language specific and add_prop_cat() to remove the code for rendering. If you copy this:
{{code|{{cite book/new |script-title=he:Title |language=sr, he, Old English, es, fr, Delaware}}}}
and paste it into article space and click Show preview (don't save) you should see this:
<cite class="citation book"> <bdi lang="he" >Title</bdi> (in Serbian, Hebrew, Old English, Spanish, French, and Delaware).</cite><span title="ctx_ver=Z39.88-2004&rfr_id=info%3Asid%2Fen.wikipedia.org%3AFrank+Speck&rft.btitle=Title&rft.genre=book&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook" class="Z3988"><span style="display:none;"> </span></span>[[Category:CS1 uses Hebrew-language script (he)]][[Category:CS1 Serbian-language sources (sr)]][[Category:CS1 Hebrew-language sources (he)]][[Category:CS1 foreign language sources (ISO 639-2)|ang]][[Category:CS1 Spanish-language sources (es)]][[Category:CS1 French-language sources (fr)]][[Category:CS1 foreign language sources (ISO 639-2)|del]]
I think that there is a slightly better way to do this and will pursue that idea a bit later.
Trappist the monk (talk) 12:07, 3 June 2017 (UTC)

CS1 maint: English language specified

Just wonder what happened to Category:CS1 maint: English language specified? Why was it removed? – Danmichaelo (talk) 04:30, 6 June 2017 (UTC)

Fishing lesson: Scroll to the top of this page, find the "Search archives" box, type "English language specified", and you will get this result. The discussion is in Archive 8. – Jonesey95 (talk) 04:57, 6 June 2017 (UTC)