Signed-off-by: Alexander A. Klimov <alexander.klimov@netways.de>
with the following changes:
Don't define LC_MESSAGES globally as only 2 methods would need that
Use LC_ALL rather than 6
fixes#8912
Translator::getPreferredLocaleCode($header) can now be used with the
HTTP "Accept-Language" header to return the best matching locale using
the user's preferations reported by the browser and our available locale
stack. Additionally Translator::getLocale and Translator::getLanguage were
replaced by Translator::splitLocaleCode to provide a more flexible
implemenation in order to identify specific parts of a particular locale or
the current one.
refs #6074
Reverted former redundant patch, got confused by legacy web modules
been translated with earlier versions. They had a different directory
structure and registered erraneous domain directories.
This patch fixes the list, does an additional safety check (dirname must
end with .UTF-8) and strips .UTF-8 from the locale name. Former regex
matched always and therefore blacklisted every translation.
List was showing useless stuff such as LC_MESSAGES and no language
but the default one. We should have a look whether LC_MESSAGES is
really needed, it looks so ugly.
One can now use $this->translate(msg) in a view or controller without the
need to pass the module domain (web&cli). Forms still need to be built
with _t(msg) and _mt(dom, msg).
refs #5533