emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Citations: Locale specific adaptions?
@ 2021-10-08 16:37 M. ‘quintus’ Gülker
  2021-10-08 16:46 ` Bruce D'Arcus
  2021-10-08 16:51 ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: M. ‘quintus’ Gülker @ 2021-10-08 16:37 UTC (permalink / raw)
  To: emacs-orgmode

Dear list,

CSL has a concept of locales, where things like specific terms or the
date format are drawn from locale files (see
https://docs.citationstyles.org/en/1.0.1/specification.html#locale). I
am not entirely sure if this is supported yet by the new citations
functionality. Take this test document test.org:

    #+TITLE: Test
    #+LANGUAGE: de
    #+AUTHOR: Testauthor
    #+bibliography: /tmp/test/test.bib
    #+cite_export: csl /tmp/test/juristische-zitierweise.csl

    Das ist ein Test. [cite: @boehme-neßler2017unscharfes-recht-digital p. 3033] Zweiter Satz.
    Noch ein Test. [cite: @akbarian2020oeffentliche-raeume]

    #+print_bibliography:

Where /tmp/test/test.bib looks like this:

    @Article{boehme-neßler2017unscharfes-recht-digital,
    	author = {Volker Boehme-Neßler},
    	title = {Die Macht der Algorithmen und die Ohnmacht des Rechts},
    	shortjournal = {NJW},
    	journaltitle = {Neue Juristische Wochenschrift},
    	year = {2017},
    	pages = {3031-3037},
    	langid = {ngerman}
    }

    @online{akbarian2020oeffentliche-raeume,
    	author = "Samira Akbarian",
    	title = "An einen, der vorüberfuhr",
    	language = "de",
    	date = "2020-12-14",
    	url = "https://verfassungsblog.de/an-einen-der-voruberfuhr/",
    	urldate = "2021-01-02"
    }

juristische-zitierweise.csl is a style for longer judicial works and
available from the CSL repository at https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-zitierweise.csl.

Given that test.org spefies “#+LANGUAGE: de”, I would expect that
exporting uses the German terms and date format. However, exporting e.g.
to HTML gives this in the bibliography:

    Akbarian, Samira, An einen, der vorüberfuhr, Stand: December 14,
    2020, https://verfassungsblog.de/an-einen-der-voruberfuhr/
    (accessed 01/02/2021).

The correctly German word “Stand” is hardcoded in
juristische-zitierweise.el, so ignore that one for a moment. Other than
that, you will notice that the date format is US English. This should
not be the case. For comparison, here is the same document in Pandoc
Markdown:

    ---
    title: Test
    author: Testauthor
    lang: de
    ---

    Das ist ein Test. [@boehme-neßler2017unscharfes-recht-digital, p. 3033] Zweiter Satz.
    Noch ein Test. [@akbarian2020oeffentliche-raeume]

If this is exported with

    pandoc -o test-pandoc.html -s --toc -C --csl=juristische-zitierweise.csl --bibliography=test.bib test.md

then the cited entry in the bibliography correctly reads

  Akbarian, Samira, An einen, der vorüberfuhr, Stand: 14.
  Dezember 2020, https://verfassungsblog.de/an-einen-der-voruberfuhr/
  (besucht am 02.01.2021).

You see how the date format changed for both the long and the numeric
format and how the translated string "besucht am" is used.

I am not entirely sure if this is a bug, a missing feature (if so, I
would like to request it), or a user error on my side. Please enlighten
me.

I used org 9.5 from MELPA with citeproc.el from the Git repository at
34e66583d95a8d80fb5b9f2960f3382ca0e6d3ab.

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 16:37 Citations: Locale specific adaptions? M. ‘quintus’ Gülker
@ 2021-10-08 16:46 ` Bruce D'Arcus
  2021-10-08 16:51 ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Bruce D'Arcus @ 2021-10-08 16:46 UTC (permalink / raw)
  To: org-mode-email

On Fri, Oct 8, 2021 at 12:38 PM M. ‘quintus’ Gülker
<post+orgmodeml@guelker.eu> wrote:

> I am not entirely sure if this is a bug, a missing feature (if so, I
> would like to request it), or a user error on my side. Please enlighten
> me.

From reading the code, it looks like you need to set org-cite-csl-locales-dir.

Have you done that, and is the locale you need there?

Another detail to add to the manual.

Bruce


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 16:37 Citations: Locale specific adaptions? M. ‘quintus’ Gülker
  2021-10-08 16:46 ` Bruce D'Arcus
@ 2021-10-08 16:51 ` Nicolas Goaziou
  2021-10-08 18:32   ` M. ‘quintus’ Gülker
  2021-10-08 19:00   ` András Simonyi
  1 sibling, 2 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2021-10-08 16:51 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

M. ‘quintus’ Gülker <post+orgmodeml@guelker.eu> writes:

> CSL has a concept of locales, where things like specific terms or the
> date format are drawn from locale files (see
> https://docs.citationstyles.org/en/1.0.1/specification.html#locale). I
> am not entirely sure if this is supported yet by the new citations
> functionality. Take this test document test.org:
>
>     #+TITLE: Test
>     #+LANGUAGE: de
>
>     #+AUTHOR: Testauthor
>     #+bibliography: /tmp/test/test.bib
>
>     #+cite_export: csl /tmp/test/juristische-zitierweise.csl
>
>     Das ist ein Test. [cite: @boehme-neßler2017unscharfes-recht-digital p. 3033] Zweiter Satz.
>     Noch ein Test. [cite: @akbarian2020oeffentliche-raeume]

[...]

> juristische-zitierweise.csl is a style for longer judicial works and
> available from the CSL repository at https://github.com/citation-style-language/styles/blob/e22b8a566bad9b4c7f52720f60dd875057a5d210/juristische-zitierweise.csl.
>
> Given that test.org spefies “#+LANGUAGE: de”, I would expect that
> exporting uses the German terms and date format. However, exporting e.g.
> to HTML gives this in the bibliography:
>
>     Akbarian, Samira, An einen, der vorüberfuhr, Stand: December 14,
>     2020, https://verfassungsblog.de/an-einen-der-voruberfuhr/
>     (accessed 01/02/2021).\a
>
> The correctly German word “Stand” is hardcoded in
> juristische-zitierweise.el, so ignore that one for a moment. Other than
> that, you will notice that the date format is US English. This should
> not be the case. 

I think you need to provide locales in addition to the style file, see
`org-cite-csl-locales-dir'.

Regards,
-- 
Nicolas Goaziou


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 16:51 ` Nicolas Goaziou
@ 2021-10-08 18:32   ` M. ‘quintus’ Gülker
  2021-10-08 20:12     ` Nicolas Goaziou
  2021-10-08 19:00   ` András Simonyi
  1 sibling, 1 reply; 7+ messages in thread
From: M. ‘quintus’ Gülker @ 2021-10-08 18:32 UTC (permalink / raw)
  To: emacs-orgmode

Am Freitag, dem 08. Oktober 2021 schrieb Nicolas Goaziou:
> I think you need to provide locales in addition to the style file, see
> `org-cite-csl-locales-dir'.

That resolved the problem! Thank you (and Bruce). I cloned
https://github.com/citation-style-language/locales and set
`org-cite-csl-locales-dir' to the repository's directory.

I agree with Bruce that this should be mentioned in the manual,
including a pointer to the aforementioned Git repository, because I
needed to find that one on my own.

Thanks again!

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 16:51 ` Nicolas Goaziou
  2021-10-08 18:32   ` M. ‘quintus’ Gülker
@ 2021-10-08 19:00   ` András Simonyi
  1 sibling, 0 replies; 7+ messages in thread
From: András Simonyi @ 2021-10-08 19:00 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode list

Dear All,

setting the `org-cite-csl-locales-dir' variable to a directory
containing the German CSL locale file I indeed get the localized

Akbarian, Samira, An einen, der vorüberfuhr, Stand: 14. Dezember 2020,
https://verfassungsblog.de/an-einen-der-voruberfuhr/ (besucht am
02.01.2021).

version of the bibliography entry,

best wishes,
András





> I think you need to provide locales in addition to the style file, see
> `org-cite-csl-locales-dir'.
>
> Regards,
> --
> Nicolas Goaziou
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 18:32   ` M. ‘quintus’ Gülker
@ 2021-10-08 20:12     ` Nicolas Goaziou
  2021-10-09  6:45       ` M. ‘quintus’ Gülker
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2021-10-08 20:12 UTC (permalink / raw)
  To: emacs-orgmode

M. ‘quintus’ Gülker <mg@guelker.eu> writes:

> I agree with Bruce that this should be mentioned in the manual,
> including a pointer to the aforementioned Git repository, because I
> needed to find that one on my own.

Meanwhile, the `csl' processor is copiously documented in the
"Commentary" section of the "oc-csl.el" file.

Regards,


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Citations: Locale specific adaptions?
  2021-10-08 20:12     ` Nicolas Goaziou
@ 2021-10-09  6:45       ` M. ‘quintus’ Gülker
  0 siblings, 0 replies; 7+ messages in thread
From: M. ‘quintus’ Gülker @ 2021-10-09  6:45 UTC (permalink / raw)
  To: emacs-orgmode


Am Freitag, dem 08. Oktober 2021 schrieb Nicolas Goaziou:
> Meanwhile, the `csl' processor is copiously documented in the
> "Commentary" section of the "oc-csl.el" file.

Thanks for the heads-up. Next time I will take a look there as well.

  -quintus

-- 
Dipl.-Jur. M. Gülker | https://mg.guelker.eu | PGP: Siehe Webseite
Passau, Deutschland  | kontakt@guelker.eu    | O<


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-09  6:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-08 16:37 Citations: Locale specific adaptions? M. ‘quintus’ Gülker
2021-10-08 16:46 ` Bruce D'Arcus
2021-10-08 16:51 ` Nicolas Goaziou
2021-10-08 18:32   ` M. ‘quintus’ Gülker
2021-10-08 20:12     ` Nicolas Goaziou
2021-10-09  6:45       ` M. ‘quintus’ Gülker
2021-10-08 19:00   ` András Simonyi

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).