]> git.ozlabs.org Git - petitboot/blobdiff - discover/pb-discover.c
discover/udev: Don't call udev_set_log_fn()
[petitboot] / discover / pb-discover.c
index e895f47653945fcef31fc888e2473d632cc21000..fd370685653f979419943ee03db5c3b64f311f5f 100644 (file)
@@ -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;
@@ -153,7 +158,7 @@ int main(int argc, char *argv[])
        }
        pb_log_init(log);
 
-       if (opts.verbose)
+       if (opts.verbose == opt_yes)
                pb_log_set_debug(true);
 
        pb_log("--- pb-discover ---\n");
@@ -177,6 +182,12 @@ 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);
+
+       if (config_get()->debug)
+               pb_log_set_debug(true);
+
        system_info_init(server);
 
        handler = device_handler_init(server, waitset, opts.dry_run == opt_yes);