[MLZ] Is "language" a variable? (PS: multiple punctuation-in-quote options)

Is the "Language" field a variable that I can use a "choose" syntax on? It's not included in the list of CSL standard variables at http://citationstyles.org/downloads/specification.html#rendering-elements. But it is mentioned in the MLZ item types mapping at http://fbennett.github.io/z2csl/diffMap.html.

In practice, I'm getting some weird results. A conditional clause built around "language" is executed but does not exclude going through the other options in the same cluster. As a result, two clauses are executed in the same cluster.
  • what exactly are you trying to do? The proper way to have different bibliographies for different languages is by setting a locale on cs:layout.
  • I was trying to build a simple bifurcation based on the language of the reference. A Korean journal that I'm targeting requires such bifurcation of citation format.
  • Thanks! That's really helpful. I was barking up the wrong tree.
  • edited January 10, 2014
    Can there be only one "punctuation-in-quote" in one CSL-m? Is it possible to have different "punctuation-in-quote" option for each set of cs:layout or locally override the option within individual cs:text?

    I think the answer is no to both, but just wanted to double-check.
  • Yes, that is a limitation.
  • @fbennett, the value of "punctuation-in-quote" is tied to the locale (set on cs:style-options within cs:locale), right? So it should be possible to define it multiple times.
  • @rintze: You're right. I was misremembering.
  • mmm.

    @fbennett, @Rintze,

    Does that mean there can be multiple cs:locale? Since it appears only once and at the very beginning of a CSL, I wonder how you can have distinct cs:locale for each cs:layout. Do you place cs:locale within cs:layout?
  • With multiple layouts, each alternative layout but the last specifies a primary and zero or more subsidiary locales. When the item language matches a layout, the locale for rendering is set to the layout's primary locale (its first-listed language code). Since punctuation-in-quote is set on the locale, you can set it to different values on two locales, and when the locale is switched on layout selection, the punctuation-in-quote setting will change with it.
  • edited January 14, 2014
    You can set multiple cs:locale nodes in a style, by using different xml:lang attributes on each. It's documented here.
  • Got it. Thanks!
  • @fbennett,

    I'll eventually find out by trial and error, but can I have a cs:locale with no xml:lang attribute as default, in the same manner I have a default cs:layout with no locale attribute? English is my default language, but with the vast majority of the items in my database having empty "Language" field, most of the citations are formatted by the default cs:layout rather than the cs:layout with locale="en" attribute. Consequently, I need a (default) cs:locale to be able to handle items with empty language field.
  • the default locale is set either in the style using "default-locale="..."" in cs:style, or by the language of your Zotero installation.
  • @adamsmith,

    Yes, that I understand. My question is, how do I set up a cs:locale that will handle items with empty language field? Will having a cs:locale with no xml:lang attribute do?
  • It's possible I'm mistaken about this, but I'm pretty sure that an item with an empty language field will use the terms from the default locale. I don't think you can have a separate locale with no language - not even sure what that would mean.
  • edited January 21, 2014
    Can someone tell me why the code below doesn't work to bifurcate punctuation-in-quotes?


    <locale xml:lang="ko" version="1.0">
    <style-options punctuation-in-quote="false"/>
    <terms>
    </terms>
    </locale>
    <locale xml:lang="en-US" version="1.0">
    <style-options punctuation-in-quote="true"/>
    <terms>
    </terms>
    </locale>
  • It could be a processor bug -- I'll check later today.
  • I'll assume for the present that this failure was connected to the syntax issues in the style that emerged in another thread. If a valid style still fails to apply locale-specific punctuation-in-quote values, post again to this thread and I'll take a look.
  • Actually the punctuation-in-quote option still doesn't work. All the other locale settings - e.g., terms - follow the language of the data, except for the punctuation-in-quote. Strange.
  • Thanks, I'll take a look today.
Sign In or Register to comment.