'prefix' does not work, for 'layout locale="en" ', in 'citation' and 'bibliography'

edited 9 days ago
I have been using the 'language' field to get different layout for a long time, the 'layout locale="en" ' works fine. But now one .csl shows strange behaviour.

default-locale="zh-CN" , and under 'citation' I used: (<> is replaced by *)

*layout locale="en" prefix="en(" suffix=")en" *

*layout prefix="ch(" suffix=")ch" *

in order to get English layout for items whose 'language' field is 'en', and other items use the default layout.

But strangely, for items with 'en' in the 'language' field, the citation is: ch(Aonejason 2005)en , which uses the prefix of the default layout, but uses the suffix of the 'en' locale.

Items not with 'en' use the default layout OK.

I checked all text, looks all fine.

Any hints about this strange behaviour? What are possible related reasons?

Appreciate any feedback. Thanks a lot!
  • What you are trying to do is not possible with current CSL, I'm afraid.
  • Thanks for the message.

    I have been using the 'language' field to get different layout for a long time, the 'layout locale="en" ' works fine.

    The current CSL CAN generate different layouts by using 'language' field with different inputs.
  • Using the language field in this way is a feature of the CSL-m extension to CSL, not standard CSL. I don’t know that we have anyone here who’s used those features to any real degree. You might post to the Jurism mailing list and see if someone can help there https://juris-m.github.io/mail/. Though the creator of Jurism/CSL-m is retired and not very active with CSL anymore.

    It’s possible there is a bug in the citation processor handling of locales, but for such a core part of multilingual support, that would surprise me here.
  • Thanks for the suggestion, and I will try there.

    Just for anybody interested, I tested the 'bibliography' section as well, which shows the same behaviour: 'prefix' of 'locale="en" ' does not work, still uses the default locale setting. But 'suffix' and other parts follows the 'en' settings fine.

    With the following settings in 'bibliography' :

    *layout prefix="en(" suffix="." locale="en"*

    *layout prefix="ch(" suffix="。"*

    The English items with 'en' in the 'language' field are e.g.:

    ch(Aonejason, G. W. 2005. Fault Current Contribution From Synchronous Machine [J]. Journal of Software Engineering (345): 2256-2289.

    The items without 'en' are e.g. (with Chinese punctuation marks):

    ch(八二戒、悟空,2017a,大话西游[M],唐僧、玉帝译。天津: 黄河出版社。

    Hope Zotero can provide inherent support for multi-language settings better in the future.
Sign In or Register to comment.