Boost logo

Boost Users :

Subject: [Boost-users] [locale] gettext functions: std::locale default argument not working
From: Jeanette C. (julien_at_[hidden])
Date: 2019-04-29 11:08:26

Hey hey,
it appears that the std::locale const &loc=std::locale() argument of the
gettext functions for direct message translation doesn't properly pick up the
program's global locale.

Assume that messages have been extracted and translated. Consider the code
snippet below:
boost::locale::generator gen;
std::locale loc = gen("de_DE");
// std::locale loc2; // will also work as argument to gettext
string s = boost::locale::gettext("Hello world"); // output "Hello world"
string t = boost::locale::gettext("Hello world",loc); // output "Hallo Welt"

I am on boost 1.69.0-2, Arch Linux package, gcc 8.2.1, libstdc++ 6.0.25 (taken
from the dynamic library filename), this is distributed with the GCC package.

I'd appreciate any hint to solve this, since it would mean a lot of code
editing otherwise.

Best wishes and thanks,


  * Website: - for summer is a state of sound
  * SoundCloud:
  * Youtube:
  * GitHub:
  * Twitter:
Cinderella's got to go <3
(Britney Spears)

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at