diff --git a/src/daemon/pipewire.c b/src/daemon/pipewire.c index 743b92478..97569c0a8 100644 --- a/src/daemon/pipewire.c +++ b/src/daemon/pipewire.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -74,6 +75,7 @@ int main(int argc, char *argv[]) snprintf(path, sizeof(path), "%s.conf", argv[0]); config_name = basename(path); + setlocale(LC_ALL, ""); pw_init(&argc, &argv); while ((c = getopt_long(argc, argv, "hVc:v", long_options, NULL)) != -1) { diff --git a/src/pipewire/pipewire.c b/src/pipewire/pipewire.c index 943aedb94..2cb1d62b6 100644 --- a/src/pipewire/pipewire.c +++ b/src/pipewire/pipewire.c @@ -413,8 +413,9 @@ static const char *i18n_ntext(void *object, const char *msgid, const char *msgid static void init_i18n(struct support *support) { - /* Load locale from the environment. */ - setlocale(LC_ALL, ""); + /* XXX: we should remove this setlocale() call, after wireplumber + * XXX: starts setting the locale */ + setlocale(LC_MESSAGES, ""); bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); pw_set_domain(GETTEXT_PACKAGE); diff --git a/src/tools/pw-cat.c b/src/tools/pw-cat.c index 2a836efff..8ff8f797c 100644 --- a/src/tools/pw-cat.c +++ b/src/tools/pw-cat.c @@ -34,6 +34,7 @@ #include #include #include +#include #include @@ -1489,6 +1490,7 @@ int main(int argc, char *argv[]) int exit_code = EXIT_FAILURE, c, ret; enum pw_stream_flags flags = 0; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); flags |= PW_STREAM_FLAG_AUTOCONNECT; diff --git a/src/tools/pw-cli.c b/src/tools/pw-cli.c index af8bbca12..d19e66b86 100644 --- a/src/tools/pw-cli.c +++ b/src/tools/pw-cli.c @@ -35,6 +35,7 @@ #include #include #include +#include #if !defined(FNM_EXTMATCH) #define FNM_EXTMATCH 0 @@ -3076,6 +3077,7 @@ int main(int argc, char *argv[]) setlinebuf(stdout); + setlocale(LC_ALL, ""); pw_init(&argc, &argv); while ((c = getopt_long(argc, argv, "hVdr:", long_options, NULL)) != -1) { diff --git a/src/tools/pw-dot.c b/src/tools/pw-dot.c index 9149b1f71..687acc4f9 100644 --- a/src/tools/pw-dot.c +++ b/src/tools/pw-dot.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -1091,6 +1092,7 @@ int main(int argc, char *argv[]) }; int c; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); while ((c = getopt_long(argc, argv, "hVasdr:o:L9j:", long_options, NULL)) != -1) { diff --git a/src/tools/pw-dump.c b/src/tools/pw-dump.c index b60ef49f1..d9999786c 100644 --- a/src/tools/pw-dump.c +++ b/src/tools/pw-dump.c @@ -31,6 +31,7 @@ #include #include #include +#include #if !defined(FNM_EXTMATCH) #define FNM_EXTMATCH 0 @@ -1489,6 +1490,7 @@ int main(int argc, char *argv[]) }; int c; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); data.out = stdout; diff --git a/src/tools/pw-link.c b/src/tools/pw-link.c index 7ac55a251..232a364a8 100644 --- a/src/tools/pw-link.c +++ b/src/tools/pw-link.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #include @@ -599,6 +600,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); spa_list_init(&data.objects); diff --git a/src/tools/pw-loopback.c b/src/tools/pw-loopback.c index 00fafd093..4351e491b 100644 --- a/src/tools/pw-loopback.c +++ b/src/tools/pw-loopback.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -124,6 +125,7 @@ int main(int argc, char *argv[]) }; int c, res = -1; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); data.channels = DEFAULT_CHANNELS; diff --git a/src/tools/pw-metadata.c b/src/tools/pw-metadata.c index 983bc0b0f..768bd91ff 100644 --- a/src/tools/pw-metadata.c +++ b/src/tools/pw-metadata.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -198,6 +199,7 @@ int main(int argc, char *argv[]) setlinebuf(stdout); + setlocale(LC_ALL, ""); pw_init(&argc, &argv); data.opt_name = "default"; diff --git a/src/tools/pw-mididump.c b/src/tools/pw-mididump.c index 1c25dd8ff..b3e38fd09 100644 --- a/src/tools/pw-mididump.c +++ b/src/tools/pw-mididump.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,7 @@ int main(int argc, char *argv[]) { NULL, 0, NULL, 0} }; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); setlinebuf(stdout); diff --git a/src/tools/pw-mon.c b/src/tools/pw-mon.c index 7bd4f93b3..fe2060d83 100644 --- a/src/tools/pw-mon.c +++ b/src/tools/pw-mon.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -771,6 +772,7 @@ int main(int argc, char *argv[]) int c; bool colors = false; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); setlinebuf(stdout); diff --git a/src/tools/pw-profiler.c b/src/tools/pw-profiler.c index 5055204b4..f2000a986 100644 --- a/src/tools/pw-profiler.c +++ b/src/tools/pw-profiler.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -565,6 +566,7 @@ int main(int argc, char *argv[]) }; int c; + setlocale(LC_ALL, ""); pw_init(&argc, &argv); while ((c = getopt_long(argc, argv, "hVr:o:", long_options, NULL)) != -1) { diff --git a/src/tools/pw-reserve.c b/src/tools/pw-reserve.c index 9d6ca9e77..ac5bc422c 100644 --- a/src/tools/pw-reserve.c +++ b/src/tools/pw-reserve.c @@ -26,6 +26,7 @@ #include #include +#include #include @@ -121,6 +122,7 @@ int main(int argc, char *argv[]) setlinebuf(stdout); + setlocale(LC_ALL, ""); pw_init(&argc, &argv); while ((c = getopt_long(argc, argv, "hVn:a:p:m", long_options, NULL)) != -1) {