Skip to content

Commit

Permalink
Make translation stats be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
vadi2 committed Aug 14, 2019
1 parent b66f668 commit fd6f32e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions translations/translated/generate-translation-stats.lua
@@ -1,5 +1,13 @@
local yajl = require 'yajl'
assert(yajl, "yajl is not available (luarocks install lua-yajl)")
local status, result = pcall(require, 'yajl')
if not status then
print("warning: lua-yajl not available - translation statistics in settings won't be shown.")
io.output("translation-stats.json")
io.write("{}")

return
end

local yajl = result

-- see if the file exists
function file_exists(file)
Expand Down

0 comments on commit fd6f32e

Please sign in to comment.