Allow user defined locale
Closed this issue · 6 comments
In citeproc-locale-getter-from-dir
you hard code locales-en-US.xml. What are your thoughts for changing locale? How about adding a variable where users can set a different file, and fallback to locales-en-US.xml in case the variable is nil? It would also be nice to use #+CSL_LOCALE: /path/to/csl_locale_file
to specify locale (and style) in-file. WDYT?
At least in theory, the en-US locale is not hard-coded at all -- if the language setting of the Org document is different and the variable citeproc-org-locales-dir
is set to a directory containing a corresponding CSL locale then citeproc-org should try to use the CSL locale in question (see the readme). Have you experienced something not in line with this? (It's best to test with the default Chicago style, because other styles may have their built-in default locale settings which are not overridden.)
I see, so we have to clone the official locales repo, add it to citeproc-org-locales-dir
, and add #+LANGUAGE:
to the Org document. Makes sense. Thanks for the explanation. I'll keep testing as I move forward but for now it works fine with the Chicago style.
Exactly! As I have mentioned above an ugly complication with CSL locales is that CSL styles can have their own default locale settings (fortunately, the Chicago style doesn't have one). You can still force the use of a different locale (citeproc-create
has a force-loc
parameter), but I didn't want to make this the default setting, so the #+LANGUAGE: option has no effect in the case of these styles.
What's the problem with forcing the locale, and how do we do it?
I think it goes somewhat against the spirit of the CSL standard in the sense that if a style declares a default locale then it presumably relies on some style-specific, non-standard localizations for this locale which differ from the standard locale files, which means that using these styles with standard locales for other languages could lead to problems. But this might be too cautious and locale forcing could certainly be made available as an option if there is a demand for it. (Currently citeproc-org doesn't provide an interface for forcing a locale.)
Closing this, as I think that the original problem was solved by pointing out that the locale can be changed by the user. Feel free to open an issue for supporting locale forcing.