Boost C++ Libraries: Ticket #11040: Boost.Locale "Messages Formatting (Translation)" documentation has critical sample code that is missing a call to "format" https://svn.boost.org/trac10/ticket/11040 <p> In the "Extracting messages from code" section of the "Messages Formatting (Translation)" section of the Boost.Locale documentation (<a href="http://www.boost.org/doc/libs/1_56_0/libs/locale/doc/html/messages_formatting.html#extracting_messages_from_code">http://www.boost.org/doc/libs/1_56_0/libs/locale/doc/html/messages_formatting.html#extracting_messages_from_code</a>) is the following sample code: </p> <pre class="wiki"> cout &lt;&lt; translate("Listing of catalog {1}:") % file_name &lt;&lt; endl; cout &lt;&lt; translate("Catalog {1} contains 1 file","Catalog {1} contains {2,num} files",files_no) % file_name % files_no &lt;&lt; endl; </pre><p> I think that a call to 'format' should wrap each 'translate' call, so that the correct sample code would be the following: </p> <pre class="wiki"> cout &lt;&lt; format(translate("Listing of catalog {1}:")) % file_name &lt;&lt; endl; cout &lt;&lt; format(translate("Catalog {1} contains 1 file","Catalog {1} contains {2,num} files",files_no)) % file_name % files_no &lt;&lt; endl; </pre><p> This bug in the documentation is especially frustrating because this is the very place people go to learn *how* to properly pass format strings to the library as a whole. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/11040 Trac 1.4.3 Artyom Beilis Thu, 13 Jul 2017 14:40:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/11040#comment:1 https://svn.boost.org/trac10/ticket/11040#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Already fixed </p> Ticket