languages sub directory

langauges no longer clutter the plugin directory

`langauge/init.lua` will load all languages as the plugins loader does.
(literally copy pasted, but fenced to avoid a "require overflow")
This commit is contained in:
tDwtp 2020-06-17 17:01:05 +02:00
parent 1db1f0bceb
commit 9fa57a209b
8 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
local core = require "core"
local no_errors = true
local files = system.list_dir(EXEDIR .. "/data/plugins/language")
for _, filename in ipairs(files) do
local langname = filename:gsub(".lua$", "")
if langname ~= "init" then
local ok = core.try(require, "plugins.language." .. langname)
if ok then
core.log_quiet("Loaded language %q", langname)
else
no_errors = false
end
end
end
return no_errors