APA 6 style error: Faulty capitalisation of German journal titles
When using APA style, I get:
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!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.
https://www.zotero.org/support/kb/preventing_title_casing_for_non-english_titles
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"?
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.
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.
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"
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".
When importing the customised style, I'm prompted: 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). :)
https://www.zotero.org/support/dev/citation_styles/style_editing_step-by-step#change_the_style_title_and_id
I appreciate your excellent support!
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.
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 = "";
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.
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.
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.
How long should I wait before I "kill" Firefox? Is there another way to bring it back to life?
Do I need to restore only zotero.sqlite or also the storage folder as described here:
https://www.zotero.org/support/zotero_data
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!
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
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.
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.
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.