diff options
author | Hans Hagen <pragma@wxs.nl> | 2014-08-27 12:34:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2014-08-27 12:34:00 +0200 |
commit | 7eb8593f39b61673c90d12c2fc590933cedf3db0 (patch) | |
tree | ac058c5e9596f806edfb03969fc39764e33d391e /tex/context/base/lang-ini.lua | |
parent | 236b439da00fe0baaf9d7ad6ce684ecd6109555c (diff) | |
download | context-7eb8593f39b61673c90d12c2fc590933cedf3db0.tar.gz |
beta 2014.08.27 12:34
Diffstat (limited to 'tex/context/base/lang-ini.lua')
-rw-r--r-- | tex/context/base/lang-ini.lua | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/tex/context/base/lang-ini.lua b/tex/context/base/lang-ini.lua index a9f428caa..49eff4949 100644 --- a/tex/context/base/lang-ini.lua +++ b/tex/context/base/lang-ini.lua @@ -85,6 +85,14 @@ local function tolang(what) -- returns lang object end end +function languages.getdata(tag) -- or number + if tag then + return registered[tag] or registered[numbers[tag]] + else + return registered[numbers[tex.language]] + end +end + -- languages.tolang = tolang -- patterns=en @@ -137,13 +145,14 @@ local function loaddefinitions(tag,specification) report_initialization("loading definition %a for language %a from %a",definition,tag,fullname) end local suffix, gzipped = gzip.suffix(fullname) - local defs = table.load(fullname,gzipped and gzip.load) - if defs then -- todo: version test + local resources = table.load(fullname,gzipped and gzip.load) + if resources then -- todo: version test ok, nofloaded = true, nofloaded + 1 - -- instance:patterns (defs.patterns and defs.patterns .data or "") - -- instance:hyphenation(defs.exceptions and defs.exceptions.data or "") - instance:patterns (validdata(defs.patterns, "patterns", tag) or "") - instance:hyphenation(validdata(defs.exceptions,"exceptions",tag) or "") + -- instance:patterns (resources.patterns and resources.patterns .data or "") + -- instance:hyphenation(resources.exceptions and resources.exceptions.data or "") + instance:patterns (validdata(resources.patterns, "patterns", tag) or "") + instance:hyphenation(validdata(resources.exceptions,"exceptions",tag) or "") +data.resources = resources -- so we can use them otherwise else report_initialization("invalid definition %a for language %a in %a",definition,tag,filename) end |