summaryrefslogtreecommitdiff
path: root/macros/luatex/generic/luavlna/luavlna-csplain-langs.lua
blob: f4e1ccea1685974e9cd92a4a68f277a0a128857d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local languages = {}
local function parse_language_lan(content)
  for name,  id in content:gmatch("preplang%s+.-%s+(.-)%s+.-%s(.-)%s+") do
    -- skip invalid languages
    if not name:match("%#") then
      languages[name] = id
    end
  end
end

local langfile = kpse.find_file("lua-hyphen.lan")
if langfile then
  local f = io.open(langfile, "r")
  local content = f:read("*all")
  parse_language_lan(content)
  f:close()
end


return languages