diff options
author | 2012-09-05 22:00:41 -0400 | |
---|---|---|
committer | 2012-09-05 22:00:41 -0400 | |
commit | 207e513acf22f81998b28a687f32c500a079f369 (patch) | |
tree | 4963d621c292ed532667f184e024b90d58248398 /core | |
parent | 1c8b3e019d6d6aeac1048581c1b02f3c7450b5b8 (diff) | |
download | textadept-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.lua | 4 |
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 |