Commit Graph

248 Commits

Author SHA1 Message Date
Nick Hall
e0608f0ec4 Remove python2 specific code 2015-03-14 19:29:16 +00:00
Nick Hall
3b5efdf7ae Remove imports from __future__ module 2015-03-14 16:10:36 +00:00
Paul Franklin
e80445127f 8423: Python3 needs new_subpixbuf not subpixbuf 2015-03-12 10:11:58 -07:00
Anthony Fok
deba8169bb 7573: implement both "traditional" and "simplfied" Chinese
* Translation revisions and fixes
   * Generate zh_TW.po and new zh_HK.po from zh_CN.po
     with the help of https://github.com/BYVoid/OpenCC
     and a small sed script (see f.r. 7573 for the script)
2015-02-26 14:19:01 -08:00
Doug Blank
d5b93c52be Moved stderr and stdin handlers to only be installed for cli application; allows Gramps libraries to be used in other REPLs 2015-02-17 16:36:52 -05:00
Doug Blank
c6a8af9eb6 Allow gramps to be used from source, without GRAMPS_RESOURCES env variable 2015-02-17 09:06:54 -05:00
Sveinn í Felli
240252292d Add partial (30%) Icelandic support 2015-02-13 15:29:58 +01:00
Nick Hall
28bc8ba590 7942: Implement place displayer 2015-01-23 19:09:55 +00:00
Josip
f4abd460ba 7851: translations don't show in many labels, buttons, and other elements, Windows only
Added fix for Python3
2015-01-03 20:25:12 +01:00
Doug Blank
cfb3b2cc84 Renamed test methods for proper automatic detection 2015-01-03 10:27:39 -05:00
kulath
c57f574cb8 Fix 0008234: part (2) Various problems with
docgen.TextDoc.add_media_object part (2) for master branch
2014-12-16 00:37:59 +00:00
John Ralls
a372922e02 8140: Gramps doesn't work under Turkish locale 2014-10-27 11:22:45 -07:00
Jérôme Rapinat
f02247b89c Serbian should be ready for Windows OS and LOCALE_NAMES mapping 2014-10-24 20:01:25 +02:00
Nick Hall
bdf38344ff 8015: Update location utilities to work with proxies 2014-09-26 16:39:16 +01:00
Malcom Lewis
86303f6116 Update FSF address to current location. 2014-08-08 19:39:45 -07:00
Paul Franklin
5e61827693 7573: slight tweak to (two zh) [9c8cf2] 2014-07-29 19:33:41 -07:00
Nick Hall
cc794110d1 7846: Prevent creation of a place cycle when merging 2014-07-14 22:53:01 +01:00
Nick Hall
8627429987 7846: Avoid infinite loop when place cycle encountered 2014-07-14 22:50:05 +01:00
John Ralls
65dbb1bd46 7851: translations don't show in many labels
Ensure python text domain gets the right encoding.
2014-06-23 20:16:56 -07:00
Nick Hall
52928e3a7c 7471: Fix python3 sort key errors
Ensure input to strxfrm is correct type.
Apply patch by Marc Hulsman.
2014-06-12 22:00:51 +01:00
Jérôme Rapinat
2e2fbe8fc6 7678: some fixes around gettext and messages handling 2014-06-07 12:51:30 +02:00
Nick Hall
6af8fe607f Match alternative names in HasPlace filter 2014-05-24 20:43:32 +01:00
Nick Hall
dce7a6d7f7 Fix bug in latitude/longitude conversion
Fixed unit test for python3.  int('+ 1') works in python2 but not python3.
Also corrected a unit test.
2014-05-15 19:06:30 +01:00
John Ralls
4327f6952b 7646: [Unit test] typo on 'gramps.gen.utils.file.py'
Replace the call with ensuring that dirname is unicode; since
TMP_DIR is guaranteed to be, os.path.join() willl return a unicode so
further conversion is unnecessary.
2014-04-30 07:33:00 -07:00
John Ralls
5f3f280ea0 Fix None type exception when there's no localedir. 2014-04-21 14:08:57 -07:00
John Ralls
f0ffd6e9b9 Remove gramps.gen.utils.file.fix_encoding()
Yet another overly complicated way to spell conv_to_unicode().
Note that unicode() and str.decode() are alternate spellings of the same function in Py2, and unicode();
note as well that this was used on strings coming from the GUI or the database, not the shell, so that
using glocale.encoding was also incorrect.
2014-04-20 17:05:53 -07:00
John Ralls
55610b6f0a Remove get_unicode_path_from_env_var(), get_unicode_path_from_file_chooser()
Two very cumbersome ways of saying conv_to_unicode().
2014-04-20 17:05:53 -07:00
John Ralls
10921cee29 GrampsLocale: Don't try to set self.localedir to _first.localedir if the latter path doesn't exist. 2014-04-20 17:05:52 -07:00
John Ralls
c1dcd6f59e 7258: Remove all instances of sys.getfilesystemencoding()
This function reliably returns a useful value only on MacOS X. On Linux it's incorrectly determined by the
locale's encoding and on Windows it always returns 'mbcs' which is correct only on FAT file systems.
2014-04-20 17:05:51 -07:00
John Ralls
efa3741579 7258: Ensure that resource paths are set correctly when they include Unicode characters. 2014-04-20 17:05:51 -07:00
Nick Hall
f6be31eb39 Remove subversion substitution variables 2014-04-15 14:10:18 +01:00
John Ralls
dc292037e4 7588: Can not start [in Chinese on OSX]
Force UTF-8 locale on Mac
2014-04-07 11:51:02 -07:00
John Ralls
f201deabbc Fix up some failing tests 2014-04-06 12:56:41 -07:00
John Ralls
71650917bf 7258: Replace some os.environ['foo'] lookups missed earlier. 2014-03-27 11:32:37 -07:00
John Ralls
85a1c39092 7258: Transcode FS paths to avoid a crash
The problem is really that the paths get munged into strings in the
system codepage, losing or misinterpreting most Unicode. Python's os
module is smart enough to encode the unicode to the file system
encoding, but the bsddb module needs a little help.

Provide a new function, constfunc.get_env_var(name, default=None) to
cleanly import Unicode environment variables in Windows and use it in
place of all instances of foo = os.environ['BAR] or foo =
os.environ.get('BAR').

Os path functions are smart enough to convert unicode to the file system
encoding on their own, but Db functions aren't, so provide an _encode
function in gen.db.write.py and apply it where a path is being passed to
DBEnv.open().

Also convert paths from the UI to unicode from 'utf8' rather than
sysfilesystemencoding. The latter happens to be correct most of the time
on Linux and OSX but is wrong on Windows.
2014-03-23 15:09:51 -07:00
John Ralls
a030c20210 7519: GRAMPs unable to handle ... Path with accented characters
This replaces commit 8cbb3ef014 with
removing the incorrect encoding of paths with the system filesystem
encoding. Python is mostly smart enough to do that itself.

Thanks to Paul Franklin and Josip Pisoj for their help with sorting this
out.
2014-03-17 12:54:22 -07:00
John Ralls
946c5539af 7026: Eliminate localedir error message 2014-03-17 12:54:22 -07:00
John Ralls
8cbb3ef014 7519: GRAMPs unable to handle ... Path with accented characters
Much worse, actually. Gramps wasn't able to handle any non-ascii
characters in any preference setting from Python2.

repr() in Py2 effectively runs "encode(val, ascii, backslashreplace)"
on its argument, and there's no way to reconstruct the string.
2014-03-08 17:55:50 -08:00
John Ralls
38aaa671cd Remove some left-over diagnostic messages. 2014-03-08 13:40:47 -08:00
John Ralls
49cdfe3283 Bug 6538: Collation variants do not work properly
If ICU is available, inspect the environment for $COLLATION and on
a Mac also check the AppleCollationOrder default. Pass the results
to a special ICU Locale used for sorting.
2014-03-07 16:27:05 -08:00
John Ralls
58d150ebc8 Revert "Bug 6538: Collation variants do not work properly"
This reverts commit e0c896fe12.
Picked up too much in one change.
2014-03-07 16:17:51 -08:00
John Ralls
e0c896fe12 Bug 6538: Collation variants do not work properly
Pass fully-qualified locale found in $LC_COLLATE to ICU.
2014-03-07 16:14:00 -08:00
John Ralls
4dd543c323 Move the icu missing warning to after setting up the log handler. 2014-03-06 11:23:49 -08:00
John Ralls
f9172c3ad1 Bug 7377 - Ver 4.0.2 starts in East Asian Language
Because there is no en.po for Gramps, so the C gettext called from
GtkBuilder skips to the next translation in the list. Fix makes sure
that there is no next translation.
2014-03-04 10:00:37 -08:00
John Ralls
816bf310e1 Bug 7377 Ver 4.0.2 starts in East Asian Language
Revert "GrampsLocale: Don't set  to 'C' if LANG is en_US"

This reverts commit bdd336f38e.

It turns out that Gtk's having an 'en' translation isn't the only reason
for doing this: GtkBuilder uses $LANGUAGE too, and will look for an english
translation of strings in our Glade files. Since there's no en.po or
en_US.po, it will go to the next language in the list and produce confusing
results.
2014-02-20 14:01:19 -08:00
John Ralls
84cabddcc9 Better fix for bug 7122. 2014-02-20 14:01:19 -08:00
John Ralls
eec3122bfb Fix up grampslocale logging a bit.
Send log messages "up the chain", make maclocale a sub-log of grampslocale.
2014-02-20 14:01:18 -08:00
Vassilii Khachaturov
ad812c8537 debug.profile: support kwargs and ret values 2014-02-16 13:57:47 +02:00
John Ralls
e281f51ba6 Bug 7122 - Gramps does not start
Handle AppleCollationOrder returning an empty string
2014-02-14 17:21:12 -08:00
Doug Blank
e649e5514d Changed {} format 2013-12-20 00:18:46 -05:00
Vassilii Khachaturov
be0239d255 7288/7290: port image_dpi legacy gtk code to gtk3 2013-12-15 15:09:12 +02:00
Vassilii Khachaturov
996baaad14 7288/7290: image_dpi and cropping fixes for ODFdoc
Port my fixes based on the patch from Matthias Basler from gramps34
[2eca30] 7290: use simpler math in image_dpi
[2f5e22] 7290: align warning with the image_dpi fix logic
[36f84e] 7290: image_dpi default calc based on gtk.gdk
[161ce3] 7290: ImgManip.image_dpi shouldn't return None
[460e63] 7288/7290 refactor out crop_percentage_to_pixel
[a8a38f] 7288/7290 refactor out crop_percentage_to_subpixel
[0d61bb] 7288/7290: refactor fix from matthiasbasler
[088146] rm relict RCS kwd
[76df5d] 7288/7290: image cropping fixes in ODFDoc

Using legacy gtk interface in image.py at the moment, need to port
to the new style.

Tested with python2.
2013-12-15 15:09:12 +02:00
Nick Hall
ceb3f44205 Improve gen.utils documentation 2013-11-12 21:44:01 +00:00
Doug Blank
ec76905791 Show local variables on unhandled crash
svn: r23446
2013-11-02 16:38:35 +00:00
Nick Hall
d6ae8cffb4 GEPS 6: Implement place hierarchy
svn: r23444
2013-11-01 19:13:16 +00:00
Vassilii Khachaturov
4ca39d0fff 7162: unicode_literals break win+py2
svn: r23434
2013-10-28 16:35:09 +00:00
Doug Blank
46ceab3ca8 Apparently, when running as a script, sys.stdout might not have an encoding
svn: r23374
2013-10-23 17:03:40 +00:00
Paul Franklin
59457923fa 7124: Complete Individual Report does incomplete translation
svn: r23354
2013-10-20 16:46:53 +00:00
Vassilii Khachaturov
be84468d3f 6926: merge to trunk p2: gramps/ code changes
svn: r23324
2013-10-16 14:04:21 +00:00
Vassilii Khachaturov
1972013601 7063: endless loop in probably_alive_range
Reapply r23161 from gramps40

svn: r23162
2013-09-18 14:49:59 +00:00
Doug Blank
c4125c9299 Turn off debug level, enable warn level; provide a default null handler for logging
svn: r23153
2013-09-17 15:12:36 +00:00
Doug Blank
7977800875 7034: probably_alive() failing when no birth-death dates specified; 6965: Probably Alive fails when birth date is a range
svn: r23023
2013-09-04 02:54:32 +00:00
John Ralls
d09bfef267 Change grampslocale logger to use __name__ instead of 'grampslocale'
Attempt to suppress 'No handler for logger grampslocale' messages by enrolling the logger in the module hierarchy.

svn: r23016
2013-09-03 23:18:24 +00:00
John Ralls
8c331a5d92 Bug 7036: [Win32]Setting LANG crashes Gramps
Also fixes Bug 6919: No automatic language selection in Windows
Thanks to Helge Herz.

svn: r23011
2013-09-03 17:39:04 +00:00
Vassilii Khachaturov
88e27cd71e gramps-connect used wrong arg for GrampsLocale
Fixed webapp/utils.py and also made the docstring in Grampslocale
less ambiguous.

svn: r22875
2013-08-19 19:53:59 +00:00
Nick Hall
2d8b44db89 Add checksum to media objects
svn: r22870
2013-08-15 17:49:51 +00:00
John Ralls
1bb33d6d8a Clean up some leftovers from 22840
svn: r22842
2013-08-09 22:36:36 +00:00
John Ralls
5880dc49f6 Consolidate mslocales and self._lang_map
into a single dict for easier maintenance

Thanks to Paul Franklin for suggesting it

svn: r22840
2013-08-09 22:11:58 +00:00
John Ralls
9e213e0090 Fix crash when Gramps is passed an invalid locale
svn: r22833
2013-08-09 19:58:34 +00:00
John Ralls
57af50e162 Ensure en_US encoding is UTF-8
svn: r22832
2013-08-09 19:58:29 +00:00
John Ralls
615fd34957 GrampsLocale:Add Greek and English to MSlocales
svn: r22831
2013-08-09 19:58:24 +00:00
Nick Hall
d174f4c44b Add unit test for latitide/longitude conversion
svn: r22792
2013-08-01 20:46:11 +00:00
Nick Hall
9a9d7ccf03 Convert callback test to use assert methods
svn: r22789
2013-07-31 20:12:08 +00:00
Nick Hall
b3ddf9f83a Fix and move keyword unit test
svn: r22759
2013-07-28 18:11:35 +00:00
Nick Hall
b2b4da2d37 Fix unit tests
svn: r22753
2013-07-28 15:04:26 +00:00
Paul Franklin
9148eaf18f add the missing import to the 3139 fix I added, sigh
svn: r22713
2013-07-21 20:49:01 +00:00
John Ralls
bdd336f38e GrampsLocale: Don't set to 'C' if LANG is en_US
Not required, Gtk has an 'en' translation

Ref. http://www.gramps-project.org/bugs/view.php?id=6867

svn: r22710
2013-07-21 20:22:24 +00:00
Paul Franklin
a327bf6337 3139: boolean command line options have to be specified as foo=true ...
The solution was suggested by Doug Blank.


svn: r22709
2013-07-21 20:04:30 +00:00
Jérôme Rapinat
8bbbae41aa support Arabic on installation and lang_map (reports)
svn: r22565
2013-06-23 09:15:33 +00:00
John Ralls
2ffbd49b55 Remove extra Id line from maclocale.py
svn: r22431
2013-05-27 17:42:11 +00:00
John Ralls
86b7a99101 Fix path left over from debugging session
svn: r22225
2013-05-09 19:32:47 +00:00
John Ralls
73d1d080b5 GrampsLocale: When checking translations check full locale first
So that e.g. en_GB will be preferred over en if en_GB is in fact the
desired translation.

svn: r22173
2013-05-04 20:23:47 +00:00
John Ralls
5db0763970 GrampsLocale: Fix 'Foo has no attribute _Foo__get_type' execption
From moving the set_locale function to the superclass. One can get
carried away with enforcing private attributes...

svn: r22062
2013-04-21 17:49:08 +00:00
John Ralls
143dcc08fa Bug 6533: Report plugin name when failing to load an add-on translation
Message now says (e.g.) WARNING: Plugin ExtendedAttributes has no translation for any of your configured languages, using US English instead

svn: r22039
2013-04-20 23:10:13 +00:00
John Ralls
2e453b678a GrampsLocale: Add explanatory comment
After I stopped myself from fixing something that was done right!

svn: r22038
2013-04-20 23:10:06 +00:00
John Ralls
a579fd1ad9 GrampsLocale: Mac: Align flow of user preferences to match other OSes.
Also add diagnostics to make Tim Lyons happy.

svn: r22037
2013-04-20 23:10:01 +00:00
John Ralls
2054c0ad46 GrampsLocale: Win32: Clean up extraneous conditions, don't set self.language prematurely
svn: r22036
2013-04-20 23:09:57 +00:00
John Ralls
a2e17b7b4a GrampsLocale: Posix: Move LC_MESSAGES check to setting self.language
svn: r22035
2013-04-20 23:09:51 +00:00
John Ralls
1832f7bdb5 GrampsLocale: Add some debugging messages.
Move the warning about failure to after the last attempt.

svn: r22034
2013-04-20 23:09:46 +00:00
John Ralls
9daf584c74 GrampsLocale: Init_from_environment: Change precedence
LC_MESSAGES takes precedence over LC_CTYPE for setting self.lang
$LANGUAGES overrides $LANG, $LC_FOO for setting translations

svn: r22033
2013-04-20 23:09:41 +00:00
John Ralls
e9770ef48f GrampsLocale: Fix indentation error
svn: r22032
2013-04-20 23:09:36 +00:00
John Ralls
7a17f9b420 MacLocale: Make sure the overrides work correctly
And that we follow the user's preferences correctly or issue a warning that we've defaulted to US English if we can't.

svn: r22031
2013-04-20 23:09:31 +00:00
John Ralls
467a9b1c43 GrampsLocale: Replace gen.plug.utils gfloat()
With GrampsLocale.float().
Also remove gen.plug.utils gformat(), which was written to work
around string formatting with %f localizing the decimal point,
which it doesn't do. locale.format() does, but it wasn't being
used anyway.

svn: r22028
2013-04-20 23:09:16 +00:00
John Ralls
769203162c GrampsLocale: Wrap locale.format and locale.format_string
To concentrate the locale dependency in grampslocale.py

svn: r22027
2013-04-20 23:09:09 +00:00
John Ralls
963712e978 Remove some imports of locale where nothing it exports was used.
svn: r22026
2013-04-20 23:09:02 +00:00
John Ralls
6400b8b29c GrampsLocale: Add GrampsLocale attributes numeric and currency
svn: r22024
2013-04-20 23:08:48 +00:00
John Ralls
6804278fc1 MacLocale: Fix missing subscript.
svn: r22023
2013-04-20 23:08:42 +00:00
Paul Franklin
dc128110bc typos
svn: r22021
2013-04-19 16:58:24 +00:00
Benny Malengier
86686c764b 6618: Export CSV crashes gramps 4.0 beta
svn: r21998
2013-04-15 11:01:08 +00:00
John Ralls
00aa00fbf5 GrampsLocale: Remove get_translation()
Only one base translation per locale. To set up a different locale
on any axis (locale, domain, directory, or languages) instantiate a
secondary locale by calling GrampsLocale() with the appropriate
arguments.

svn: r21968
2013-04-12 22:32:11 +00:00