Re: [Boost-users] [locale] Quick questions

I made some kind of limited test case: http://www.mediafire.com/?g5axcnch8q20ixo

Ok I see thanks... The answer is following. GCC implicitly included libintl that defines gettext(char const *)... So even when you call using loc::gettext it still prefers the ::gettext. This is unfortunate... Solutions for you: 1. Always use prefix: loc::gettext("foo") 2. Use using loc::gettext withing the body of the function you use (i.e. in this case withing main) 3. Use translate - it has little bit different semantics but in general its result automatically casts to std::string std::cout << translate("foo") << std::endl; 4. Use #define _(x) boost::locale::gettext(x) This is BTW the most popular solution all over the community of gettext users. 5. Ugly hack #define gettext(x) boost::locale::gettext(x) I'll update the documentation. Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.sf.net/ CppDB - C++ SQL Connectivity: http://cppcms.sf.net/sql/cppdb/ ----- Original Message -----
From: Jookia <166291@gmail.com> To: Boost-users@lists.boost.org Cc: Sent: Tuesday, November 8, 2011 11:45 AM Subject: Re: [Boost-users] [locale] Quick questions
I made some kind of limited test case: http://www.mediafire.com/?g5axcnch8q20ixo _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Artyom Beilis
-
Jookia