Is it possible to display different citation style based on bibliographic's language?

Hello,

I'm come from Taiwan.
In Taiwan, we usually separate bibliographic to Chinese and English.
We use APA style for English bibliographic, but use another style in Chinese bibliographic.

I want to create a APA style for both Chinese and English bibliographic.
I think it will very help to use language field in <if> tag, but I don't know how to use it.

Is it possible use language field in <if> tag?
  • It's not officially supported and the CSL style will be marked as invalid in Zotero (and we wouldn't accept it to the style repository), but it is possible to have different bibliographies by language:
    You can specify separate cs:layout sections by language along the lines of

    <bibliography>
    <layout locale="zh">
    <text macro="chinese-bibliography"/>
    </layout>
    <layout>
    <text macro="apa-bibliography"/>
    </layout>
    </bibliography>


    Here is an example style that does this for Hebrew
    https://gist.github.com/adam3smith/7948201

    For fully supported and more robust multilingual features, see the MLZ fork of Zotero:
    http://citationstylist.org/
  • I try to modify CSL from your suggestion, but it's seem the locale attribute is come from Zotero, not from the each bibliographies individually.
    I will cite English literature and Chinese literature in one Word file.
    So I want Zotero to generate two style bibliography list by bibliography's language field.
    How do I do?
  • the locale needs to be in the language field of each Zotero item. The style as described definitely does what you want.
  • Ok, I got it.

    I write "zh_TW" and "en_US" in language field, but <layout> only works with English words and dash "-", not underline "_".
    So I modify language fields to "zh-tw" and it's work now.

    Thank you very much!
  • edited December 14, 2013
    I find another question about terms.
    For Chinese bibliography, I want to use "及", not "and".
    But for English bibliography, just keep "and".

    I am confused with the usage <locale xml:lang="zh-tw"> and <terms>.
    Is the for use Zotero item's language field? Or Zotero's config?
  • You should review the docs on MLZ multiple layouts:

    http://citationstylist.org/docs/citeproc-js-csl.html
  • but basically the terms that correspond to the locale specified in the layout are used, so the this should use "及" for the bibliography with layout locale set to zh-TW (the capital letters - i.e. TW vs. tw - may matter, though.
  • edited December 15, 2013
    Thanks adamsmith and fbennett.

    I try to use layout with locale but I have a problem with prefix attribute.

    Following is my CSL code:

    ````

























    ````

    But the prefix of is not work. It only display the prefix of .

    So the Chinese (zh-tw) citation will be: (作者 is author)
    ````
    (作者,1991)
    ````

    What I expect is:
    ````
    (作者,1991)
    ````
    Could you teach me how to modify the code? Thank you.
  • that should work - where/how are you testing this?
  • edited December 15, 2013
    I uploaded my CSL file to github:
    https://github.com/pulipulichen/blogger/blob/061567182b865a808b1d52ce889b13c0a94a3c7d/project/zotero/apa_zh_pulipuli.csl
    In section, is between line 962~968 and is between line 972~978.
    Their prefix attribute are different. is "(" and is "(".

    Following is my test item bibliography:
    - Item Type: Book
    - Title: [圖書 01. 作者為一個人時]
    - Author: 作者
    - Place: 出版地
    - Publisher: 出版者
    - Date: 1991
    - Language: zh-tw
    Screenshot: https://lh5.googleusercontent.com/-EBAmVEbNIDI/Uq3sg4Bgj8I/AAAAAAABNmI/SKNgTT8-PRw/s0/2013-12-16_01-53-12.png

    I use CSL Editor to test it. The citation's prefix will use "(", not except "(":
    ````
    (作者,1991)
    ````
    Screenshot: https://lh5.googleusercontent.com/-CEnCJ5IFlMA/Uq3tFUaGKAI/AAAAAAABNmQ/_utNo-NXTtQ/s0/2013-12-16_01-55-38.png

    I use Zotero Standalone 4.0.17, the latest version now.

    Thank you for your help.
  • you're mixing a CSL 0.8 citation style with a csl 1.0 citation style and some csl-m elements. The two latter work togehterh, but you can't include 0.8 elements.
    Start from the most recent version of the APA style from:
    https://github.com/citation-style-language/styles/blob/master/apa.csl
  • I see.
    I will try to rebuild Chinese version from your apa.csl.
    Thank you for your advice.
  • edited December 17, 2013
    Dear adamsmith,

    I have rebuiled APA Chinese version from your apa.csl.
    My CSL file had been pushed to github:
    https://github.com/pulipulichen/blogger/blob/f7544634ebc2ab2ff6fb96362255233d26c05b8d/project/zotero/apa_zh_pulipuli.csl

    But I still have same problem in .
    I also use the same bibliography in CSL editor for testing:

    - Item Type: Book
    - Title: [圖書 01. 作者為一個人時]
    - Author: 作者
    - Place: 出版地
    - Publisher: 出版者
    - Date: 1991
    - Language: zh-tw

    Result screenshot: https://lh3.googleusercontent.com/-6ezp0xI6Goc/UrAcBtO8WnI/AAAAAAABNu4/Kj0Njl79FDA/s0/2013-12-17_17-40-24.png

    The citation still display like:
    (作者,1991)
    not my except:
    (作者,1991)

    I guess citation is fixed to use the prefix of without locale attribute. So the prefix of displayed instead of the prefix .

    Thank you for your help again.
Sign In or Register to comment.