Skip to content

Commit cd70266

Browse files
OmikhleiaDidier Willis
authored andcommitted
fix(packages): Apply default locale on locale overrides without xml:lang
Some citation styles are for a given language (default-locale) and contain locale overrides without xml:lang. This is for instance the case for iso690-author-date-en.
1 parent c08fcaa commit cd70266

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/bibtex/csl/style.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ function CslStyle:_preprocess (tree)
4646
end
4747
self.macros[name] = SU.ast.subContent(content)
4848
elseif content.command == "cs:locale" then
49-
local lang = content.options and content.options["xml:lang"]
49+
local lang = content.options and content.options["xml:lang"] or self.globalOptions["default-locale"]
5050
if not lang then
51-
SU.error("CSL locale without xml:lang")
51+
SU.error("CSL locale without xml:lang and no default locale")
5252
end
5353
if self.locales[lang] then
5454
SU.warn("CSL locale " .. lang .. " has multiple definitions, using the last one")

0 commit comments

Comments
 (0)