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::global(loc);
// 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,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * SoundCloud: https://soundcloud.com/jeanette_c
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * GitHub: https://github.com/jeanette-c
  * Twitter: https://twitter.com/jeanette_c_s
Cinderella's got to go <3
(Britney Spears)

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net