Boost logo

Boost :

Subject: Re: [boost] [Locale] Preview of 3rd version
From: Artyom (artyomtnk_at_[hidden])
Date: 2010-09-10 14:49:08


>
> Hi again,

Hello,

>
> I've finished reading the documentation and I just have a question : what if
> I want to inject manually the content of the translation/dictionary files in
> the generator instead of using the add path functions?

How do you exactly what to inject such translations? Boost.Locale
dictionaries are actually GNU Gettext compiled dictionaries.

What do you expect to provide to boost.locale interface.

Don't forget that it is not that simple - just give a dictionary, there
may be a set of fall-backs, for example if you have locale en_GB.UTF-8
but you don't have dictionary under /en_GB/LC_MESSAGES/foo.mo it
would try to load them from /en/LC_MESSAGES/foo.mo so I don't exactly
understand how do you expect to do this manually. Also it does not
load all dictionaries at once, it only loads thous required for
specific locale and not for all locales.

So basically you ask for for "file-system" plugin that allows you to see
anything
as file system... I don't think that is fully reasonable.

However if you want to have your own specific dictionaries in specific
format, all you need is to implement this facet:

http://cppcms.sourceforge.net/boost_locale/html/classboost_1_1locale_1_1message__format.html

And install it into generated locale.

All functions like translate, gettext, dgettext would work for you.

>
> Is there already a way to do this or do you recommand another way to manage
> this kind of case? Using some kind of real filesystem cache directory would
> work I guess but it's far from ideal.
>

Boost.Locale uses gettext model, and I don't think you will find any other
localization
system that does not requires loading some files from file system.

In your case, you may use temporary directory or just implement your own facet
that translates such messages.

Artyom

      


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