Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Commit

Permalink
Use lang to specify locale.
Browse files Browse the repository at this point in the history
`locale` is still accepted as well, for backwards compatibility.
Closes #182.
  • Loading branch information
jgm committed Oct 13, 2015
1 parent 8463aa0 commit 058d103
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
7 changes: 5 additions & 2 deletions man/man1/pandoc-citeproc.1
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.\" Automatically generated by Pandoc 1.15.1
.\"
.hy
.TH "pandoc\-citeproc" "1" "2015-10-12" "" ""
.TH "pandoc\-citeproc" "1" "2015-10-13" "" ""
.SH NAME
.PP
pandoc\-citeproc \- filter to resolve citations in a pandoc document.
Expand Down Expand Up @@ -186,12 +186,15 @@ Here is a short example:
.fi
.RE
.TP
.B \f[C]locale\f[]
.B \f[C]lang\f[]
Locale to use in formatting citations.
If this is not set, the locale is taken from the
\f[C]default\-locale\f[] attribute of the CSL file.
\f[C]en\-US\f[] is used if a locale is not specified in either the
metadata or the CSL file.
(For backwards compatibility, the field \f[C]locale\f[] can be used
instead of \f[C]lang\f[], but this \f[C]lang\f[] should be used going
forward.)
.RS
.RE
.TP
Expand Down
6 changes: 4 additions & 2 deletions man/pandoc-citeproc.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ the input:
}
}

`locale`
`lang`
: Locale to use in formatting citations. If this is not set, the
locale is taken from the `default-locale` attribute of the CSL
file. `en-US` is used if a locale is not specified in either the
metadata or the CSL file.
metadata or the CSL file. (For backwards compatibility,
the field `locale` can be used instead of `lang`, but this
`lang` should be used going forward.)

`suppress-bibliography`
: If this has a true value, the bibliography will be left off.
Expand Down
3 changes: 2 additions & 1 deletion src/Text/CSL/Pandoc.hs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ processCites' (Pandoc meta blocks) = do
$ convertRefs $ lookupMeta "references" meta
let cslfile = (lookupMeta "csl" meta <|> lookupMeta "citation-style" meta)
>>= toPath
let mbLocale = lookupMeta "locale" meta >>= toPath
let mbLocale = (lookupMeta "lang" meta `mplus` lookupMeta "locale" meta)
>>= toPath
let getDefaultCSL' = case mbcsldir of
Just csldir -> do
let f = csldir </> "chicago-author-date.csl"
Expand Down

0 comments on commit 058d103

Please sign in to comment.