Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost 1.49 Locale Conversion failed
From: NtVisigoth (ntvisigoth_at_[hidden])
Date: 2012-07-10 10:17:30


2012/7/10 Artyom Beilis <artyomtnk_at_[hidden]>

> >________________________________
> > From: NtVisigoth <ntvisigoth_at_[hidden]>
> >To: boost-users_at_[hidden]
> >Sent: Tuesday, July 10, 2012 4:16 PM
> >Subject: Re: [Boost-users] Boost 1.49 Locale Conversion failed>I have :
> >
> >1) Russian language Filename :
> g:\project\proba\locale\ru_RU.UTF-8\LC_MESSAGES\messages.mo
> >2) Russian language locale name in ó++-source:
> >const std::string ruLanguage( "ru_RU" )
> >
> >
> >Is it correct?
>
> No
>
> Filename : g:\project\proba\locale\ru\LC_MESSAGES\messages.mo
> locale name in ó++-source:"ru_RU.UTF-8"
>
>
> >
> >
> >I dont understand How Boost Locale finds languages MO-file by their
> locale names in C++-source.
>
>
> See:
> http://www.boost.org/doc/libs/1_50_0/libs/locale/doc/html/messages_formatting.html
>
>
> Artyom Beilis
> --------------
> CppCMS - C++ Web Framework: http://cppcms.com/
> CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

I written another proba-project:

const std::string strLanguagesPath(
"g:\\source\\boost_locale\\languages\\" );
const std::string strLanguageFilename( "messages" );
const std::string strEnLanguage( "en_US.UTF-8" );
const std::string strRuLanguage( "ru_RU.UTF-8" );

int main( int argc, char * argv[] )
{
    using namespace std;
    using namespace boost::locale;

    int exitCode = EXIT_SUCCESS;
    try
    {
        generator gen;

        gen.add_messages_path( strLanguagesPath );
        gen.add_messages_domain( strLanguageFilename );

        cout << "Start Boost.Locale proba" << endl;
        std::locale en_loc = gen( strEnLanguage );
        wcout << TREX( L"hello world", en_loc ) << endl;

        std::locale ru_loc = gen( strRuLanguage );
        wcout << TREX( L"hello world", ru_loc ) << endl;
        cout << "Stop Boost.Locale proba" << endl;

File paths:
g:\source\boost_locale\languages\en\LC_MESSAGES\messages.mo
g:\source\boost_locale\languages\ru\LC_MESSAGES\messages.mo

and I see in STDOUT following:
Start Boost.Locale proba
Hello world Localized
Stop Boost.Locale proba
Press any key to continue . . .

There no any russian strings in STDOUT. Why?



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