aboutsummaryrefslogtreecommitdiffhomepage
path: root/core/locale.lua
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-11 09:34:17 -0400
committerGravatar mitchell <70453897+orbitalquark@users.noreply.github.com>2021-04-11 09:34:17 -0400
commitde3a745e1af2e441de868c2aa4849102d376acb5 (patch)
treec2d7767600dc519b2613ddecaf7e53fb5e8867a2 /core/locale.lua
parent03fab17277fee7387fd93a9c2774b1ebf3f80fe4 (diff)
Initial pass reformatting all code.
Use clang-format, LuaFormatter, and 100 character limit on lines.
Diffstat (limited to 'core/locale.lua')
-rw-r--r--core/locale.lua17
1 files changed, 6 insertions, 11 deletions
diff --git a/core/locale.lua b/core/locale.lua
index 7e115854..57fbff27 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -5,24 +5,20 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Map of all messages used by Textadept to their localized form.
--- If the table does not contain the localized version of a given message, it
--- returns a string that starts with "No Localization:" via a metamethod.
--- Note: the terminal version ignores any "_" mnemonics the GUI version would
--- use.
+-- If the table does not contain the localized version of a given message, it returns a string
+-- that starts with "No Localization:" via a metamethod.
+-- Note: the terminal version ignores any "_" mnemonics the GUI version would use.
module('_L')]]
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(string.format('%s/core/locales/locale.%s.conf', _HOME, lang))
- 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
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
- -- comment.
+ -- Any line that starts with a non-word character except '[' is considered a comment.
if not line:find('^%s*[%w_%[]') then goto continue end
local id, str = line:match('^(.-)%s*=%s*(.-)\r?$')
if id and str and assert(not M[id], 'duplicate locale key "%s"', id) then
@@ -32,5 +28,4 @@ for line in f:lines() do
end
f:close()
-return setmetatable(
- M, {__index = function(_, k) return 'No Localization:' .. k end})
+return setmetatable(M, {__index = function(_, k) return 'No Localization:' .. k end})