Template talk:cite-book

From Wiktionary, the free dictionary
Latest comment: 4 months ago by JeffDoozan in topic Pseudo-Roman numerals in entry names
Jump to navigation Jump to search

Indentation

[edit]

This uses a clever system to stop users doing their own indentation. Clever, yes, but why? Mglovesfun (talk) 10:08, 23 June 2010 (UTC)Reply

Formatting of poems is broken

[edit]

This template is broken for poetry:

Lydia Sigourney (1850) The Brother from Poems for the Sea, page 71:

Even, if our sails like ribbons fly,
And the dead-lights long are in,
Hard up the helm! and keep good heart!
Till skies are bright again.

This doesn't indent properly and it isn't recognised by the quotation-hiding JS. Inductiveload 23:56, 22 March 2011 (UTC)Reply

First of all, you should use {{quote-book}} in entries- it's more frequently updated and and more likely to reflect current policy. Second, see Wiktionary:Quotations#Line_breaks Nadando 00:05, 23 March 2011 (UTC)Reply
Thanks for the prompt reply. I've added a "see-also" to the template to make this clear to other bumblers like me who stumble on this template first. As for the formatting, that's what I was doing anyway, so that's OK! Inductiveload 02:40, 23 March 2011 (UTC)Reply

Additional "url2" parameter

[edit]

@Fay Freak: regarding your edit summary here where you noted that "T:cite-book currently does not support url2, unlike T:quote-book" and tagged me, when would you need to use |url2= with {{cite-book}}? — SGconlaw (talk) 19:49, 28 October 2018 (UTC)Reply

@Sgconlaw For giving alternative links for the same hosted on different servers. So I thought in {{R:gez:Dillmann}} that it is non-standard to use a plain-link to the full work around the title which is what is now done as otherwise links to works are displayed as [n]. This case is not so good an example because the Dillmann template now links a) to pages on one server if a page number is passed b) to the full work on archive.org in any case c) to a digitization project via |entry=, i. e. they are of three kinds and two are conditional only. Imagine better {{R:Grimm}}: Currently it goes over woerterbuchnetz.de, it could also link via DWDS. This is not saying which way additional links would be displayed – not too intrusive, not too hidden. Fay Freak (talk) 20:07, 28 October 2018 (UTC)Reply

Translation parameter

[edit]

@Sgconlaw Exists in {{quote-book}} but not {{cite-book}}. – Jberkel 05:19, 14 December 2018 (UTC)Reply

Do you mean |trans-title= (to provide for a translation of the title of a work)? Do you want that added to the {{cite}} templates? — SGconlaw (talk) 06:25, 14 December 2018 (UTC)Reply
@Sgconlaw: no, something like |trans-passage=. See Special:Diff/47264081/51084425. Jberkel 07:08, 14 December 2018 (UTC)Reply
Oh, you mean |translation=. Yes, that feature was not built into the {{cite}} templates, as it is a feature from {{quote-meta}}. Is it likely to be used often? — SGconlaw (talk) 07:29, 14 December 2018 (UTC)Reply
For English entries probably not that often, but for non-English entries it would definitely be useful. – Jberkel 11:01, 14 December 2018 (UTC)Reply
OK, let me work on it. — SGconlaw (talk) 19:04, 14 December 2018 (UTC)Reply
@Jberkel: Done Done. I've added |translation=. Let me know if it works properly. — SGconlaw (talk) 04:12, 21 December 2018 (UTC)Reply
@Sgconlaw: works fine, thanks. One unrelated thing I noticed is that we don't include HTML5 language attributes to mark up non-English content in citations/quotes. Does this require the language code changes? – Jberkel 09:35, 21 December 2018 (UTC)Reply
Probably because I have no idea what those are. Could you please explain? Why is such markup useful? — SGconlaw (talk) 09:37, 21 December 2018 (UTC)Reply
Now that quote templates take a language code we can add the language code to the generated HTML, to mark the content as written in another language (if not specified it defaults to the document's language, English). This is useful for accessibility, e.g. screenreaders (MDN documentation). If you want I can take a look at it. – Jberkel 09:56, 21 December 2018 (UTC)Reply

──────────────────────────────────────────────────────────────────────────────────────────────────── Sure. Would that be for {{quote}} only, or both {{cite}} and {{quote}}? — SGconlaw (talk) 10:26, 21 December 2018 (UTC)Reply

For anything which outputs non-English text. – Jberkel 12:28, 19 January 2019 (UTC)Reply

Url parameter

[edit]

@Sgconlaw is no longer used, e.g. the cite in Special:Diff/47018325/51284977 doesn't show as link. Has it been renamed? – Jberkel 12:28, 19 January 2019 (UTC)Reply

That's odd. Let me check. — SGconlaw (talk) 12:31, 19 January 2019 (UTC)Reply
@Jberkel: Done Done. There was a coding error which should now be fixed. — SGconlaw (talk) 20:43, 19 January 2019 (UTC)Reply
@Sgconlaw Looks like it's not working again, see {{R:Carro 1888}} (which is run by this template).-TagaSanPedroAko (talk) 19:40, 7 February 2023 (UTC)Reply
Seems the current issue is due to a possible coding error introduced into {{cite-meta}} in the latest version. TagaSanPedroAko (talk) 19:45, 7 February 2023 (UTC)Reply
@TagaSanPedroAko: pinging @Ioaxxere who recently worked on {{cite-meta}}. — Sgconlaw (talk) 20:27, 7 February 2023 (UTC)Reply

Translator parameter

[edit]

@Sgconlaw, the parameter |trans=/|translator=/|translators= simply throws the translator's name directly after the closing parenthesis of the date, without a space or punctuation mark or anything. See {{R:sga:Thurneysen}} for an example. Can this be fixed, please? —Mahāgaja · talk 20:20, 24 May 2019 (UTC)Reply

OK, let me check. — SGconlaw (talk) 03:01, 25 May 2019 (UTC)Reply
Thanks! I think that the translator info should come after the title, maybe like this:
  • Rudolf Thurneysen (1940, reprinted 2003), A Grammar of Old Irish, transl. D. A. Binchy and Osborn Bergin, Dublin Institute for Advanced Studies
How does that look to you? —Mahāgaja · talk 11:44, 25 May 2019 (UTC)Reply
Mmmm, not really sold on that. All the (offline) citations I've seen have the translator's name before the title. — SGconlaw (talk) 18:35, 26 May 2019 (UTC)Reply
What about:
  • Rudolf Thurneysen (1940, reprinted 2003), transl. D. A. Binchy and Osborn Bergin, A Grammar of Old Irish, Dublin Institute for Advanced Studies
then? I do feel it makes more sense to have "transl." before the translators' names. For that matter, I wish |editor=/|editors= gave an output like "ed. Ed Itor" rather than "Ed Itor, editor". Otherwise there are just too many things separated by commas. —Mahāgaja · talk 12:45, 27 May 2019 (UTC)Reply

First tie putting book as a ref

[edit]

Hi, I'm trying to put this info as a book reference. https://www.researchgate.net/publication/280191520_Yuri_Dolgopolov_A_Dictionary_of_Confusable_Phrases_More_Than_10000_Idioms_and_Collocations_Jefferson_NC_McFarland_2010_v397_pp_ISBN_978_0_7864_5855_4_4795_55_review I am struggling, can anyone offer help as to how to format this?Halbared (talk) 14:54, 24 June 2020 (UTC)Reply

I would format it as follows:
{{cite-book
|author=Yuri Dolgopolov
|title=A Dictionary of Confusable Phrases: More Than 10,000 Idioms and Collocations
|location=Jefferson, North Carolina
|publisher=McFarland 
|year=2010
|isbn=978-0-7864-5855-4
}}
@Halbared: You can add other parameters like |chapter= and |page= or |pages= as necessary. —Mahāgaja · talk 15:25, 24 June 2020 (UTC)Reply
thank you. Halbared (talk) 22:41, 24 June 2020 (UTC)Reply
[edit]

I think we should have a parameter like |paywall= if link URL is paywall access that adds a lock icon. @Hazarasp --{{victar|talk}} 09:06, 11 May 2021 (UTC)Reply

Agreed (you probably know this already, but Wikipedia does something along those lines), though I don't have the energy or attention to implement it or see what others think for the time being. That's why I only mentioned it a offhand comment rather than bringing it up in a way that would facilitate discussion. Hazarasp (parlement · werkis) 09:24, 11 May 2021 (UTC)Reply
Shouldn't be too difficult to implement. We already have something like it at {{R:OED Online}}. However, I think we should wait for the outcome of the discussion about {{cite-meta}} that is taking place at the Beer Parlour. — SGconlaw (talk) 13:45, 11 May 2021 (UTC)Reply

Wrong format

[edit]

This template produces citations in the wrong format. They should start with the year, for instance. DAVilla 08:48, 26 June 2021 (UTC)Reply

@DAVilla: no, references don’t generally begin with the year. If you want to add a quotation to an entry, use {{quote-book}}. — SGconlaw (talk) 09:05, 26 June 2021 (UTC)Reply
Oh sorry, wrong purpose then. DAVilla 09:13, 26 June 2021 (UTC)Reply

Missing space

[edit]

@Sgconlaw there's a missing space between the year and translator here grammelot (1991 cite, references).– Jberkel 11:47, 4 March 2022 (UTC)Reply

Also, how does one add the original (here Italian) title? – Jberkel 12:02, 4 March 2022 (UTC)Reply
@Jberkel: I'll look into the spacing issue. What do you mean by the original title? — SGconlaw (talk) 20:23, 6 March 2022 (UTC)Reply

line value is not displayed

[edit]
  • Code: {{cite-book|line=Line|page=Page|title=Title|year=Year}}
Result: Title, Year, page Page, line LineИгорь Тълкачь (talk) 13:13, 2 April 2022 (UTC)Reply
@Useigor: Fixed. I'm not sure why they were missing. — Sgconlaw (talk) 14:23, 22 March 2023 (UTC)Reply

Title not italicized?

[edit]

Please pardon me—I am primarily (and secondarily) a Wikipedia editor. I am puzzled—why is the title not italicized, as is standard for longer works? DocWatson42 (talk) 12:33, 22 March 2023 (UTC)Reply

@DocWatson42: yes, it is. Can you give an example of when it is not italicized? — Sgconlaw (talk) 14:17, 22 March 2023 (UTC)Reply
@Sgconlaw: Pruett#Further reading, for the template Template:R:en:DAFN in mobile using Safari 15 under iOS v15.7.3. (The template's output looks fine in desktop under macOS 13.2.1, in both Firefox v111.0.1 and Safari Version 16.3.) So it's very likely it's the template. — DocWatson42 (talk) 01:49, 23 March 2023 (UTC)Reply
@DocWatson42: it must be something to do with your browser, as the title Dictionary of American Family Names appears italicized when I view the template and the Pruett entry. — Sgconlaw (talk) 04:12, 23 March 2023 (UTC)Reply
@Sgconlaw: Which browser? —DocWatson42 (talk) 04:14, 23 March 2023 (UTC)Reply
@DocWatson42: the one(s) you’re using to view this website. I’m using Safari on an iPad at the moment (latest version of the app and iOS) and can see the italics. — Sgconlaw (talk) 04:21, 23 March 2023 (UTC)Reply
@Sgconlaw: Actually, I meant your browser, but you also answered my question. Have you tried other browsers? —DocWatson42 (talk) 04:45, 23 March 2023 (UTC)Reply
@DocWatson42: yes, I can see the italics on my MacBook with Mozilla Firefox too. — Sgconlaw (talk) 05:53, 23 March 2023 (UTC)Reply
@Sgconlaw: Thank you. Have you tried using a phone? I forgot to specify that have been using an iPhone. (Though at this point I suppose I should just take it up with the technical folks. Would that be Wikimedia Phabricator?) —DocWatson42 (talk) 06:04, 23 March 2023 (UTC)Reply
@DocWatson42: it is italicized on my iPhone (Safari on iOS 16.3.1) as well. You might need to try updating your browser and operating system to the latest available, and see if that resolves the issue. If not, yes, I guess the Phabricator would be the best place to report the issue. — Sgconlaw (talk) 13:16, 23 March 2023 (UTC)Reply
@Sgconlaw: Thank you again. The browser and OS are already the latest available for the phone, which is an <ahem> iPhone 6S+. (Ancient, I know.) —DocWatson42 (talk) 04:52, 24 March 2023 (UTC)Reply

quote-book compatibility

[edit]

@Sgconlaw I'm interested in making the cite-* templates use the same numbered and named parameters as their quote-* counterparts, but I notice that while quote-book requires the language code as |1=, in cite-book it's an optional named param |lang= and |1= is used for the year. I can use a bot to rename |lang= to |1= in all of the existing calls to {{cite-book}} (included any R: templates), [1] but before undertaking that I wanted to solicit feedback? Would switching |1= from year to lang be too drastic of a change of editors already used to the cite- templates, or would better compatibility with the quote- templates be worth it? JeffDoozan (talk) 19:34, 25 February 2024 (UTC)Reply

  1. ^ Of the existing 42,000 uses of cite-book, only 4,200 include |lang= and 7,000 mistakenly include the lang id in |1=. The remaining 30,000 cite-book uses without a language code reference only 5400 unique titles. 1700 of these are cited only in English sections so it might be safe to assume they're in English an assign them a code automatically. The remaining 3400 titles could be assigned a language code "?" and the template could ignore it or display a gentle "(please add missing language id)" prompt like {{quote-book}} does with a missing date. I could also generate a list of the titles and the sections they appear in that might facilitate bulk cleanup of the cites with a missing code.
@JeffDoozan: you aren't proposing to make the language parameter mandatory, are you? If not, I don't really have any objection if you want to assign it to |1=, though I'm guessing this may involve a lot of updates to uses of the reference templates. (I'm not sure the language parameter needs to be compulsory for reference templates. Unlike quotation templates, we don't place entries into language categories by the use of reference templates in them. Also, as many reference templates are multiple-language dictionaries, it would be artificial to claim that such a work is of a single language.) — This unsigned comment was added by Sgconlaw (talkcontribs) at 22:55, 1 March 2024 (UTC).Reply
@Sgconlaw: I'm not proposing that it be mandatory, just checking that there are no objections to moving it from lang= to 1= as a step towards making it possible to switch between quote-* templates and cite-* by simply changing "cite-" to "quote-" and vice versa. I understand this will involve careful editing of many existing reference templates, and will make any changes in a way that doesn't break anything during the transition. JeffDoozan (talk) 17:01, 2 March 2024 (UTC)Reply
@JeffDoozan: OK, thanks! — Sgconlaw (talk) 17:16, 2 March 2024 (UTC)Reply
@Sgconlaw I've added "cite" formatting to Module:quote with the goal of letting the quote-* templates and the cite-* templates share the parameters and much of the some formatting code. I've kept the citation formatting as close as possible to the existing cite-meta formatting, but there are some minor differences. If you have a chance, could you take a look at User:JeffDoozan/cite-book/tests and let me know if you see any objectionable changes between the old and the new results? The page is very big, but I've ordered it to show the most common uses first and to highlight the biggest differences in each section so it shouldn't be necessary to review more than a handful to see if the changes are objectionable or not. JeffDoozan (talk) 17:46, 6 April 2024 (UTC)Reply
I think they should be undone. Citation templates are very different from quotation templates. Most templates will never need a language as it's only intended for non-English works. -- Sokkjō 03:11, 13 April 2024 (UTC)Reply
Fallacious reasoning, borderline barratrous, and empirically unsound. I have long awaited this change, for I have templates that function as both, and this change makes making reference and quotation templates easier. The prevalence of templatization in non-English cites and quotes weighs heavy, and I don’t want to play out a distinction of foreign languages versus English either way. Fay Freak (talk) 22:30, 13 April 2024 (UTC)Reply

@JeffDoozan The merger of the functionalities of {{cite-book}} with those of {{quote-book}} has the consequence that |entry= is interpreted as identical to |chapter=, and that letters that happen to occur in Roman numerals are interpreted as Roman numerals. For example, at mil#Irish, {{R:DIL}} and {{R:ga:Ó Dónaill}} are both displaying "chapter MIL" instead of displaying a dictionary entry called mil. —Mahāgaja · talk 11:18, 2 May 2024 (UTC)Reply

I thought this is an issue which has existed with both the cite and quote templates even in the past. Perhaps we can add the functionality of allowing ! to be added in front of the value given to |chapter= and |entry=, which would tell the template to display the value as-is and not process it. (This feature currently applies to |volume=.) — Sgconlaw (talk) 12:36, 2 May 2024 (UTC)Reply
Maybe the issue has existed for longer, but I noticed it today. —Mahāgaja · talk 12:45, 2 May 2024 (UTC)Reply
@Mahagaja: you know, I wonder why the module is evaluating “MIL” as a chapter number. As far as I know it’s not a valid Roman numeral. — Sgconlaw (talk) 13:04, 2 May 2024 (UTC)Reply
No, it's not, but I suppose the module wasn't written to detect the validity of Roman numerals. —Mahāgaja · talk 13:09, 2 May 2024 (UTC)Reply
Oh no but I like to give the parameters to the template in the same order as they appear in the output, and |lang= appears after the title, but I can't provide unnamed parameters after named ones, that is messy. Also I agree with Victar. A shame I missed my chance to oppose, nguè nguè. I'll try not to be borderline barratrous I suppose. Catonif (talk) 16:35, 18 June 2024 (UTC)Reply

@JeffDoozan What is your definition of "not breaking anything"? The |lang= parameter in {{cite-book}} is supposed to indicate the language that the source is written in, which is very often NOT the same as the language of the entry it's used on (e.g. an English entry citing a book in German for its etymology), whereas in {{quote-book}} those are supposed to be the same by default due to the nature of how this template is used (e.g. an English quote should come from a book written in English). Since you merged the functionality of |passage= with that of {{quote-book}}'s |text= (or at least I think that's what triggered it), now any entry in language X that cites a book written in language Y and uses |passage= will add that entry to [[Category:Y:getFullName() terms with quotations]] (demonstrations here and here). Some categories, such as Category:Russian terms with quotations and Category:Slovene terms with quotations, almost hilariously, are now entirely filled with entries for other languages. Some more easily visible examples show up here and here; plenty of other Latin-script entries are hiding among the actual respective English and German words throughout the bodies of these lists, making it effectively impossible to navigate them on a language basis. I hope you can appreciate the need to fix this ASAP—and I don't mean by running a bot to add nocat=1 to every page even |nocat= doesn't work. :) — 2600:4808:9C31:F400:29E8:5BF2:7E89:3679 03:38, 26 June 2024 (UTC)Reply

Missing comma, and date format

[edit]

@JeffDoozan: the comma between the author's name and the chapter or entry seems to have disappeared: see {{R:Bartlett Americanisms}}. Also, if |date= is used, the date is displayed in the format "2024 May 1". This is appropriate for quotations, but not so much for references—I think the date should remain in the format "1 May 2024", and if a month and year are specified they should be displayed as "May 2024" rather than "2024 May". — Sgconlaw (talk) 12:45, 2 May 2024 (UTC)Reply

@Sgconlaw, it looks like the old format has no comma between author and title and included a comma between author and chapter/entry. Should we match the old style or always have a comma between author and chapter/title?
  • author (year) title (old)
  • author (year) title (new)
  • author (year), “chapter”, in title (old)
  • author (year) “chapter”, in title (new)
JeffDoozan (talk) 21:15, 2 May 2024 (UTC)Reply
@JeffDoozan: oh, I see what happened at {{R:Bartlett Americanisms}}. The reference template was edited so that it does not have a default year of publication. Thus, there was no year between the author and the title, and the lack of a comma made the reference look odd. I think it would be best if I make the 1st edition of the work the default, so there will always be some year specified. That should solve the issue for that template at least. As to your question about whether a comma should be added, let me think about that a bit more. — Sgconlaw (talk) 22:48, 2 May 2024 (UTC)Reply

Pseudo-Roman numerals in entry names

[edit]

@JeffDoozan I'm not sure you saw this comment when I inserted it into an old thread, so I'm repeating it in a new thread: The merger of the functionalities of {{cite-book}} with those of {{quote-book}} has the consequence that |entry= is interpreted as identical to |chapter=, and that letters that happen to occur in Roman numerals are interpreted as Roman numerals. For example, at mil#Irish, {{R:DIL}} and {{R:ga:Ó Dónaill}} are both displaying "chapter MIL" instead of displaying a dictionary entry called mil. 07:56, 8 May 2024 (UTC) —Mahāgaja · talk 07:56, 8 May 2024 (UTC)Reply

Seems that "Module:quote" should (1) check for valid Roman numerals (perhaps using {{R2A}} or its underlying module) since "MIL" is not such a numeral; and (2) perhaps allow users to add ! in front of a parameter (e.g., |chapter=!MIL) to tell the template not to process the value but display it as-is, which has been implemented for |volume=. — Sgconlaw (talk) 09:25, 8 May 2024 (UTC)Reply
@Mahagaja:, @Sgconlaw: I added the suggested ! prefix handling for chapters/sections and then configured cite-book to always add a ! prefix to |entry=. A double !! will produce ! so this fixes mil and dill without clobbering (theoretical, not used in practice) entries on !Kung. I'll also check if there are any existing |chapter= values that start with ! and adjust them as needed. JeffDoozan (talk) 13:42, 8 May 2024 (UTC)Reply
@JeffDoozan: thanks! Mmmm, I wonder if ! should be turned on by default for |entry=? Might there be any situations where that parameter should contain a Roman numeral? (Can't think of any offhand …) — Sgconlaw (talk) 13:53, 8 May 2024 (UTC)Reply
Theoretically in our own entries for roman numerals, e.g. IV#Translingual. I doubt that we ever cite other dictionaries in such entries in practice, but in principle we could. But even then, if we've specified |entry=IV, we probably do want it to say “IV” in Suchandsuch Dictionary, not Chapter IV. —Mahāgaja · talk 14:10, 8 May 2024 (UTC)Reply
@JeffDoozan: I notice that {{R:OneLook}} is still producing "chapter DILL" at dill, I guess because that template uses {{cite-web}} rather than {{cite-book}}. —Mahāgaja · talk 14:03, 8 May 2024 (UTC)Reply
I do think it would make sense to implement checking for valid Roman numerals, which would immediately eliminate the templates treating "DILL" and the like as numerals. Then the ! prefix could be used specifically for indicating that a valid Roman numeral should not be treated as such. — Sgconlaw (talk) 15:44, 8 May 2024 (UTC)Reply
I wonder if the best solution wouldn't be to separate |entry= and |chapter= into separate parameters again, considering Jeff just had to undo the fix he applied earlier today on the grounds that it breaks how |chapter= works. —Mahāgaja · talk 21:35, 8 May 2024 (UTC)Reply
I think this is the best solution since it would cleanly separate the two and even allow them to be used together as requested here. I'm short on time this month but I'll implement it when I get a chance. JeffDoozan (talk) 15:39, 9 May 2024 (UTC)Reply
We would still need some way to suppress the value of |chapter= from being treated as an Arabic or Roman numeral (for example, by using the prefix !). I have come across books where the chapter names are years, so they should display as "1984" rather than "chapter 1984". — Sgconlaw (talk) 16:15, 9 May 2024 (UTC)Reply
@Mahagaja:, @Sgconlaw: I've added support to the cite- templates to handle |entry= separately from |chapter=. Values in |entry= are displayed exactly as provided without any special handling for roman numerals. Values in |chapter= handle roman numerals unless prefixed with !. JeffDoozan (talk) 15:43, 1 July 2024 (UTC)Reply

RFC discussion: March 2022

[edit]

The following discussion has been moved from Wiktionary:Requests for cleanup (permalink).

This discussion is no longer live and is left here as an archive. Please do not modify this conversation, but feel free to discuss its conclusions.


It produces:

"Cappelli, Adriano (1982)David Heimann; Richard Kay, transl., [...]"

--Astova (talk) 09:38, 23 March 2022 (UTC)Reply

Yeah, the |translators= parameter has that problem. I brought this up with @Sgconlaw 3 years ago at Template talk:cite-book#Translator parameter but nothing's changed since then. —Mahāgaja · talk 10:03, 23 March 2022 (UTC)Reply
Sorry, the spacing is really hard to work out and I haven't had time to look into it. — SGconlaw (talk) 12:56, 23 March 2022 (UTC)Reply