Boost logo

Boost :

Subject: Re: [boost] [Locale] Preview of 3rd version
From: Klaim (mjklaim_at_[hidden])
Date: 2010-09-13 05:19:01


But as small note, you will have to install dictionaries manually
> and not via generator interface.
>
> But rather via this interface:
>
> <
> http://cppcms.sourceforge.net/boost_locale/html/gnu__gettext_8hpp-source.html
> >
>
> I mean you'll need to initialize the messages info structure and provide
> a callback (that would be member of messages_info)
>
> boost::function<bool(std::string file_name,std::vector<char> &file)>
> custom_fs_reader;
>
> And then install the catalogs using:
>
> std::locale new_locale =
> std::locale(generated,create_messages_facet<char>(my_message_info));
>
> I don't want to add this into boost::locale::generator, as I don't think
> this
> is generally correct thing to do (as it would require to implement much
> more
> complex path).
>
>
I'll try this solution and give feedback later then.

>
> > So if "domain" are module names, how to differenciate two sentences that
> are
> > the same in a language with two different contextes, but are not the
> same in
> > an other language with the same different contextes?
>
> I don't really understand the question. But maybe this would make it clear:
>
> When you translate a message it is uniquely defined by 4 parameters:
>
> - locale (for example "ru_RU")
> - domain (for example "excel")
> - context(for example "File Menu")
> - id(for example "Open...")
>
> So:
>
> cout << translate("File Menu","Open...")
> << translate("Internet Connection","Open...")
> << translate("Open...")
> << translate("File Menu","Close")
> << translate("Internet Connection","Close")
> << translate("Close")
>
> Require 6 different entries in the dictionary
>

In this example you're only using context parameters (where there is two
parametters) right?
I think I mixed up context parameters and domain parameter then, yes.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk