Template talk:Cite book/German

CS1
I recently updated Internetquelle to be compliant with. Is there any objection to updating this template? ---— Gadget850 (Ed)  talk 00:21, 31 May 2012 (UTC)
 * I don't have a problem as long as it doesn't affect the input parameters. I assume you're only changing the way it displays which is fine. Bermicourt (talk) 05:30, 31 May 2012 (UTC)


 * Exactly. Examples of current and sandbox versions:

---— Gadget850 (Ed)  talk 09:25, 31 May 2012 (UTC)
 * I quite forgot about this. Any comments? --— Gadget850 (Ed) talk 16:31, 3 January 2013 (UTC)


 * I assume the 2nd version in each case is how the display will look once you implement the changes. Looks good to me - crack on! --Bermicourt (talk) 19:00, 3 January 2013 (UTC)
 * ✅ Let me know here it you see any issues. --— Gadget850 (Ed) talk 19:26, 3 January 2013 (UTC)

Category
Need to put this in a category. Category:Citation Style 1 templates using German translations sound OK? --— Gadget850 (Ed) talk 19:30, 3 January 2013 (UTC)


 * Unless there are several other German-style citation templates, this may be a bit too specific. I'd just park it in an existing citation category. But I don't feel strongly about this. --Bermicourt (talk) 20:05, 3 January 2013 (UTC)
 * Just Internetquelle. --— Gadget850 (Ed) talk 20:11, 3 January 2013 (UTC)

Question about recent edit
I see there are several articles that have popped up in Category:Pages with URL errors that contain this template, such as André-Marie Ampère. The articles haven't changed recently, and Google Buch hasn't changed recently, so I'm guessing it has to do with the recent IP edit to this template. Thought it was worth discussing before reverting the edit. Thanks! GoingBatty (talk) 02:54, 18 February 2015 (UTC)


 * I've reverted the edit as it is screwing dozens of articles up. I'm sure the change was made in good faith, but it needed properly testing first. I'll leave a note on the unnamed editor's talk page. --Bermicourt (talk) 12:39, 21 February 2015 (UTC)

Parameters added to documentation but not in template
, you have added a bunch of parameters to the documentation that are not in the template code. Are you planning to add them to the template? In my experience, it is less confusing to editors if we modify the template first and then update the documentation.

Also, you have added parameters like Umfang (i.e. total pages) that do not have an equivalent in the English-language citation template. What is your intention with that parameter and parameters like it? – Jonesey95 (talk) 00:12, 18 January 2017 (UTC)
 * I am working to add the extra parameters, but I like your plan to add parameters to the template first, then update the /doc text afterward, but my German-language skill is rusty at this point and Google Translate continually mistranslates words, such as Finnish "kappale" (should show "chapter" not "number"). As for no-equivalence parameters, I plan to list them after the template (such as "KBytes: 1200"), where no data would be lost if someone quickly wp:subst'ed the template without the tedious effort to ensure all parameters were mapped into the generated {citation/core} footnotes. Also, I plan to redo the underlying implementation as a {cite_book} rather than {citation/core}. -Wikid77 (talk) 01:02, 18 January 2017 (UTC)
 * I do not think converting it to use cite book makes sense, since this template appears to be an all-purpose citation template for periodicals, magazines, journal articles, and more. Using Citation would probably be an upgrade, however, since the automatically substed templates would have access to the error-checking of the CS1 templates. – Jonesey95 (talk) 01:36, 18 January 2017 (UTC)

Suppression of "in German"
I just copied a couple references from a German article and pasted them into the English article, and it worked except that it said "(in German)" when in fact they were both in English. So I added "Originalsprache=en", which got rid of that, but put "(in English)" instead. Could we make it so that it doesn't say "(in German)" unless one says "Originalsprache=de", or else add a parameter which will suppress it? Eric Kvaalen (talk) 15:21, 19 August 2018 (UTC)
 * This template is automatically substituted by a bot. It looks like the code changes Originalsprache to language and preserves the value. If there is no Originalsprache provided, it assumes that the language is German. Wait for the bot to visit Lake Palcacocha, and you should see that "English" is the language listed in your cited source. (One note: on the English Wikipedia, when English, there is no language shown in the citation when it is displayed in the rendered article.) – Jonesey95 (talk) 15:49, 19 August 2018 (UTC)
 * So it's not an error with this template, but an error by the original editor at German Wiki who didn't fill in Originalsprache = en. Bermicourt (talk) 17:19, 19 August 2018 (UTC)

substing
Don't do it. This template uses which, for a long time was the engine that rendered  and the cs1 templates. Now that and the cs1 templates are all rendered by Module:Citation/CS1,  is no longer maintained and its renderings are stylistically different from the cs1|2 templates. There are approximately 1100 articles that directly use. Many of those uses, I suspect, result from auto-substing by User:AnomieBOT/docs/TemplateSubster.

should be rewritten to use one or more of the cs1|2 templates.

—Trappist the monk (talk) 15:18, 16 December 2018 (UTC)
 * That's fine as long as it is able to convert the Literatur template imported from German which is its main purpose and advantage. No-one wants to waste time rewriting templates from one language to another every time when a computer can do it for us. Bermicourt (talk) 20:29, 16 December 2018 (UTC)

Auto substing restored now that the template has been converted to use.

—Trappist the monk (talk) 16:47, 25 December 2018 (UTC)

conversion to template:citation
I have cloned the live template into its sandbox and replaced and its parameters with  and its equivalent parameters. These examples are copied from the template's documentation page (top is the live template, bottom is the sandbox template):

Here are substed versions of the templates from the last example: Because all I did was rename the underlying template and parameters, once made live, the -based version should be able to go back to being substed.

—Trappist the monk (talk) 16:26, 19 December 2018 (UTC)
 * Trappist the monk, we could fix the date errors using the method used in Template:Cita libro, or we could just assume that gnomes will fix them later. Frietjes (talk) 19:23, 19 December 2018 (UTC)
 * Aye, we could, but wouldn't it be better to write a lua month-name translator that could be applied to, , and the other translating templates? I'm inclined to think so because we wouldn't need to repeat chains of nested   for each date parameter.  I'll play around with the translator idea.
 * —Trappist the monk (talk) 20:07, 19 December 2018 (UTC)
 * Trappist the monk, you might find the end of 'User:Frietjes/citetrans.js' useful. I believe I have Spanish, French, Portuguese, and Turkish in there. it would be useful if I could just push the date through a date translator module instead. by the way, Template:MultiReplace would be a simple replacement in cita libro to avoid the nested module calls. Frietjes (talk) 21:10, 19 December 2018 (UTC)
 * Great work. This has been a long time coming. Did you (Trappist) figure out good replacements for all of the parameters?
 * A brute force post-substitution fix for the dates would be to have run its Task 25 script on them. It is not elegant, but works quite well. – Jonesey95 (talk) 02:22, 20 December 2018 (UTC)
 * In most cases, the parameter names in the live template differ from the sandbox template only in case (camel-case to lowercase) and hyphenation. Some – IncludedWorkTitle, YearNote, etc – got whole new names (contribution, orig-year). I didn't set out to reinvent this template – if I had, there would not be two (slightly different) instances of, just the subst-able one.
 * —Trappist the monk (talk) 11:40, 20 December 2018 (UTC)
 * Hacked a month name translator that should work for Catalan, German, Polish, Portuguese, and Spanish. Month names for these languages are fetched from MediaWiki into a translation table.  I need to move that table generation into a ~/data module so that the fetch is done only once per article.  Also need to add support for an override table for when MediaWiki will be wrong.  Adding support for other languages is, or should be, as simple as adding an ISO 639 language code to a table.
 * I have resubsted the subst examples above. There should only be the date-error-in-year error (2003-08-14 is not a year).  This translator does nothing about the date maintenance messages; it shouldn't, that's a different issue requiring a different solution.
 * —Trappist the monk (talk) 11:40, 20 December 2018 (UTC)
 * I have resubsted the subst examples above. There should only be the date-error-in-year error (2003-08-14 is not a year).  This translator does nothing about the date maintenance messages; it shouldn't, that's a different issue requiring a different solution.
 * —Trappist the monk (talk) 11:40, 20 December 2018 (UTC)

safesubst; why?
This template includes two instances of. One of these (lines 2–44) is intended to be substed. The other (lines 52–107) is the unsubsted version. The distinction is made with the template. If is being substed, then the first  template is substed and rendered else the second  template is rendered. With, Editor Plastikspork added  to several places in the second, unsubsted.

Why? Is it necessary to safesubst statements in code that will not be executed during a subst operation?

—Trappist the monk (talk) 14:10, 26 December 2018 (UTC)
 * Trappist the monk, feel free to remove it if you feel it's not needed. Plastikspork ―Œ (talk) 14:10, 26 December 2018 (UTC)
 * Thanks, but that doesn't answer my questions. You must have had a reason for making that edit and I presume that you know more about substing than I do (I know practically nothing about it).  So, answers please?
 * —Trappist the monk (talk) 14:14, 26 December 2018 (UTC)
 * The reason for adding safesubst for templates which are substituted is to make sure that the parserfunctions or other junk is substituted when the template is substituted. Adding it doesn't usually hurt anything, but helps when the template is substituted.  I, personally, prefer translating these using a script like User:Frietjes/citetrans.js, rather than substituting them to avoid leaving a bunch of blank parameters behind.  It also makes the diffs easier to read because the script doesn't change the parameter order. Plastikspork ―Œ (talk)  14:22, 26 December 2018 (UTC)
 * Right, but in this case you added  to the  that is never substed and while I agree that doing so doesn't hurt, it doesn't help either so for that reason I am going to revert.  Alas, your preference is not every editors preference; I know this because I translated  →  substs in more than a thousand articles.  Editors will continue to add  templates to en.wiki articles substed or no so we must continue to support that workflow.
 * —Trappist the monk (talk) 14:53, 26 December 2018 (UTC)
 * The auto substitution was added in 2016. It is a bot that is substituting it, not editors. Plastikspork ―Œ (talk)  14:58, 26 December 2018 (UTC)
 * Yeah, but the instructions for this template specifically state that this template should always be substed. Editors being the lazy creatures that they are, will let the bot do the 'hard' work.  This is no different from editors omitting the date from templates like, , etc. because they know that a bot will cleanup after.
 * —Trappist the monk (talk) 15:03, 26 December 2018 (UTC)

Problem with Comment
Comment is translated from Kommentar but otherwise isn't used. Perhaps it could be rigged to convert to postscript or something like that?-- Auric   talk  16:53, 1 February 2021 (UTC)
 * That would be an invalid use of postscript. There is no corresponding comment in the English Wikipedia; consensus is that comments should go after the template. If there is a way for this template to render Kommentar after the closing braces of the resulting English-language template, we should do that. – Jonesey95 (talk) 17:43, 1 February 2021 (UTC)

lua module experiment
This template is ugly. Just look at the code; there are two different copies of the code: one for substitution (because this template is always to be substituted), and one that is not (for when editors forget to subst this template I guess). And, not only are there two copies, the output of the two is not always the same given the same parameters ...

So, to combat that ugliness, I have hacked a lua module currently in my sandbox. The module translates the parameters that can be translated, assembles groups of parameter values into a single value when that is appropriate, and then calls to render the result. I think that I have gotten the essentials; compare the live version and the sandbox version of this:
 * same but the sandbox:
 * same but the sandbox:
 * same but the sandbox:

The module handles some parameters differently: I have added a new parameter expand which, when set to any value, shows a nowiki'd version of the translation. It was useful for development and may (or may not) be useful for editors:
 * TitelErg – the live subst'd template creates &lt;Titel>: &lt;TitelErg>; the live un-subst'd template creates &lt;Titel> ( &lt;TitelErg>); un-subst'd also creates &lt;TitelErg>. The module creates &lt;TitelErg> only.
 * Seiten – the module does not attempt to decode the assigned value in order to choose between page and pages. Instead, it leaves that to Module:Citation/CS1.
 * Umfang – total number of pages not supported by cs1|2 so if and when it occurs in, it will be passed on to Module:Citation/CS1 for error handling.
 * ID, URN, DNB, ZDB – the live template rendering of these is different in the subst'd and un-subst'd forms I've created a simple comma-separated list of the identifiers, with linked labels (except for URN – don't know what that actually is), and their values to be placed in id.
 * ISBNistFormalFalsch – not supported by this template but implemented in the module because it was easy; wraps the associated ISBN value in accept-this-as-written markup
 * Kommentar – supported only by the subst'd form which creates Comment which is not supported by cs1|2 so if and when it occurs in, it will be passed on to Module:Citation/CS1 for error handling.
 * Format – both forms of this template add static text: 'Format: '; the sandbox version does not nor does the sandbox support:
 * KBytes – size of an online source – no equivalent in cs1|2; excluded because size of a source in bytes is not the format of the source
 * ArtikelNr – a document number – no equivalent in cs1|2; excluded because a document's assigned number is not the format of the source

and here is what that citation looks like when rendered:

Comments? Suggestions?

—Trappist the monk (talk) 19:29, 19 August 2021 (UTC)
 * If the bot can still subst it without error, I trust your work. Thanks. – Jonesey95 (talk) 21:14, 19 August 2021 (UTC)


 * Yep, that's a good idea. This will make it easier to translate citations and also to maintain the template. Not sure if the current version is actually updated to reflect all the features of the German live template (it's not by comparing the documentation), but this can by retrofitted later.
 * Conceptually I think the template should support all parameter variants of a parameter ever supported by the German original template, so that it works well even when someone pulls a citation from an archived page or a history diff. At some point, I might check the history of the German template and add some old parameters as aliases.
 * TitelErg (Titelergänzung, title extension) is not exactly the same as type, but good enough for the translation. It sometimes holds parts of an extended subtitle, but can also be used to hold stuff like "with a foreword by xyz", "comes with a CD-ROM" or similar. Putting that into type is fine because this typically appears after the title and is not added to the metadata, so it does not cause harm and can be cleaned up and the information possibly manually moved to more appropriate parameters later on.
 * KBytes. This is somewhat analog to Umfang. While I see quite a utility value for something like total-pages in our citation templates, I don't think we need something like media-size. However, some editors might have put other useful information into that parameter, so, like Umfang, I would simply pass it through for error handling by citation.
 * ArtikelNr (article number). Well, this is something that I plan to add to our templates for a long while already, because some publishers number their articles this way and there even is a COinS key for this, so it would work similar to our other identifiers (including metadata creation), but without an external link to some page resolving that number. To expand the utility value I was playing with the idea to choose a name generic enough to be used also for other similar purposes like vendor catalog numbers, which, in absence of better identifiers like ISBNs, would be quite useful to end up in COinS metadata as well (at present, we can add them to id, but this doesn't show up in metadata, so cannot be used for indexing/searches). The definition of  appears to be broad enough to allow such a dual use without violating the primary purpose: Module_talk:Citation/CS1/COinS. Anyway, for as long as this is not implemented, I think, it is best to just add this info to id like "Article number xyz".
 * URN is for Uniform Resource Names (see also URN), a concept we might add to our set of identifiers as well. The German Wikipedia resolves something like nbn:de:gbv:547-201000039 to urn:nbn:de:gbv:547-201000039, but for unknown namespaces, we could just display the string urn:nbn:de:gbv:547-201000039 for now. MW treats this like an external link and it could be resolved by a browser plugin. While we can do the latter even without adding support for it to CS1/CS2, adding it would allow us to also provide this as part of our COinS metadata which might be quite useful to connect citations with sources in both directions.
 * DNB. This could be translated to DNB-IDN using id.
 * ZDB. This could be translated to ZDB using id.
 * Keep up the good work.
 * --Matthiaspaul (talk) 12:37, 20 August 2021 (UTC)
 * KBytes and ArtikelNr are passed along to cs1|2 for error handling – nothing in the original template is discarded; if it can't be translated, it is passed on as is. Adding   to id is doable.
 * I don't think that we should attempt to use and  for the values assigned to DNB and ZDB because we don't know just what those values might be.  If de.wiki somehow massages those values then we can mimic that but otherwise I think that we should simply report the value and leave it to editors to add  and  as they see fit.
 * —Trappist the monk (talk) 14:11, 20 August 2021 (UTC)
 * I don't understand what you mean by "we don't know just what those values might be"? Certainly we do know what they are as they are among the largest repositories of their kind. (DNB-)IDNs are catalog numbers of title database entries (Identifikationsnummer eines Titeldatensatzes ) at the German National Library (Deutsche Nationalbibliothek, DNB), and ZDB IDs link into the German Union Catalogue of Serials (Zeitschriftendatenbank, ZDB ). These are essential to identify, locate and obtain many older publications from 1500 up to the present, but in particular for publications prior to the introduction of ISBNs and ISSNs.
 * Instead of translating them as " " and " " you could just translate them as " " and " " for usage in id. This would ensure that they get properly linked and that the core link can be centrally updated would this become necessary in the future.
 * Of course, we could also add direct support for them into CS1/CS2 as dnb and zdb. This would allow to include them as part of the COinS metadata, which would certainly be a valuable addition.
 * --Matthiaspaul (talk) 15:58, 20 August 2021 (UTC)
 * What I meant is that we can't know if, in the original template, an editor wrote &lt;plain-text> or wrote &lt;>.  The latter is possible because de:Vorlage:DNB and de:Vorlage:ZDB exist.  Because  is to be subst'd and because substitution occurs before transclusion in the WikiMedia rendering process, we would have to inspect the value assigned to each of these identifier parameters and then make some decision about what to do.  I'd rather not bother and leave that to the editor so that they get the result they want.  A brief perusal of de:Modul:Zitation seems to suggest that, at de.wiki, DNB and ZDB are presumed to be plain-text.  If we can rely on that presumption then, yeah, we can feed those parameter values to  and.
 * —Trappist the monk (talk) 13:56, 21 August 2021 (UTC)
 * Yes, the identifier parameters such as DNB and ZDB at de:Vorlage:Literatur are all meant to take plain-text arguments - just as with our citation templates.
 * As our URN template at present only supports the nbn namespace directly, I think, that, for as long as we do not add direct support for URNs in CS1/CS2, it is best to retranslate them into their full URN form (which MW would detect and treat as external links optionally somehow to be resolved through browser plugins), so xyz would simply become  (as plain text) in the id parameter (instead of the current  ), alternatively:  . (If we would add support for them in CS1/CS1, we would need an urn and an optional urn-namespace-url parameter to specify the URL to a namespace resolver for a specific namespace treated locally by us (so the template could output  ), instead of externally through the plain-text-method.)
 * ArtikelNr is part of a parameter set to specify in-source-locations in the German citation template (they support more parameters than only for sheets and pages, i.e. for columns, rows, etc.). I think, in our present template logic, we should better treat them similar to identifiers, translating n into  for id (n might contain a link (like our pages), "Article No." would be simple text for now). Otherwise they might end up in sheets or number, where they don't belong IMO.
 * --Matthiaspaul (talk) 18:52, 21 August 2021 (UTC)
 * So I hacked my module to preprocess which works fine when not subst'd:
 * but, when subst'd, this is the resulting template call from the same example:
 * which works:
 * but is unacceptable so we will have to mimic because I don't want to go down the subst rabbit-hole.
 * —Trappist the monk (talk) 19:40, 21 August 2021 (UTC)
 * I'm sure I'm missing something. Why can't we just make the resulting template call look like:
 * --Matthiaspaul (talk) 19:54, 21 August 2021 (UTC)
 * Because transclusions are processed before the module is #invoked. This is why   exists.  Were the module to create , that thing that looks like a template would not be transcluded because modules only return text strings.  To get 'round that, in the hack that I described above, the module called   on  which returned the user-facing rendering of that template so the unsubst'd rendering looks correct.  But, substitution is done before transclusion so the result of the subst is   which is then transcluded and then the module is processed (which makes it look like everything worked).
 * New hack, mimicking :
 * and the subst'd wiki text:
 * It appears that renders without the colon after the identifier label (compare the above with your example).
 * —Trappist the monk (talk) 20:19, 21 August 2021 (UTC)
 * ZDB:
 * and the subst'd form:
 * —Trappist the monk (talk) 21:58, 21 August 2021 (UTC)
 * Thanks, Trappist, for the great explanation. I really missed that point. At this point it appears it would be easier and more straight-forward to simply add support for dnb and zdb parameters to CS1/CS2. This would ease maintenance by removing "clutter" from the id parameter, and improve (reverse-)lookup facilities through better metadata.
 * Yes, DNB-IDN and ZDB-ID (as well as de:Vorlage:Literatur) render them without the colon.
 * --Matthiaspaul (talk) 22:17, 21 August 2021 (UTC)
 * and the subst'd wiki text:
 * It appears that renders without the colon after the identifier label (compare the above with your example).
 * —Trappist the monk (talk) 20:19, 21 August 2021 (UTC)
 * ZDB:
 * and the subst'd form:
 * —Trappist the monk (talk) 21:58, 21 August 2021 (UTC)
 * Thanks, Trappist, for the great explanation. I really missed that point. At this point it appears it would be easier and more straight-forward to simply add support for dnb and zdb parameters to CS1/CS2. This would ease maintenance by removing "clutter" from the id parameter, and improve (reverse-)lookup facilities through better metadata.
 * Yes, DNB-IDN and ZDB-ID (as well as de:Vorlage:Literatur) render them without the colon.
 * --Matthiaspaul (talk) 22:17, 21 August 2021 (UTC)
 * —Trappist the monk (talk) 21:58, 21 August 2021 (UTC)
 * Thanks, Trappist, for the great explanation. I really missed that point. At this point it appears it would be easier and more straight-forward to simply add support for dnb and zdb parameters to CS1/CS2. This would ease maintenance by removing "clutter" from the id parameter, and improve (reverse-)lookup facilities through better metadata.
 * Yes, DNB-IDN and ZDB-ID (as well as de:Vorlage:Literatur) render them without the colon.
 * --Matthiaspaul (talk) 22:17, 21 August 2021 (UTC)