Boost C++ Libraries: Ticket #7727: Gettext information retriever https://svn.boost.org/trac10/ticket/7727 <p> So I figured it'd be nice if we were able to see things about which Gettext catalog is loaded. So I worked up this patch. </p> <p> The unit test kind of explains how to use it, it's much like locale::info but it requires an object to be created (and deleted by the user, which is a bit shoddy) </p> <p> If the patch is any good I'm willing to work up some documentation and examples for it. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7727 Trac 1.4.3 166291@… Thu, 22 Nov 2012 18:44:34 GMT attachment set https://svn.boost.org/trac10/ticket/7727 https://svn.boost.org/trac10/ticket/7727 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">gettext_info.patch</span> </li> </ul> <p> Patch v1 </p> Ticket 166291@… Mon, 07 Jan 2013 12:04:58 GMT attachment set https://svn.boost.org/trac10/ticket/7727 https://svn.boost.org/trac10/ticket/7727 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost-gettext_info.patch</span> </li> </ul> Ticket 166291@… Mon, 07 Jan 2013 12:08:04 GMT <link>https://svn.boost.org/trac10/ticket/7727#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7727#comment:1</guid> <description> <p> So this patch uses the catalog_info patch (gettext_paths.patch in <a class="assigned ticket" href="https://svn.boost.org/trac10/ticket/7266" title="#7266: Patches: Gettext path formats. (assigned)">#7266</a>) to fill up a catalog_info struct and return it based on what the catalog loads. </p> <p> 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. </p> <p> Here's a snippet of how I use it with a small wrapper I've been using: </p> <pre class="wiki"> blg::catalog_info gettextInfo = blg::get_catalog_info&lt;char&gt;(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]; } </pre> </description> <category>Ticket</category> </item> </channel> </rss>