From 207e513acf22f81998b28a687f32c500a079f369 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Wed, 5 Sep 2012 22:00:41 -0400 Subject: Attempt to auto-detect locale using 'LANG' environment variable; core/locale.lua --- core/locale.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core') 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 -- cgit v1.2.3