
----- Original Message -----
From: Jookia <166291@gmail.com> To: boost@lists.boost.org Cc: Sent: Tuesday, August 21, 2012 8:55 PM Subject: Re: [boost] [locale] Custom Gettext paths.
On 21/08/12 18:52, Artyom Beilis wrote:
Hello,
First of all good job!
This this is something that was requested for some time.
Awesome and thanks.
If this was requested previously, would there be a trac issue?
I remember some were talking about it, but I assume it was not important enough to open a ticket.
However I have two points: 1. I'd rather use a single format and not multiple, such that I would use
std::string generator::path_format() const void generator::path_format(std::string const &); void generator::set_default_path_format();
Because it makes a complex search that is even today complex even more complex.
This is something that I'm concerned about. If there's one path format, an application may have to do something 'interesting' if it has two paths with different formats. I'm all ears on how to fix this scenario:
I have an application that is standalone that can run in /home, that uses the compact path. But it's also able to be installed system wide, which means it'd be best for it to use the /usr/share/locale thing. How would
Of course, a single path format would solve a lot of problems I've mentioned so I'm happy to do that. I'm just a little concerned about that scenario.
I see, multiple paths are ok as well.
2. I'd rather extend the
template<typename CharType> message_format<CharType> *create_messages_facet(messages_info const &info);
With an additional overload
template<typename CharType> message_format<CharType> *create_messages_facet(messages_info const &info,std::string const &path_format);
This way it would not affect Boost.Locale's ABI (changing sizeof of messages_info)
Ah, I'm new to ABIs and whatnot so I wasn't really paying attention. I'll get that done, but I'd also like to know about my concerns with the
first issue, as this implies a single path.
Than pass std::vector<std::string> const &path_formats instead of a single string.
3. When you use format
(format(path_formats[k]) % search_paths[i] % paths[j] % lc_cat % domain).str()
It is better to call
(format(path_formats[k]) % search_paths[i] % paths[j] % lc_cat % domain).str(std::locale::classic())
To prevent some problems with global locale or other stuff.
Alrighty.
Thanks for your time, Jookia.
Best and thanks for your effort! Artyom Beilis -------------- CppCMS - C++ Web Framework: http://cppcms.com/ CppDB - C++ SQL Connectivity: http://cppcms.com/sql/cppdb/