Adding "language" when not English

As some of my sources are not in English, I need references that are not in English to denote it in the end of every item in the bibliography. I started changing the CSL macro, but I need some help.


In the first stage, I successfully managed to add the value from the field “language”, using the following:
---
<macro name="language">
<if variable="language" match="any">
<text variable="language" prefix=" (" suffix=")" text-case="capitalize-first"/>
</if>
</macro>
---


What I’d like to do now, is to complicated this, and to make it add the value in “language” only if the value is not “English”.

I thought that it should be something like:
---
<macro name="language">
<if variable="language" value="English">
</if>
<else>
<text variable="language" prefix=" (" suffix=")" text-case="capitalize-first"/>
</else>
</macro>
---

But this doesn't work. I guess you need something other than “value=”English”” - right?
  • edited November 13, 2012
    It is not possible to test for field content in CSL. You can accomplish this with the Abbreviation Filter, though. There is some documentation on use of the plugin here.

    You can ignore the stuff on installing external abbreviation lists. Essentially all you need to do is: (1) set the proper language tag value in the Language field ("en" for English, "fr" for French, etc.); (2) render the "language" field in your style with form="short"; and (3) through the Classic word processor dialog and the "abbrevs." popup, select the "Places" list and enter the appropriate values for each language tag, setting "en" to "{suppress}".

    The transformed entries will only appear in the word processor; you will get the literal content when generating bibliographies in Zotero itself.
Sign In or Register to comment.