diff options
Diffstat (limited to 'Master/texmf/scripts/texdoc/config.tlu')
-rw-r--r-- | Master/texmf/scripts/texdoc/config.tlu | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu index a83b7855308..fd37ba66be7 100644 --- a/Master/texmf/scripts/texdoc/config.tlu +++ b/Master/texmf/scripts/texdoc/config.tlu @@ -122,6 +122,8 @@ function context_to_string(context) return 'from command line option "'..context.name..'"' elseif context.src == 'env' then return 'from environment variable "'..context.name..'"' + elseif context.src == 'loc' then + return 'from operating system locale' elseif context.src == 'file' then return 'in file "'..context.file..'" on line '..context.line elseif context.src == 'def' then @@ -373,6 +375,19 @@ end end -- scope of config_files +---------------------- config from locale settings ------------------------- + +function setup_config_from_locale() + local current = os.setlocale(nil, "all") + os.setlocale("", "all") + local native = os.setlocale(nil, "time") + os.setlocale(current, "all") + local lang = string.match(native, "^[a-z][a-z]") + if lang then + set_config_element("lang", lang, {src="loc"}) + end +end + ---------------------- options from built-in defaults ---------------------- -- for default viewer on general Unix, we have a list; the following two @@ -551,6 +566,7 @@ function setup_config_and_alias(arg) setup_config_from_cl(arg) setup_config_from_env() setup_config_from_files() + setup_config_from_locale() setup_config_from_defaults() -- regex mode is deprecated if config.mode == 'regex' then |