summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/publ-ini.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-11-01 12:10:24 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-11-01 12:10:24 +0100
commit5fd6625a09421c86f7bf27efaff9a64cc5cf3d0f (patch)
tree32c7f9643a7edc077bbce72414afc7ab52e61ac7 /tex/context/base/mkiv/publ-ini.lua
parent7fc4b935d045c84e89459e726ff54ae331e4c574 (diff)
downloadcontext-5fd6625a09421c86f7bf27efaff9a64cc5cf3d0f.tar.gz
2017-11-01 12:01:00
Diffstat (limited to 'tex/context/base/mkiv/publ-ini.lua')
-rw-r--r--tex/context/base/mkiv/publ-ini.lua40
1 files changed, 31 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/publ-ini.lua b/tex/context/base/mkiv/publ-ini.lua
index ed3050f35..130f9a49b 100644
--- a/tex/context/base/mkiv/publ-ini.lua
+++ b/tex/context/base/mkiv/publ-ini.lua
@@ -2364,16 +2364,34 @@ do
local function btxvalidcitevariant(dataset,variant)
local citevariant = rawget(citevariants,variant)
if citevariant then
- return variant, citevariant
+ return citevariant
end
- local variant = specifications[dataset].types[variant]
- if variant then
- citevariant = rawget(citevariants,variant)
+ local s = datasets[dataset]
+ if s then
+ s = s.specifications
end
- if citevariant then
- return variant, citevariant
+ if s then
+ for k, v in sortedhash(s) do
+ s = k
+ break
+ end
+ end
+ if s then
+ s = specifications[s]
+ end
+ if s then
+ s = s.types
+ end
+ if s then
+ variant = s[variant]
+ if variant then
+ citevariant = rawget(citevariants,variant)
+ end
+ if citevariant then
+ return citevariant
+ end
end
- return "default", citevariants.default
+ return citevariants.default
end
local function btxhandlecite(specification)
@@ -2419,8 +2437,7 @@ do
--
ctx_btxsetdataset(dataset)
--
- local variant, citevariant = btxvalidcitevariant(dataset,variant)
- specification.variant = variant -- the used one
+ local citevariant = btxvalidcitevariant(dataset,variant)
--
citevariant(specification) -- we always fall back on default
end
@@ -2677,6 +2694,11 @@ do
ctx_btxsettag(tag)
ctx_btxsetcategory(entry.category or "unknown")
--
+ local language = entry.language
+ if language then
+ ctx_btxsetlanguage(language)
+ end
+ --
if lefttext then local text = lefttext [i] ; if text and text ~= "" then ctx_btxsetlefttext (text) end end
if righttext then local text = righttext[i] ; if text and text ~= "" then ctx_btxsetrighttext(text) end end
if before then local text = before [i] ; if text and text ~= "" then ctx_btxsetbefore (text) end end