[Boost-bugs] [Boost C++ Libraries] #11040: Boost.Locale "Messages Formatting (Translation)" documentation has critical sample code that is missing a call to "format"

Subject: [Boost-bugs] [Boost C++ Libraries] #11040: Boost.Locale "Messages Formatting (Translation)" documentation has critical sample code that is missing a call to "format"
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-02-17 02:25:01


#11040: Boost.Locale "Messages Formatting (Translation)" documentation has critical
sample code that is missing a call to "format"
------------------------------+---------------------
 Reporter: daniel347x@… | Owner: artyom
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: locale
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: locale format |
------------------------------+---------------------
 In the "Extracting messages from code" section of the "Messages Formatting
 (Translation)" section of the Boost.Locale documentation
 (http://www.boost.org/doc/libs/1_56_0/libs/locale/doc/html/messages_formatting.html#extracting_messages_from_code)
 is the following sample code:

 {{{
    cout << translate("Listing of catalog {1}:") % file_name << endl;
    cout << translate("Catalog {1} contains 1 file","Catalog {1} contains
 {2,num} files",files_no) % file_name % files_no << endl;
 }}}

 I think that a call to 'format' should wrap each 'translate' call, so that
 the correct sample code would be the following:

 {{{
    cout << format(translate("Listing of catalog {1}:")) % file_name <<
 endl;
    cout << format(translate("Catalog {1} contains 1 file","Catalog {1}
 contains {2,num} files",files_no)) % file_name % files_no << endl;
 }}}

 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.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11040>
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:17 UTC