From a644dff04326acbef12f69403074a23f4a2bd1f3 Mon Sep 17 00:00:00 2001 From: conde2 Date: Wed, 18 Jan 2017 11:31:40 -0200 Subject: [PATCH] Show missing translation on console --- modules/client_locales/locales.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/modules/client_locales/locales.lua b/modules/client_locales/locales.lua index a3e3d82e..2c39927a 100644 --- a/modules/client_locales/locales.lua +++ b/modules/client_locales/locales.lua @@ -113,15 +113,18 @@ function installLocale(locale) if _G.allowedLocales and not _G.allowedLocales[locale.name] then return end if locale.name ~= defaultLocaleName then - local updatesNeeded = 0 - for _i,k in pairs(neededTranslations) do + local updatesNamesMissing = {} + for _,k in pairs(neededTranslations) do if locale.translation[k] == nil then - updatesNeeded = updatesNeeded + 1 + updatesNamesMissing[#updatesNamesMissing + 1] = k end end - if updatesNeeded > 0 then - pdebug('Locale \'' .. locale.name .. '\' is missing ' .. updatesNeeded .. ' translations.') + if #updatesNamesMissing > 0 then + pdebug('Locale \'' .. locale.name .. '\' is missing ' .. #updatesNamesMissing .. ' translations.') + for _,name in pairs(updatesNamesMissing) do + pdebug('["' .. name ..'"] = \"\",') + end end end