aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2012-09-05 22:00:41 -0400
committermitchell <70453897+667e-11@users.noreply.github.com>2012-09-05 22:00:41 -0400
commit207e513acf22f81998b28a687f32c500a079f369 (patch)
tree4963d621c292ed532667f184e024b90d58248398 /core
parent1c8b3e019d6d6aeac1048581c1b02f3c7450b5b8 (diff)
downloadtextadept-207e513acf22f81998b28a687f32c500a079f369.tar.gz
textadept-207e513acf22f81998b28a687f32c500a079f369.zip
Attempt to auto-detect locale using 'LANG' environment variable; core/locale.lua
Diffstat (limited to 'core')
-rw-r--r--core/locale.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/locale.lua b/core/locale.lua
index 8c838ecc..449f4dee 100644
--- a/core/locale.lua
+++ b/core/locale.lua
@@ -16,6 +16,10 @@ local none = 'No Localization: '
function M._EXISTS(message) return M[message] ~= none..message end
local f = io.open(_USERHOME..'/locale.conf', 'rb')
+if not f then
+ local lang = (os.getenv('LANG') or ''):match('^[^_.@]+')
+ if lang then f = io.open(_HOME..'/core/locales/locale.'..lang..'.conf') end
+end
if not f then f = io.open(_HOME..'/core/locale.conf', 'rb') end
if not f then error('"core/locale.conf" not found.') end
for line in f:lines() do