[locale] gettext functions: std::locale default argument not working

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[locale] gettext functions: std::locale default argument not working

Boost - Users mailing list
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 mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users