Re: [Boost-bugs] [Boost C++ Libraries] #7727: Gettext information retriever

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7727: Gettext information retriever
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-01-07 12:08:05


#7727: Gettext information retriever
-------------------------------+--------------------------------------------
  Reporter: 166291@… | Owner: artyom
      Type: Feature Requests | Status: new
 Milestone: To Be Determined | Component: locale
   Version: | Severity: Not Applicable
Resolution: | Keywords:
-------------------------------+--------------------------------------------

Comment (by 166291@…):

 So this patch uses the catalog_info patch (gettext_paths.patch in #7266)
 to fill up a catalog_info struct and return it based on what the catalog
 loads.

 Some limitations is that it doesn't return the path to the catalog or
 anything specific, but it can be used to get in what it gets out.

 Here's a snippet of how I use it with a small wrapper I've been using:

 {{{
   blg::catalog_info gettextInfo = blg::get_catalog_info<char>(loc);

   if(!gettextInfo.domains().empty())
   {
     // There should be a catalog for each domain, and we only allow one
 domain.
     SOFT_ASSERT(gettextInfo.domains().size() == 1)
     {
       // Do nothing since we'll be indexing the first anyway.
     }

     myInfo.translation = gettextInfo.language();
     myInfo.domain = gettextInfo.domains()[0].name();
     myInfo.path = gettextInfo.paths()[0];
     myInfo.format = gettextInfo.path_formats()[0];
   }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7727#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:11 UTC