Boost logo

Boost :

Subject: [boost] [Boost.Locale] Questions (was New Release)]
From: Alexander Lamaison (awl03_at_[hidden])
Date: 2010-03-23 11:28:32

Artyom wrote:
>> I sent this to the list via Gmane but
>> its stuck in the moderation queue so
>> I'm sending it to you personally:
> You probably should register to boost mailing list directly?
I did that too but it said because it was my first post to the list (I
usually hang out in boost.user not .devel) it had to be moderated. It's
been days now :(
>> I compile my code with MSVC8:
> I hadn't tested this library with MSVC8 (2005), I would be glad if
> you can build it and run unit-test (if you using nmake then
> run "nmake test") If you are working with solution there should be
> an option.
I did this and everything passed. Though when I run examples on the
command line the output includes much that isn't readable. Is this
because the terminal doesn't handle the codepages correctly?
> So I would know that MSVC 2005 is fine as well. Once you run the
> test, can you please send me: your os version and ICU Version so I can
> update the tested platforms list?
I'm using Vista 32-bit with ICU 4.2.1

I've just started internationalising my project (Swish using Boost.Locale so I may have many
questions for you as I go along. I hope this will helps Boost.Locale as
much as it helps me.

Firstly, I'm trying to decide which format() to use: boost::format or
boost::locale::format. If I don't use currencies or dates and always
use the global locale, are there any advantages to
boost::locale::format? The tutorial says of boost::format "It knows
nothing about new Boost.Locale manipulators". I don't understand what
this means. Which new manipulators?

I notice that boost::locale::format has a constructor that takes a
message as an argument and then does something internally that depends
on the value of _translate but I don't understand why. boost::format
can be used like this:
    boost::format(translate("Id string %1%")) % arg
so what does the extra boost::locale::format constructor allow that this

Also I make gettext enforce correct translation of format strings by
passing --boost to xgettext. This reports an error if the format
tokens, %1% etc., don't match in the original and translated strings.
Changing these to {1} etc. in boost::locale::format means this no longer
works. What was the tecnical motivation for this change?

My second question relates to the directory structure for the .mo files
and applies to gettext as much as to boost::locale (I'm new to gettext
too). Why do they expect to find the files at
lang_ctry/LC_MESSAGES/ This makes sense when translations for
many projects are stored in a common location such as
|/usr/share/locale/ but on Windows this wouldn't be likely. I plan to
store my translation in my program's installation directory and wish I
could just put them in a flat directory: translations/
translations/ etc. Is it possible to make the lookup fallback
to this scheme or even make the scheme customisable?

Many thanks for this excellent library.


Boost list run by bdawes at, gregod at, cpdaniel at, john at