Commit Graph

248 Commits

Author SHA1 Message Date
John Ralls
c56bd35ce0 GrampsLocale: Correct setting GrampsLocale.languages
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: r21326
2013-02-09 18:59:20 +00:00
Tim G L Lyons
404c2f154b date.get_start_date has no attribute 'is_valid'
svn: r21292
2013-02-04 18:12:09 +00:00
John Ralls
06ce88cef4 GrampsLocale: Allow for importing older PyICU packages
svn: r21287
2013-02-04 01:42:51 +00:00
Peter Landgren
b225c71885 Fixed a typo LC_MONETARY -> 'LC_MONETARY'.
svn: r21283
2013-02-03 15:30:40 +00:00
John Ralls
a8bbb91d25 GrampsLocale: Fix some oversights in creation of second GrampsLocale
svn: r21282
2013-02-03 02:05:14 +00:00
John Ralls
5f8575241b grampslocale: Pretty up the log messages.
svn: r21281
2013-02-03 02:05:06 +00:00
John Ralls
f8a4ad6cb1 grampslocale.py: Protect against C.UTF-8 not being an installed locale on Linux.
svn: r21280
2013-02-03 01:23:05 +00:00
John Ralls
fd61b21a2d GrampsLocale: Replace 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: r21275
2013-02-01 22:49:14 +00:00
John Ralls
f238be30ef GrampsLocale: Introduce GrampsLocale attributes currency, calendar, and collate
svn: r21274
2013-02-01 22:48:57 +00:00
John Ralls
0c2263a327 GrampsLocale: Make maclocale.mac_setup_localization() set glocale attributes directly
svn: r21273
2013-02-01 22:48:51 +00:00
John Ralls
ad61ad70a5 GrampsLocale: Extract function __init_from_environment
svn: r21272
2013-02-01 22:48:41 +00:00
Tim G L Lyons
e2f4e39f7e find_file and find_folder do not return null string if the file or folder resp. do not exist (coding typo)
svn: r21267
2013-02-01 17:35:37 +00:00
John Ralls
72051dd488 GrampsLocale: Replace use of get_language_string 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: r21236
2013-01-27 21:10:17 +00:00
John Ralls
091782abf7 GrampsLocale: Use module-specific logger for grampslocale.py
Fixes double-logging problem reported by Tim Lyons.

svn: r21235
2013-01-27 21:10:09 +00:00
Doug Blank
23c9ce10b9 6364: dead people are shown as alive in narrated web page export
svn: r21219
2013-01-25 12:53:50 +00:00
John Ralls
7fb81b5c21 GrampsLocale: Fix call to member function.
svn: r21186
2013-01-21 15:14:17 +00:00
John Ralls
5e505f2c21 GrampsLocale: Restructure so that multiple GrampsLocale objects can safely be created for different locales
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: r21182
2013-01-21 01:27:29 +00:00
Tim G L Lyons
c91b53f0c4 0005088: Narrated Web Site Report sort order different Windows vs Linux. Initial commit to resolve the issues on Linux and Mac (provided in both cases PyICU is installed). Windows still needs to be tested, and there may still be some other uses of strxfrm (or strcoll) that need to be fixed.
svn: r21175
2013-01-20 15:11:06 +00:00
John Ralls
e920cbfac1 GrampsLocale: Get the language code from the global translation
Instead of probing locale.getlocale() and environment variables

svn: r21151
2013-01-17 19:48:24 +00:00
John Ralls
df46941e73 GrampsLocale: Use the codeset from the singleton translation
Instead of locale.getlocale() or locale.nl_langinfo

svn: r21150
2013-01-17 19:48:14 +00:00
John Ralls
09a875db11 GrampsLocale: Simplify the file-finding functions
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: r21148
2013-01-17 19:47:59 +00:00
John Ralls
cc4ec85b4d [Bug 6364] Fix file-opening failures due to unicode content.
svn: r21147
2013-01-17 19:47:44 +00:00
John Ralls
a58ef2b73f GrampsLocale: Replace calls to sys.getfilesystemencoding
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: r21146
2013-01-17 19:47:36 +00:00
John Ralls
ef7e047b4b [Bug 6222]: Get the addons language list from the primary
GrampsLocale instance.

svn: r21145
2013-01-17 19:47:21 +00:00
John Ralls
ef6892abbd GrampsLocale: Remove ggettext
svn: r21144
2013-01-17 19:46:55 +00:00
John Ralls
d3c2a8a490 Localization: Re-implement localization as a class, GrampsLocale
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: r21143
2013-01-17 19:42:11 +00:00
John Ralls
eecf57a0f6 Rename trans.py and mactrans.py to grampslocale.py and 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: r21142
2013-01-17 19:41:58 +00:00
Benny Malengier
926dbca98f 6329: Crazy citations after XML import of bacuo from Gramps 3.4.3
svn: r21123
2013-01-15 08:42:50 +00:00
Benny Malengier
1fe37cae6f fix error of revision 20699
svn: r21021
2013-01-07 09:17:16 +00:00
John Ralls
f14b5d8944 Fix up mactrans.py for python3
svn: r21010
2013-01-06 20:40:46 +00:00
Doug Blank
98958cb164 6067: Narrative Web reports people as Living even when they have a deceased event (but without a date because it is unknown)
svn: r21008
2013-01-06 02:31:28 +00:00
Nick Hall
57dc4c0118 Convert filenames to lower case
svn: r20985
2013-01-04 22:29:44 +00:00
Doug Blank
d6214118e2 6274: Tried to use Charts View and receive 'NameError: global name 'gen' is not defined'
svn: r20946
2013-01-03 05:41:01 +00:00
Doug Blank
7242f9d662 4719: Narweb Privacy issue, probably_alive uses spouse birth/death directly
svn: r20935
2013-01-02 03:01:42 +00:00
Doug Blank
91173ba2a8 Bumped trunk to 4.1, updated plugins, requires setup.py build rather than copy of const.py.in, show svn number in version number
svn: r20919
2012-12-31 22:51:11 +00:00
Nick Hall
43b6e62d2d Update translation code to use LOCALE_DIR
svn: r20876
2012-12-29 17:52:17 +00:00
Benny Malengier
0e01b5919e 6231: WARNING: configmanager.py: line 309: WARNING: ignoring key with wrong type
'behavior.autoload'


svn: r20789
2012-12-18 11:50:02 +00:00
Paul Franklin
1c22612f5d for Python files in the "gramps" (only) sub-tree:
1) add SVN svn:keywords "Id" property if it didn't have it
2) add SVN svn:mime-type "text/plain" property if it didn't have it
3) add SVN "Id" line to the file if it had none
4) reformat SVN "Id" line in the file if it needed it


svn: r20708
2012-11-27 04:31:14 +00:00
Benny Malengier
a1591a964c python 3 support, avoid use of unicode
svn: r20699
2012-11-23 17:22:00 +00:00
Jérôme Rapinat
bd28665977 try to update warning log according to new translation builder
svn: r20694
2012-11-22 17:45:36 +00:00
Paul Franklin
28d939cda7 6155: Error when running Detailed Descendant Report
svn: r20674
2012-11-17 21:28:14 +00:00
Benny Malengier
1cad822978 2620: GEPS 031: Python 3 support - 3.2
* fix introduced errors: write of reference in db, check in dbloader on string type
 * working import of xml file in python 3


svn: r20659
2012-11-15 10:28:19 +00:00
Benny Malengier
8b39b80dc8 2620: GEPS 031: Python 3 support - 3.2
round 2 for python 3 support:
* no more cmp, also not in sort and sorted
* bsddb needs bytestring keys
* gtk does not need utf-8 encoded anymore...


svn: r20658
2012-11-15 08:08:31 +00:00
Benny Malengier
bb5fc7cb7c 2620: GEPS 031: Python 3 support - 3.2
This does patch updates Gramps to the 3.2 syntax, it does not yet mean Gramps works with python 3.2
Expect next day commits to fix further issues, but this is the main 2to3 tool created patch changed
where needed to have python 2.7 work. 
Specific issues might be:
  1. next has been changed, must be checked
  2. new division as on the wiki page listed is to do
  3. ...


svn: r20634
2012-11-07 17:53:14 +00:00
Benny Malengier
91e6df28c1 GEPS 026: Replace 'make' for Gramps build
Remove all makefile in gramps code
Still present: make for doc creation and make for webapp


svn: r20499
2012-10-03 08:46:04 +00:00
Benny Malengier
9832e6712e Coding Guidelines: relative import of gen in gen submodule
svn: r20479
2012-10-02 08:28:08 +00:00
Benny Malengier
47a612c36a Code guideline: move to relative import within gen module
svn: r20478
2012-10-01 20:53:08 +00:00
Benny Malengier
326d604365 GEPS 026: Replace 'make' for Gramps build
If we want to use Gramps from the code directory, src should be called gramps to allow import


svn: r20466
2012-09-30 11:55:52 +00:00