Test only first 5 or first 2 characters of the language id against the
list of available translations.
Thanks to Tim Lyons for exposing the error.
svn: r21423
locale.strcoll, locale.strxfrm, and conv*_tosrtkey
With GrampsLocale.sort_key (for strxfrm and conv*_tosrtkey) and
GrampsLocale.strcoll.
If ICU is available will use the correct ICU::Collator for the locale,
otherwise falls back to locale.strxfrm -- for which it temporarily
changes the LC_COLLATE locale.
svn: r21416
... with GrampsLocale.get_language_dict
Permits sorting by localized language name.
Also hides the language code, which the user doesn't really care about.
Removes get_language_string from libtranslate.py, no longer needed.
svn: r21411
Only the first dependent upon the environment. All may be created with
parameters which override environment variables or OS settings. See the
GrampsLocale docstring for details.
svn: r21409
Making use of the fact that GrampsLocale now knows what
encoding to use, and noting that filesystems don't use
more than one encoding to write filenames in directories.
Also specify the encoding on some more files
svn: r21396
On MSWin and OSX, this call always returns the correct
value (utf-8 on OSX, 'mbcs' on MSWin), but on Linux the
return value is bizarrely dependent upon the environment.
Replace it with a GrampsLocale function which returns 'utf-8'
(the correct value for most Linux file systems) regardless of
the environment.
Also replace its use in print and write functions: It's the
encoding of paths in the filesystem, not of the files's content,
nor of the terminal's capabilities. The former is almost
always utf-8 as long as we write the file, the latter is
given by sys.stdout.encoding. Use the 'backslashreplace' error
handler to avoid exceptions when we need to output unicode
text to an ASCII terminal.
svn: r21394
GrampsLocale is effectively a singleton: An instance is created in
const.py and retrieved everywhere.
Translations are provided via Translations classes, which are derived
from GNUTranslations and NullTranslations to provide extra functions
like sgettext.
svn: r21391
maclocale.py
Reflecting discussion on gramps-devel about their affecting more than
just translations.
Provide for a master GrampsLocale instance to be retrieved from
const.py, set by grampsapp.
svn: r21390
This isn't a perfect fix because it requires that the ProGen file is
encoded with CP437, which is guaranteed only in Version 3.21 and later.
svn: r21354