diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-07-28 12:09:14 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-07-28 14:23:11 +0800 |
commit | 2a44f3c936f948d6fedc4729dbf2216da558e490 (patch) | |
tree | 6b225bea0cf0969c5fa1767c19aa7fe7f1d7d499 /discover/pb-discover.c | |
parent | 9330aba60a05a8d9889dab42bc92b9ebbc55941b (diff) | |
download | talos-petitboot-2a44f3c936f948d6fedc4729dbf2216da558e490.tar.gz talos-petitboot-2a44f3c936f948d6fedc4729dbf2216da558e490.zip |
discover: Add setlocale calls in discover server
We want the discover server to respect the configured language, so we'll
need to add appropriate setlocale() calls. We use the config->lang
setting to use any previously-saved language.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/pb-discover.c')
-rw-r--r-- | discover/pb-discover.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/discover/pb-discover.c b/discover/pb-discover.c index f876a3d..81c582d 100644 --- a/discover/pb-discover.c +++ b/discover/pb-discover.c @@ -13,6 +13,7 @@ #include <log/log.h> #include <process/process.h> #include <talloc/talloc.h> +#include <i18n/i18n.h> #include "discover-server.h" #include "device-handler.h" @@ -127,6 +128,10 @@ int main(int argc, char *argv[]) struct opts opts; FILE *log; + setlocale(LC_ALL, ""); + bindtextdomain(PACKAGE, LOCALEDIR); + textdomain(PACKAGE); + if (opts_parse(&opts, argc, argv)) { print_usage(); return EXIT_FAILURE; @@ -177,6 +182,9 @@ int main(int argc, char *argv[]) if (opts.no_autoboot == opt_yes) config_set_autoboot(false); + if (config_get()->lang) + setlocale(LC_ALL, config_get()->lang); + system_info_init(server); handler = device_handler_init(server, waitset, opts.dry_run == opt_yes); |