diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-12 17:15:07 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-01-12 17:15:07 +0100 |
commit | 8d8d528d2ad52599f11250cfc567fea4f37f2a8b (patch) | |
tree | 94286bc131ef7d994f9432febaf03fe23d10eef8 /tex/context/modules/mkiv/s-set-31.mkiv | |
parent | f5aed2e51223c36c84c5f25a6cad238b2af59087 (diff) | |
download | context-8d8d528d2ad52599f11250cfc567fea4f37f2a8b.tar.gz |
2016-01-12 16:26:00
Diffstat (limited to 'tex/context/modules/mkiv/s-set-31.mkiv')
-rw-r--r-- | tex/context/modules/mkiv/s-set-31.mkiv | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-set-31.mkiv b/tex/context/modules/mkiv/s-set-31.mkiv new file mode 100644 index 000000000..53037a78d --- /dev/null +++ b/tex/context/modules/mkiv/s-set-31.mkiv @@ -0,0 +1,118 @@ +% show missing translations + +\startluacode +function interfaces.show_missing(whatinterfaces) + whatinterfaces = whatinterfaces or interfaces.interfaces + local list = dofile(resolvers.find_file("mult-def.lua")) + local NC, NR, HL = context.NC, context.NR, context.HL + for k,v in table.sortedhash(list) do + context.title(k) + context.starttabulate { string.rep("|",#whatinterfaces+1) } + for i=1,#whatinterfaces do + NC() + context(whatinterfaces[i]) + end + NC() NR() HL() + for kk, vv in next, v do + if not string.find(kk,"subsub") then + local okay = true + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + if not str or (int ~= "en" and str == vv.en) then + okay = false + break + end + end + if not okay then + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + context.NC() + if not str then + -- nothing + elseif int == "en" then + context.color( { "darkgreen" }, str ) + elseif str == vv.en then + context.color( { "darkred" }, str ) + elseif int == "pe" then + context("\\righttoleft " .. str) + else + context(str) + end + end + NC() NR() + end + end + end + context.stoptabulate() + end +end + +function interfaces.show_missing_messages(whatinterfaces) + whatinterfaces = whatinterfaces or interfaces.interfaces + local list = dofile(resolvers.find_file("mult-mes.lua")) + local NC, NR, HL = context.NC, context.NR, context.HL + for k,v in table.sortedhash(list) do + context.title("message: " .. k) + context.starttabulate { "|l|" .. string.rep("pl|",#whatinterfaces) } + NC() + for i=1,#whatinterfaces do + NC() + context(whatinterfaces[i]) + end + NC() NR() HL() + local sorted = table.sortedkeys(v) + for i=1,#sorted do + local kk = sorted[i] + local vv = v[kk] + if kk ~= "files" then + local okay = true + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + if not str or (int ~= "en" and str == vv.en) then + okay = false + break + end + end + if not okay then + context.NC() + context(kk) + for i=1,#whatinterfaces do + local int = whatinterfaces[i] + local str = vv[int] + NC() + if not str then + -- nothing + elseif int == "en" then + context.color( { "darkgreen" }, str ) + elseif str == vv.en then + context.color( { "darkred" }, str ) + elseif int == "pe" then + context("\\righttoleft " .. str) + else + context(str) + end + end + NC() NR() + end + end + end + context.stoptabulate() + end +end +\stopluacode + +\starttext + +\setupbodyfont[dejavu,7pt,tt] +\setuppapersize[A4,landscape][A4,landscape] +\setuplayout[backspace=.5cm,width=middle,topspace=.5cm,height=middle,header=1cm,footer=0cm] + +\startluacode + interfaces.show_missing() -- { "en","nl" } + interfaces.show_missing_messages() -- { "en","nl" } +\stopluacode + +\stoptext |