
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_1mess... 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