APA 6 style error: Faulty capitalisation of German journal titles

When using APA style, I get:
Pietsch, M. (2010). Evaluation von Unterrichtsstandards. Zeitschrift Für Erziehungswissenschaft, 13(1), 121–148. http://doi.org/10.1007/s11618-010-0113-z

Pietsch, M., Janke, N., & Mohr, I. (2014). Führt Schulinspektion zu besseren Schülerleistungen? Difference-in-Differences-Studien zu Effekten der Schulinspektion Hamburg auf Lernzuwächse und Leistungstrends. Zeitschrift Für Pädagogik, 60(3), 446–470.
The correct output should be:
Pietsch, M. (2010). Evaluation von Unterrichtsstandards. Zeitschrift für Erziehungswissenschaft, 13(1), 121–148. http://doi.org/10.1007/s11618-010-0113-z

Pietsch, M., Janke, N., & Mohr, I. (2014). Führt Schulinspektion zu besseren Schülerleistungen? Difference-in-Differences-Studien zu Effekten der Schulinspektion Hamburg auf Lernzuwächse und Leistungstrends. Zeitschrift für Pädagogik, 60(3), 446–470.
I would be grateful if this could be corrected. Thank you!
  • put de-DE in the language field
    https://www.zotero.org/support/kb/preventing_title_casing_for_non-english_titles
  • First, I can confirm that this works. Thank you for this!

    I have so many German references that it would be quite cumbersome to manually edit all to "de-DE" – even if only all that I actively use.

    Are there any other ways to tackle this issue? After all, the "of" of English journal titles are not capitalised. How is that achieved? I could imagine the same could be done for the German equivalent "für".

    Just out of interest: Is there any (significant) difference between "de" and "de-DE"?
  • anything that doesn't start with "en" works to disable the functionality.
    The only alternative would be a custom version of the style (didn't check, but I think we don't have this in the DGfP style, so that might be an option, too).
    There is a specific set of words that are not capitalized for English hardcoded into Zotero's citation processor as per the CSL specifications. The reason that's only the case for English is that no other language has the concept of "title casing" -- e.g. in German you have "Blätter für deutsche und internationale Politik". There's no way to automate that.
  • The only alternative would be a custom version of the style (didn't check, but I think we don't have this in the DGfP style, so that might be an option, too).
    I don't dare to use DGfP as a substitute. I'm sure that there other associated changes that are bound to create other problems later on.

    What would have to be changed to achieve a custom version of APA 6 that does not automatically capitalises journal articles?

    "Hardcoded" did sound as if there is not much room for adaptation. Hard-coding "für" and "und" into CSL would go a long way and minimise the number of required manual adaptations substantially.
  • Hard-coding "für" and "und" into CSL would go a long way and minimise the number of required manual adaptations substantially.
    yeah, but it's a Fass ohne Boden: even in German, things like "der, die, das, ein, eine, einer, eines, mit" come to mind immediately. But that would of course be required for every supported language, and we're not going to go that way (especially since, as I note above, it wouldn't actually be a solution for German. It would just happen to work in about 90% of cases for journal articles).

    For customizing APA, find
    <if type="article article-journal article-magazine article-newspaper" match="any">
    <text variable="container-title" font-style="italic" text-case="title"/>
    </if>

    and delete text-case="title"
  • If you feel comfortable, you could use the Zotero JavaScript API to automate entering "de" into the language fields.
    https://www.zotero.org/support/dev/client_coding/javascript_api

    At the bottom of the page is code for batch editing. You can pretty easily modify it to look for the word "für" or some other common German word, then set the language field to "de".
  • edited March 24, 2015
    Thanks!

    When importing the customised style, I'm prompted:
    Update existing style "American Psychological Association 6th edition" with "American Psychological Association 6th edition CUSTOM" from apa_2015-03-24_modified.csl?
    What do I have to do to create a new style instead?

    @bwiernik

    I'm not used to programming but if I should run into problems with the modified style then I will give it a go (perhaps with a little help from you guys). :)
  • Thank you, adamsmith!

    I appreciate your excellent support!
  • Here is the code you will need to batch edit the items:
    https://gist.github.com/bwiernik/06b3cdd93b7602813aac

    In Zotero for Firefox (won't work in Standalone), install Execute JS (https://addons.mozilla.org/en-us/firefox/addon/execute-js/). Then open the Execute JS window (type Alt, then click 'Tools' -> 'Open Execute JS' in the Firefox menu bar).

    Copy the code from the first link and execute it. You can change the word "für" at the top of the code to other common words that are obviously German to make more automatic adjustments.

    The advantage of adjusting your item metadata is that it will let you change your style (for example, to the style to a specific journal) without messing up your capitalization.
  • @bwiernik

    Thank you for helping me out.

    I have tried it and think the code still needs a bit of tweaking. When running it with "für" I had 97 replacements. Quite a success. So I continued with "und" and here it becomes a bit more problematic. I think the code did look for "*und*" everywhere - certainly beyond the publication field. As a result, I had about 880 replacements. Among those were English language entries with "understanding", "foundation", "under", "bounded" etc. in the title.

    Is there a way to reverse it? For example:

    var fieldName = "title";
    var fieldName2 = "language";
    var oldValue = "und";
    var newValue = "";
    ?
  • the script as it is now looks in the title field, not in the publication title field.

    what you have should reverse it (though, obviously, not exactly reverse: it'll just empty the language field for all of those).

    you should be able to limit this to the actual word by using " und " -- I'm pretty sure the search is sensitive to spaces, though you can try this out in the regular advanced search first. That uses the exact same underlying code.
  • (edit: and whenever you work with the javascript API, you should have a backup of your zotero.sqlite from right before so you can easily and painlessly revert anything).
  • So, if I want to limit the search to the publication title field instead of title field, is the following line of code the correct entry:

    var fieldName = "publicationTitle";?

    I've backed up the whole zotero folder before the batch editing. However, I did not do additional backups between each run.
  • yes that should work.
    I'd revert to your back-up and then re-run the stuff that worked again. Seems better than trying to fix things with another set of search&replace.
  • I'm trying to "reverse" it but it seems that Firefox or Execute JS have hang up. It certainly takes much longer than the first two batch edits.

    How long should I wait before I "kill" Firefox? Is there another way to bring it back to life?
  • see above-- just kill it and go back to your back-up.
  • Done.

    Do I need to restore only zotero.sqlite or also the storage folder as described here:

    https://www.zotero.org/support/zotero_data
  • just the sqlite, nothing about your attachments changed.
  • Okay, I have now updated 185 items with the following code:

    var fieldName = "publicationTitle";
    var fieldName2 = "language";
    var oldValue = "für";
    var newValue = "de-DE";

    var fieldID = Zotero.ItemFields.getID(fieldName);
    var fieldID2 = Zotero.ItemFields.getID(fieldName2);
    var s = new Zotero.Search;
    s.addCondition(fieldName, 'contains', oldValue);
    s.addCondition("itemType", 'isNot', "attachment");
    var ids = s.search();
    if (ids) {
    for each(var id in ids) {
    var item = Zotero.Items.get(id);
    var mappedFieldID = Zotero.ItemFields.getFieldIDFromTypeAndBase(item.itemTypeID, fieldName2);
    item.setField(mappedFieldID ? mappedFieldID : fieldID2, newValue);
    item.save();
    }
    alert(ids.length + " items updated");
    }
    else {
    alert("No items found");
    }


    I dare not do anything else for the moment.

    A big THANK YOU to bwiernik and adamsmith!
  • In general I would suggest a two-step approach:
    1) Make a collection of all items you want to batch edit (this could also be a saved search) and check that these are the ones you want to chang
    2) Batch edit all items of this collection
  • Zuphilip, Thank you for sharing this great idea. My lack of JavaScript knowledge prevents me from implementing this.

    Is there somewhere a collection of tried and tested Zotero JavaScripts that I could use as a starting point? It was easy for me to make small modifications on the basis of bwiernik's code but I think I would not have come up with it on my own.
  • There is the (mostly user-contributed) documentation of the JavaScript API. Actually, I am thinking about writing a zotero plugin which would implement the second step of my two-step approach in the GUI. However, it is hard to find the time for that currently.
  • I tried to hack up my two-step approach from above. Here is my JS code which can be executed in the web console: https://gist.github.com/zuphilip/b942c8bf2f1126982517 . Any testing reports or other thoughts would be nice. I would suggest to test it on collections with test items, which can be overwritten.
  • Thank you, zuphilip!

    If I understand it correctly, whatever is in the folder selected in zotero is subjected to modifications as specified in the code. So there is no need to point to a specific collection within the code itself, right?

    If an item is within a specific collection, it will be changed across all collections that it is part of. Please correct me if I'm wrong.

    I'll report back when I get the chance to test the code.
  • Yes, all items in the currently selected collection are modified (if possible). If you run the code, a confirmation dialog is showed first and tells you again the name of the collection and the number of items in it. It is then still possible to abort the process.

    It should be enough for you to select one of the examples (by commenting/uncommenting lines e.g. with //) and maybe change the field and values.

    In Zotero, there is only one item (not several copies) which can be in several collection. Thus, any change to this item will show up everywhere the same. So, you are right about that.
Sign In or Register to comment.