andras-simonyi / citeproc-el

A CSL 1.0.2 Citation Processor for Emacs.
GNU General Public License v3.0
85 stars 9 forks source link

The default CSL locale file doesn't exist or is unreadable #103

Closed Cletip closed 1 week ago

Cletip commented 2 years ago

Hi there! I'm trying to export my quotes in csl format, but unfortunately it doesn't work because I get the error message in the title. I tried with this file :


+title: Testderéférences

+cite_export: csl /home/msi/documents/notes/braindump/org/reference/chicago-author-date-16th-edition.csl

I also try this : 


(setq org-cite-csl--fallback-style-file "/home/msi/documents/notes/braindump/org/reference/chicago-author-date-16th-edition.csl")

(setq org-ref-csl-default-style "/home/msi/documents/notes/braindump/org/reference/chicago-author-date-16th-edition.csl")

(setq org-cite-csl-styles-dir "~/Zotero/styles")


but, "obviously", it doesn't work :/

Finally, the error (I think) must be related to one particular function(see below), because it is the only place where I found the message "The default CSL locale file doesn't exist or is unreadable". The function is : citeproc-locale-getter-from-dir which is in citeproc-locale.el Thanks you in advance, and sorry for the poor formatting of my message ^^

andras-simonyi commented 2 years ago

First of all, thanks for the report and sorry for responding that late. The problem seems to be that -- as the error message says -- the default CSL locale file, which is the en-US locale called locales-en-US.xml, is not found. Based on your example, you are using org-cite, in that case the value of the variable org-cite-csl-locales-dir should be set to a directory at least containing locales-en-US.xml, which can be downloaded, e.g., from the repository https://github.com/citation-style-language/locales.

What is strange is that normally org-cite-csl-locales-dir is set to a directory containing the en-US locale automatically, because recent Org versions ship with that locale file.

Cletip commented 2 years ago

Hello, thanks for your answer :) So I did some tests. And I tried this:

(setq org-cite-csl-locales-dir "/home/msi/documents/notes/braindump/org") (setq org-cite-csl-styles-dir "/home/msi/documents/notes/braindump/org")

where I have my locales-en-US.xml and my chicago-author-date.csl. And it doesn't work :/

However, this does work: (setq org-cite-csl--fallback-style-file "/home/msi/documents/notes/braindump/org/vancouver-brackets.csl"); to change the style (setq org-cite-csl--fallback-locales-dir "/home/msi/documents/notes/braindump/org/") ;; where is my locales-en-US.xml

I need to put the "fallback" all the time.

I don't understand why, despite the correct configuration of variables, the fact that org-cite always takes "fallback" folders/files :(

andras-simonyi commented 7 months ago

Hello, may I ask what is the status of this report? Have you managed to resolve the problem eventually?

Cletip commented 7 months ago

No news, still open for me :( But the code above works !

andras-simonyi commented 1 week ago

First of all, sorry for reacting that late -- one of the reasons is that I don't really have an idea what the problem could be. As it seems to be more of an Org problem than citeproc-el (Org seems to be passing incorrect paths to citeproc when using the first two variables but correct ones when using the fallback ones), if it still persists and you have the time please report it to the Org-mode mailing list, for instance, using the `org-submit-bug-report' Emacs command. I plan to close this issue shortly.

Cletip commented 1 week ago

No worries, I'll see if I can send an email to the org-mode mailing list.

andras-simonyi commented 1 week ago

Thanks!