Skip to content

Commit bb3aeb2

Browse files
committed
Fix FilterRules to recognize local po files
1 parent 0339576 commit bb3aeb2

File tree

7 files changed

+44
-32
lines changed

7 files changed

+44
-32
lines changed

FilterRules/hasrolerule.gpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
id = 'HasPersonEventRole',
2626
name = _("People with events with a selected role"),
2727
description = _("Matches people with an event with a selected role"),
28-
version = '0.0.4',
28+
version = '0.0.5',
2929
authors = ["Paul Culley"],
3030
authors_email = ["[email protected]"],
3131
gramps_target_version = '5.1',
@@ -39,7 +39,7 @@
3939
id = 'HasFamilyEventRole',
4040
name = _("Families with events with a selected role"),
4141
description = _("Matches families with an event with a selected role"),
42-
version = '0.0.4',
42+
version = '0.0.5',
4343
authors = ["Paul Culley"],
4444
authors_email = ["[email protected]"],
4545
gramps_target_version = '5.1',

FilterRules/hasrolerule.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
# Standard Python modules
2727
#
2828
#-------------------------------------------------------------------------
29-
from gramps.gen.const import GRAMPS_LOCALE as glocale
30-
_ = glocale.translation.gettext
3129

3230
#-------------------------------------------------------------------------
3331
#
@@ -37,6 +35,12 @@
3735
from gramps.gen.lib.eventroletype import EventRoleType
3836
from gramps.gui.editors.filtereditor import MySelect, MyBoolean
3937
from gramps.gen.filters.rules import Rule
38+
from gramps.gen.const import GRAMPS_LOCALE as glocale
39+
try:
40+
_trans = glocale.get_addon_translator(__file__)
41+
except ValueError:
42+
_trans = glocale.translation
43+
_ = _trans.gettext
4044

4145

4246
class Roletype(MySelect):

FilterRules/hassourcefilter.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
id = 'HasSourceParameter',
2727
name = _("Source matching parameters"),
2828
description = _("Matches Sources with values containing the chosen parameters"),
29-
version = '0.0.4',
29+
version = '0.0.5',
3030
authors = ["Dave Scheipers", "Paul Culley"],
3131
authors_email = ["[email protected]"],
3232
gramps_target_version = '5.1',

FilterRules/hassourcefilter.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,19 @@
2727
# Standard Python modules
2828
#
2929
#-------------------------------------------------------------------------
30-
from gramps.gen.const import GRAMPS_LOCALE as glocale
31-
_ = glocale.translation.gettext
3230

3331
#-------------------------------------------------------------------------
3432
#
3533
# GRAMPS modules
3634
#
3735
#-------------------------------------------------------------------------
3836
from gramps.gen.filters.rules._hassourcebase import HasSourceBase
37+
from gramps.gen.const import GRAMPS_LOCALE as glocale
38+
try:
39+
_trans = glocale.get_addon_translator(__file__)
40+
except ValueError:
41+
_trans = glocale.translation
42+
_ = _trans.gettext
3943

4044

4145
#-------------------------------------------------------------------------

FilterRules/isrelatedwithfiltermatch.gpr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
name = _("People related to <filter>"),
2727
description = _("Matches people who are related to anybody matched by "
2828
"a person filter"),
29-
version = '1.0.2',
29+
version = '1.0.3',
3030
authors = ["Matthias Kemmer"],
3131
authors_email = ["[email protected]"],
3232
gramps_target_version = '5.1',

FilterRules/isrelatedwithfiltermatch.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
# Standard Python modules
2626
#
2727
# -------------------------------------------------------------------------
28-
from gramps.gen.const import GRAMPS_LOCALE as glocale
29-
_ = glocale.translation.gettext
3028

3129
# -------------------------------------------------------------------------
3230
#
@@ -35,6 +33,12 @@
3533
# -------------------------------------------------------------------------
3634
from gramps.gen.filters.rules.person._isrelatedwith import IsRelatedWith
3735
from gramps.gen.filters.rules.person._matchesfilter import MatchesFilter
36+
from gramps.gen.const import GRAMPS_LOCALE as glocale
37+
try:
38+
_trans = glocale.get_addon_translator(__file__)
39+
except ValueError:
40+
_trans = glocale.translation
41+
_ = _trans.gettext
3842

3943

4044
# -------------------------------------------------------------------------

FilterRules/po/template.pot

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ msgid ""
88
msgstr ""
99
"Project-Id-Version: PACKAGE VERSION\n"
1010
"Report-Msgid-Bugs-To: \n"
11-
"POT-Creation-Date: 2019-11-27 10:32-0600\n"
11+
"POT-Creation-Date: 2019-12-08 09:27-0600\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -21,43 +21,43 @@ msgstr ""
2121
msgid "People with events with a selected role"
2222
msgstr ""
2323

24-
#: FilterRules/hasrolerule.gpr.py:27 FilterRules/hasrolerule.py:65
24+
#: FilterRules/hasrolerule.gpr.py:27 FilterRules/hasrolerule.py:69
2525
msgid "Matches people with an event with a selected role"
2626
msgstr ""
2727

2828
#: FilterRules/hasrolerule.gpr.py:40
2929
msgid "Families with events with a selected role"
3030
msgstr ""
3131

32-
#: FilterRules/hasrolerule.gpr.py:41 FilterRules/hasrolerule.py:89
32+
#: FilterRules/hasrolerule.gpr.py:41 FilterRules/hasrolerule.py:93
3333
msgid "Matches families with an event with a selected role"
3434
msgstr ""
3535

36-
#: FilterRules/hasrolerule.py:51
36+
#: FilterRules/hasrolerule.py:55
3737
msgid "Does NOT match with selected Role"
3838
msgstr ""
3939

40-
#: FilterRules/hasrolerule.py:52
40+
#: FilterRules/hasrolerule.py:56
4141
msgid "Finds the items that don't have event Roles of the selected type."
4242
msgstr ""
4343

44-
#: FilterRules/hasrolerule.py:62 FilterRules/hasrolerule.py:86
44+
#: FilterRules/hasrolerule.py:66 FilterRules/hasrolerule.py:90
4545
msgid "Role"
4646
msgstr ""
4747

48-
#: FilterRules/hasrolerule.py:63 FilterRules/hasrolerule.py:87
48+
#: FilterRules/hasrolerule.py:67 FilterRules/hasrolerule.py:91
4949
msgid "Inverse"
5050
msgstr ""
5151

52-
#: FilterRules/hasrolerule.py:64
52+
#: FilterRules/hasrolerule.py:68
5353
msgid "People with events with the <role>"
5454
msgstr ""
5555

56-
#: FilterRules/hasrolerule.py:66 FilterRules/hasrolerule.py:90
56+
#: FilterRules/hasrolerule.py:70 FilterRules/hasrolerule.py:94
5757
msgid "Event filters"
5858
msgstr ""
5959

60-
#: FilterRules/hasrolerule.py:88
60+
#: FilterRules/hasrolerule.py:92
6161
msgid "Families with events with the <role>"
6262
msgstr ""
6363

@@ -69,52 +69,52 @@ msgstr ""
6969
msgid "Matches Sources with values containing the chosen parameters"
7070
msgstr ""
7171

72-
#: FilterRules/hassourcefilter.py:49
72+
#: FilterRules/hassourcefilter.py:53
7373
msgid "Title:"
7474
msgstr ""
7575

76-
#: FilterRules/hassourcefilter.py:50
76+
#: FilterRules/hassourcefilter.py:54
7777
msgid "Author:"
7878
msgstr ""
7979

80-
#: FilterRules/hassourcefilter.py:51
80+
#: FilterRules/hassourcefilter.py:55
8181
msgid "Abbreviation:"
8282
msgstr ""
8383

84-
#: FilterRules/hassourcefilter.py:52
84+
#: FilterRules/hassourcefilter.py:56
8585
msgid "Publication:"
8686
msgstr ""
8787

88-
#: FilterRules/hassourcefilter.py:53
88+
#: FilterRules/hassourcefilter.py:57
8989
msgid "Sources matching parameters"
9090
msgstr ""
9191

92-
#: FilterRules/hassourcefilter.py:54
92+
#: FilterRules/hassourcefilter.py:58
9393
msgid "Matches sources with a particular value"
9494
msgstr ""
9595

96-
#: FilterRules/hassourcefilter.py:55
96+
#: FilterRules/hassourcefilter.py:59
9797
msgid "General filters"
9898
msgstr ""
9999

100100
#: FilterRules/isrelatedwithfiltermatch.gpr.py:26
101-
#: FilterRules/isrelatedwithfiltermatch.py:49
101+
#: FilterRules/isrelatedwithfiltermatch.py:53
102102
msgid "People related to <filter>"
103103
msgstr ""
104104

105105
#: FilterRules/isrelatedwithfiltermatch.gpr.py:27
106-
#: FilterRules/isrelatedwithfiltermatch.py:51
106+
#: FilterRules/isrelatedwithfiltermatch.py:55
107107
msgid "Matches people who are related to anybody matched by a person filter"
108108
msgstr ""
109109

110-
#: FilterRules/isrelatedwithfiltermatch.py:48
110+
#: FilterRules/isrelatedwithfiltermatch.py:52
111111
msgid "Filter name:"
112112
msgstr ""
113113

114-
#: FilterRules/isrelatedwithfiltermatch.py:50
114+
#: FilterRules/isrelatedwithfiltermatch.py:54
115115
msgid "Relationship filters"
116116
msgstr ""
117117

118-
#: FilterRules/isrelatedwithfiltermatch.py:63
118+
#: FilterRules/isrelatedwithfiltermatch.py:67
119119
msgid "Retrieving all sub-filter matches"
120120
msgstr ""

0 commit comments

Comments
 (0)