Merge pull request #352 from webknjaz/bugfixes/C-locale-corner-case

Treat C-locale in the weather widget as English
This commit is contained in:
streetturtle 2022-07-16 20:41:39 -04:00 committed by GitHub
commit c0fdb16652
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,10 @@ local WIDGET_DIR = HOME_DIR .. '/.config/awesome/awesome-wm-widgets/weather-widg
local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]] local GET_FORECAST_CMD = [[bash -c "curl -s --show-error -X GET '%s'"]]
local SYS_LANG = os.getenv("LANG"):sub(1, 2) local SYS_LANG = os.getenv("LANG"):sub(1, 2)
if SYS_LANG == "C" or SYS_LANG == "C." then
-- C-locale is a common fallback for simple English
SYS_LANG = "en"
end
-- default language is ENglish -- default language is ENglish
local LANG = gears.filesystem.file_readable(WIDGET_DIR .. "/" .. "locale/" .. local LANG = gears.filesystem.file_readable(WIDGET_DIR .. "/" .. "locale/" ..
SYS_LANG .. ".lua") and SYS_LANG or "en" SYS_LANG .. ".lua") and SYS_LANG or "en"