diff options
author | 2020-03-10 11:19:00 -0400 | |
---|---|---|
committer | 2020-03-10 11:19:00 -0400 | |
commit | ff6fbbc3227b49fc5407ddbcc7a3f7dac6993482 (patch) | |
tree | cd83d4e5b9919c4987272397a70146e182148a87 /core/locale.lua | |
parent | 610bfcc47679ec6b9abb15b6a1cf6087be904369 (diff) | |
download | textadept-ff6fbbc3227b49fc5407ddbcc7a3f7dac6993482.tar.gz textadept-ff6fbbc3227b49fc5407ddbcc7a3f7dac6993482.zip |
Core code cleanup, reformat, refactoring, and bugfixes.
`events.FILE_CHANGED` was not emitting a filename.
Added tests for key commands, keychains, and key modes.
Diffstat (limited to 'core/locale.lua')
-rw-r--r-- | core/locale.lua | 10 |
1 files changed, 6 insertions, 4 deletions
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 |