From fceb1a37df623649d191c3c1a881e5b0538b1391 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 3 Mar 2020 19:39:02 -0500 Subject: Added test suite and API type checking for more helpful error messages. --- core/locale.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/locale.lua') diff --git a/core/locale.lua b/core/locale.lua index 48de4af5..45a0f855 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -23,12 +23,12 @@ for line in f:lines() do -- comment. if not line:find('^%s*[^%w_%[]') then local id, str = line:match('^(.-)%s*=%s*(.+)$') - if id and str and assert(not M[id], 'duplicate locale key: '..id) then + if id and str and assert(not M[id], 'duplicate locale key "%s"', id) then M[id] = not CURSES and str or str:gsub('_', '') end end end f:close() -return setmetatable(M, - {__index = function(_, k) return 'No Localization:'..k end}) +setmetatable(M, {__index = function(_, k) return 'No Localization:'..k end}) +return M -- cgit v1.2.3