Sorting Reference with non-english characters

Hi

Been looking in the forums, but not found anything conclusive on this. In my Reference section in word, the sort order does not handle my Swedish authors correctly. IE Ö gets sorted with O, Ä and Å gets sorted with A.. Is there any way to correct this?

Incidentally, the same behavior is observed in Stand-alone as well as in Firefox.

with kindest regards, John
  • Try installing the processor patch plugin:

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

    It will swap in the latest processor version, which has more refined locale-based sorting smarts. If the style uses a Swedish locale, it should sort those characters by Swedish conventions.
  • Hi

    Thanks for your help, but I might need a bit more to get this cleared up, as I am a newbie.

    I've installed the processor, both in Firefox, and standalone. Restarted everything. Sort order is still incorrect.. What do you mean with Swedish locale? I can't find any locale setting in Zotero? When you say it's per style, do you mean citation style? I'm using Harvard or APA 6, but not sure how those would be modified to accomodate non-english characters.


    Using Zotero 4.0.21.2

    With kindest regards, John
  • Update. I've also changed the extensions.zotero.export.bibliographyLocale to "sv-SE", restarted.. No change.

    To be clear, I am writing a thesis in English, using word. But some of my references would be international, using non-english characters. Zotero is used with english UI.

    With kindest regards, John
  • (Sorry, v. late here, will write tomorrow, if others don't pick up the issue. It's to do with a sort function in JavaScript; it may be difficult to get Swedish sort conventions in the English locale.)
  • Paper is due in a couple of weeks, so there is no rush. Thanks for the help so far.
  • edited July 14, 2014
    Sorting is controlled by a function described here. As the text under the link shows, it is capable of delivering a correct sort of Swedish characters, but only if Swedish is set as locale for all comparisons.

    So the first question is whether Swedish characters should always be sorted using Swedish conventions, regardless of the language in which the bibliography is presented. There would be a case, at least, for applying English sorting conventions in an English document, since many readers may not be aware of the Swedish rules. Is this a firm requirement?

    If Swedish sort conventions are a priority, there are a couple of ways to get to that result. One would be to always discriminate accented characters, for all locales. That's obviously out, since Swedish is an outlier: most other languages would start throwing incorrect results.

    An alternative would be to always set Swedish as a fallback to the default locale (the language in which the bibliography is presented). As I understand the spec under the link above, that should work. It would mean, though, that in an English document, characters that occur in Swedish would always sort using Swedish conventions, even where they also occur in other languages that adopt different sorting conventions. So there would be some sorts that come out wrong.

    The only other way to get there would be to provide a setting for the sort locale, and expose that in the Zotero UI. As it's a very specialized requirement, and would be a workaround in any case, that is unlikely to materialize.

    All of that said, the current processor code would clobber Swedish sort rules, even in a Swedish document (where is says 'sensitivity: "base"). I'll fix that, but it won't address this use case, unfortunately.

    For what it's worth, and as far as I can tell, the Chicago Manual of Style does not provide any guidance on cross-language sorting. I think that would imply an assumption for CMS, at least, that English conventions (e.g. A = Ä) should be applied across the board.
  • edited July 14, 2014
    Since the document is written in English (and not, say, "Swedish English", since that doesn't exist), I think it makes sense for the sorting to be in English as well, so, FWIW, I think that the processor should simply sort by the bibliography locale.

    In regards to the 'sensitivity: "base"' comment above, I'm fairly certain that what is considered "base" is locale-dependent. That is to say that, while Ö in en-US is converted to the base letter O, in sv-SE Ö is already a base letter and is compared as is (but Ó is converted to base):
    'Ö'.localeCompare('O', 'sv-SE', {sensitivity:'base'}) == 1
    'Ö'.localeCompare('O', 'en-US', {sensitivity:'base'}) == 0
    'Ó'.localeCompare('O', 'sv-SE') == 1
    'Ó'.localeCompare('O', 'sv-SE', {sensitivity:'base'}) == 0
    'Ö'.localeCompare('Z', 'sv-SE', {sensitivity:'base'}) == 1
    So I think that you should keep the sensitivity option as is.

    Having said this, @J.Koukoutsas what style are you using? If you're using a style that supports multiple locales, setting extensions.zotero.export.bibliographyLocale to "sv-SE" should have produced correct sorting (but it would have also changed some words in the bibliography to Swedish if the translation exists).

    Edit: Nvm, I see
    I'm using Harvard or APA 6
  • edited July 14, 2014
    Having said this, @J.Koukoutsas what style are you using? If you're using a style that supports multiple locales, setting extensions.zotero.export.bibliographyLocale to "sv-SE" should have produced correct sorting (but it would have also changed some words in the bibliography to Swedish if the translation exists).
    This works correctly for me, _but_ you do have to switch to a different style and back for the locale to take effect. @fbennett, can we fix this? Is this in citeproc-js or in Zotero?

    Edit: this is with APA 6th edition. Harvard (I assume the "Elsevier Harvard" that comes pre-installed with Zotero) does not support multiple locales, en-US only.
  • I'm fairly certain that what is considered "base" is locale-dependent.
    You're right of course. The sensitivity setting will stay with us.

    @J.Koukoutsas: Following on from @aurimas' comment above, you can get Swedish sort order in an English bibliography by preparing a custom style. The adjustments needed are very simple, and as we've put you through the experience of this thread, I'll be happy to whip up a copy for you, if you need it for your paper; just post a request back to this thread.
  • you can get Swedish sort order in an English bibliography by preparing a custom style.
    Do you mean by specifying the default bibliography language? Wouldn't you have to override all the translations? Or is there a trick I am missing?
  • edited July 15, 2014
    It should work to just set the default-locale to Swedish, and then set the Swedish locale (inside the style) to use English terms and dates and etc. It's a workaround, but should do the trick. I think. (He said.)
  • (Since the default-locale setting and the overwrites of the locale terms etc. need to be coordinated, the "fix" would code both of those into the style CSL, bypassing the Zotero preference for the former.)
  • @fbennett, that's what I thought. If only we could do this by somehow overlaying the APA style so the custom version doesn't diverge from the updates to APA... (coming soon, I promise)
  • @J.Koukoutsas: Happy to prepare that style version for you, if required.
Sign In or Register to comment.