summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-languages-counters.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/modules/mkiv/s-languages-counters.lua')
-rw-r--r--tex/context/modules/mkiv/s-languages-counters.lua52
1 files changed, 52 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-languages-counters.lua b/tex/context/modules/mkiv/s-languages-counters.lua
new file mode 100644
index 000000000..436e64a64
--- /dev/null
+++ b/tex/context/modules/mkiv/s-languages-counters.lua
@@ -0,0 +1,52 @@
+if not modules then modules = { } end modules ['s-languages-counters'] = {
+ version = 1.001,
+ comment = "companion to s-languages-counters.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+moduledata.languages = moduledata.languages or { }
+moduledata.languages.counters = moduledata.languages.counters or { }
+
+local data = converters.verbose.data
+
+function moduledata.languages.counters.showverbose(specification)
+ specification = interfaces.checkedspecification(specification)
+ local list = utilities.parsers.settings_to_array(specification.language or "")
+ if #list == 0then
+ return
+ end
+ local used = { }
+ local words = { }
+ for i=1,#list do
+ local ai = list[i]
+ local di = data[ai]
+ if di and di.words then
+ used[#used+1] = ai
+ table.merge(words,di.words)
+ end
+ end
+ context.starttabulate { string.rep("|l",#used) .. "|r|" }
+ context.HL()
+ context.NC()
+ for i=1,#used do
+ context.bold(used[i])
+ context.NC()
+ end
+ context.bold("number")
+ context.NC()
+ context.NR()
+ context.HL()
+ for k, v in table.sortedhash(words) do
+ context.NC()
+ for i=1,#used do
+ context(data[used[i]].words[k] or "")
+ context.NC()
+ end
+ context(k)
+ context.NC()
+ context.NR()
+ end
+ context.stoptabulate()
+end