From ff6fbbc3227b49fc5407ddbcc7a3f7dac6993482 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Tue, 10 Mar 2020 11:19:00 -0400 Subject: Core code cleanup, reformat, refactoring, and bugfixes. `events.FILE_CHANGED` was not emitting a filename. Added tests for key commands, keychains, and key modes. --- core/locale.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'core/locale.lua') diff --git a/core/locale.lua b/core/locale.lua index 45a0f855..f6bc32cb 100644 --- a/core/locale.lua +++ b/core/locale.lua @@ -11,12 +11,14 @@ local M = {} -- use. module('_L')]] -local f = io.open(_USERHOME..'/locale.conf', 'rb') +local f = io.open(_USERHOME .. '/locale.conf', 'rb') if not f then local lang = (os.getenv('LANG') or ''):match('^[^_.@]+') -- TODO: LC_MESSAGES? - if lang then f = io.open(_HOME..'/core/locales/locale.'..lang..'.conf') end + if lang then + f = io.open(string.format('%s/core/locales/locale.%s.conf', _HOME, lang)) + end end -if not f then f = io.open(_HOME..'/core/locale.conf', 'rb') end +if not f then f = io.open(_HOME .. '/core/locale.conf', 'rb') end assert(f, '"core/locale.conf" not found') for line in f:lines() do -- Any line that starts with a non-word character except '[' is considered a @@ -30,5 +32,5 @@ for line in f:lines() do end f:close() -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