Skip to content

pipewire: don't setlocale from pw_init, let parent app set it

P V requested to merge pvir/pipewire:nolocale into master

Library code generally shouldn't modify global state, so pw_init() should not result to changing the C locale.

Instead, set the C locale in main() for tools and daemons.

We'll still setlocale for LC_MESSAGES, to get translated UI elements in wireplumber. This workaround should be removed eventually...


See #2223 (closed) --- also resetting the locale based on environment variables in pw_init may be problem under some circumstances (pw_init in a thread of some main application, or main app wanting to run in C locale only), so it's probably better to not do it at all in pw_init.

Currently wireplumber/p-m-s don't call setlocale() in their main(), so I left LC_MESSAGES in here. Can be removed after it's fixed in a wireplumber release...

Merge request reports