text-case="capitalize-first" does not work for name-part

I have this macro:
---------
<macro name="author">
<names variable="author">
<name name-as-sort-order="all" and="text" sort-separator=", " initialize-with="." delimiter=", " delimiter-precedes-last="always">
<name-part name="family" text-case="capitalize-first"/>
</name>
<label prefix=" (" suffix=")" text-case="capitalize-first" font-style="italic"/>

<substitute>
<names variable="editor"/>
<names variable="translator"/>
<text variable="title"/>
</substitute>
</names>
</macro>
----------

In Zotero Library I have item with 2 authors (for testing purposes):
1. WatERer, Jean Gustav
2. EVanS, L.E.

Output from macro looks like "WatERer, J.G., and EVanS, L.E." instead of "Waterer, J.G., and Evans, L.E."

What is wrong? If I change "capitalize-first" to "lowercase" or "uppercase" then it works OK and names are lowercased or uppercased. - I try it on Standalone version of Zotero 4.0.29.10 and MS Word plugin
  • Tested here and got the same result. Then I checked the code, which is written to touch only the first character in the field, leaving the rest unchanged (so it's doing what you would expect from the code). Then I checked the CSL Specification:
    • “capitalize-first”: capitalizes the first character of the first word, if the word is lowercase
    So it's following the spec "to the letter," so to speak.

    Is there a reason why names would need to be written in mixed-case in Zotero, but forced to have only the first letter of the first word capitalized in citations?
  • @fbennett: no, there is no reason for mixed-case, but this item was imported into Zotero from http://www.nrcresearchpress.com/doi/abs/10.4141/cjps85-109 and there were surnames capitalised (WATERER, EVANS) after import. And it is the problem too. I changed some of the letters to small only for testing purposes. So it seems as a "problem" of the translator - we need "Transform text" function not only for titles but for names too (maybe in Zotero, maybe in translator).
  • we typically do this in the import translator, which I think is the best place for data that's just incorrect. We want citation styles to assume correct data, I think.
  • If I correctly understand of NRC Research Press.js code then there is redirection to RIS.js translator.
  • fixed the translator (just for last names. First names are trickier and I didn't see any examples. )
  • @adamsmith: in Firefox with Zotero add-on it works correctly. It still dos not work correctly in Google Chrome and Zotero Standalone - I get WATERER and EVANS. Translators were reset and in the second step even completely deleted.
  • I never know quite the order of things to get this to work in Chrome, I think it might be restart Standalone, then restart Chrome. But pretty sure this would work on all browsers.
  • I do not know where is the problem, I restarted my computer, delete all translators and still not works. In testing page (mentioned earlier) I see this translators in Chrome:
    NRC - imported surnames are capitalized
    Atypon - import is OK
    DOI - imported surnames are OK, title is capitalised
    Embedded metadata translator - title and surenames are capitalised, missing a lot of values, incorrect date
Sign In or Register to comment.