multiple locales in a single document

26 views
Skip to first unread message

Abbas

unread,
May 25, 2011, 4:05:11 AM5/25/11
to citeproc-js
Dear Frank Bennett,
I am trying to add some features to Zotero to make it more productive
for Persian language users. The problem that I am dealing with now is
that we need to make a bibliography consisting of items from at least
two languages: English and Persian. Each reference in this
bibliography must be formatted using the appropriate locale file i.e.
Persian(fa-IR) locale for Persian references and English(en-US) locale
for English references.
It seems that CSL supports just one locale per document. I edited
previous version of Zotero (csl.js) and changed _defaultTerms variable
to _defaultTerms[] array and solved the problem after few hours of
coding. But then Zotero 2.1 came out with citeproc-js. Do you suggest
to use the same approach on citeproc? I mean changing locale object to
an array of objects e.g locales[fa], locales[en], locales[...]?
Best regards,
Abbas Shahzadeh

Frank Bennett

unread,
May 25, 2011, 4:28:35 AM5/25/11
to citeproc-js
Interesting! And delighted to hear of your interest in multilingual. A
very similar facility is built into the processor itself, and can be
invoked by building a style that has multiple cs:layout nodes,
distinguished by a "locale" attribute on all but the last (default)
cs:layout node. You can find sample tests (which pass against the
Zotero processor) here:

https://bitbucket.org/fbennett/citeproc-js/src/720cdd692371/tests/fixtures/local/language_BaseLocale.txt
https://bitbucket.org/fbennett/citeproc-js/src/720cdd692371/tests/fixtures/local/language_InterCiteJoins.txt

Mainstream Zotero does not pass the "language" variable, so styles
built in this way will always use the default cs:layout node if run on
a mainstream client. Language discrimination will work in
multilingual, though. To install:

http://gsl-nagoya-u.net/http/pub/zotero-multi-2.xpi

Hope it helps!

Frank Bennett
Nagoya




> Best regards,
> Abbas Shahzadeh

Avram Lyon

unread,
May 25, 2011, 4:47:06 AM5/25/11
to citep...@googlegroups.com
On Wed, May 25, 2011 at 12:28 PM, Frank Bennett <bierc...@gmail.com> wrote:
> Interesting! And delighted to hear of your interest in multilingual. A
> very similar facility is built into the processor itself, and can be
> invoked by building a style that has multiple cs:layout nodes,
> distinguished by a "locale" attribute on all but the last (default)
> cs:layout node. You can find sample tests (which pass against the
> Zotero processor) here:

Wouldn't it be better to have a way to enable per-citation localized
terms, with a fallback to the default locale for items with an
unspecified language or for languages that don't have a corresponding
CSL locale?

That would require a change to the CSL spec, but it would be a much
cleaner way to cover this common case of coordinated terms.

Avram

Frank Bennett

unread,
May 25, 2011, 5:05:56 AM5/25/11
to citeproc-js
On May 25, 5:47 pm, Avram Lyon <ajl...@gmail.com> wrote:
If we can work out what the smoothest set of options would be, that
wouldn't be hard to set up. One approach to exploring this zone might
be to stick with the drastic and dirty approach shown in the test
samples, and then refine the syntax to something more concise once
we've seen what sort of style code people build out for support of
various language combinations. That assumes, of course, that syntax in
the samples isn't so off-putting that it chases people away, of
course. :) But I think it's pretty straightforward, just a bit verbose
and simple-minded.

Frank

>
> Avram

Abbas Shahzadeh

unread,
Jun 19, 2011, 3:04:26 AM6/19/11
to citep...@googlegroups.com
Dear Mr Bennett,
I tried multiple layout nodes in the style file. It works for citations but doesn't work for bibliography. I added a <layout locale="en"> node to <bibliography> section of Vacouver style and changed the new layout to see if it works. But all references (including non-English references) are formatted using the default layout. I ran the test in the last version of multilingual Zotero and all of items had their language field set to "en" or "fa".
Best regards,
Abbas

 

On Wed, May 25, 2011 at 11:58 AM, Frank Bennett <bierc...@gmail.com> wrote:
On May 25, 5:05 pm, Abbas <a.shahza...@gmail.com> wrote:
> we need to make a bibliography consisting of items from at least
> two languages: English and Persian. Each reference in this
> bibliography must be formatted using the appropriate locale file i.e.
> Persian(fa-IR) locale for Persian references and English(en-US) locale
> for English references.

Abbas Shahzadeh

unread,
Jun 19, 2011, 8:43:35 AM6/19/11
to citep...@googlegroups.com
Sorry. It works except for suffix attribute which is not important to me. Please ignore my last email.
Reply all
Reply to author
Forward
0 new messages