Merge pull request #826 from prculley:bug11151

This commit is contained in:
Nick Hall 2019-06-15 17:36:26 +01:00
commit 2da2166004
20 changed files with 4899 additions and 3642 deletions

View File

@ -252,7 +252,7 @@ _RCT_TOP = '<placeholder id="OpenRecentMenu">'
_RCT_MENU = '''
<item>
<attribute name="action">win.%s</attribute>
<attribute name="label" translatable="no">%s</attribute>
<attribute name="label">%s</attribute>
</item>'''
_RCT_BTM = '\n </placeholder>\n'
_RCT_BAR_TOP = ('<object class="GtkMenu" id="OpenBtnMenu">\n'
@ -262,7 +262,7 @@ _RCT_BAR = '''
<child>
<object class="GtkMenuItem">
<property name="action-name">win.%s</property>
<property name="label" translatable="yes">%s</property>
<property name="label">%s</property>
<property name="use_underline">False</property>
<property name="visible">True</property>
</object>

View File

@ -65,7 +65,7 @@ from gramps.gen.simple import make_basic_stylesheet
MENUITEM = ('<item>\n'
'<attribute name="action">{prefix}.{action}</attribute>\n'
'<attribute name="label" translatable="yes">'
'<attribute name="label">'
'{label}</attribute>\n'
'</item>\n')

View File

@ -1112,7 +1112,7 @@ class ViewManager(CLIManager):
_menu = '''<placeholder id="undo">
<item>
<attribute name="action">win.Undo</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
</placeholder>
'''
@ -1132,7 +1132,7 @@ class ViewManager(CLIManager):
_menu = '''<placeholder id="redo">
<item>
<attribute name="action">win.Redo</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
</placeholder>
'''
@ -1405,8 +1405,7 @@ class ViewManager(CLIManager):
"""
menuitem = ('<item>\n'
'<attribute name="action">win.%s</attribute>\n'
'<attribute name="label" translatable="yes">'
'%s...</attribute>\n'
'<attribute name="label">%s...</attribute>\n'
'</item>\n')
actions = []
@ -1426,7 +1425,7 @@ class ViewManager(CLIManager):
for key in catlist:
ofile.write('<submenu>\n<attribute name="label"'
' translatable="yes">%s</attribute>\n' % key[1])
'>%s</attribute>\n' % key[1])
pdatas = hash_data[key]
pdatas.sort(key=lambda x: x.name)
for pdata in pdatas:
@ -1440,7 +1439,7 @@ class ViewManager(CLIManager):
# and the unsupported category at the end of the menu
if _UNSUPPORTED in hash_data:
ofile.write('<submenu>\n<attribute name="label"'
' translatable="yes">%s</attribute>\n' %
'>%s</attribute>\n' %
_UNSUPPORTED[1])
pdatas = hash_data[_UNSUPPORTED]
pdatas.sort(key=lambda x: x.name)

View File

@ -151,8 +151,7 @@ class Bookmarks(metaclass=ABCMeta):
"""Create the pulldown menu."""
menuitem = ('<item>\n'
'<attribute name="action">win.%s</attribute>\n'
'<attribute name="label" translatable="yes">'
'%s</attribute>\n'
'<attribute name="label">%s</attribute>\n'
'</item>\n')
text = StringIO()

View File

@ -425,7 +425,7 @@ class NavigationView(PageView):
"""
menuitem = ''' <item>
<attribute name="action">win.%s%02d</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
'''
menus = ''

View File

@ -242,7 +242,7 @@ class Tags(DbGUIElement):
menuitem = '''
<item>
<attribute name="action">win.TAG_%s</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>'''
for tag_name, handle in self.__tag_list:

View File

@ -1455,8 +1455,7 @@ class GrampletPane(Gtk.ScrolledWindow):
''')
menuitem = ('<item>\n'
'<attribute name="action">win.%s</attribute>\n'
'<attribute name="label" translatable="yes">'
'%s</attribute>\n'
'<attribute name="label">%s</attribute>\n'
'</item>\n')
if is_right_click(event):

View File

@ -231,7 +231,7 @@ class BasePersonView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -306,7 +306,7 @@ class BasePersonView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -318,7 +318,7 @@ class BasePersonView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -330,7 +330,7 @@ class BasePersonView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -342,7 +342,7 @@ class BasePersonView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -382,7 +382,7 @@ class BasePersonView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -171,7 +171,7 @@ class PlaceBaseView(ListView):
<item>
<attribute name="action">win.MapChoice</attribute>
<attribute name="target">%s</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
'''
menu = ''
@ -308,7 +308,7 @@ class PlaceBaseView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -365,7 +365,7 @@ class PlaceBaseView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -377,7 +377,7 @@ class PlaceBaseView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -389,7 +389,7 @@ class PlaceBaseView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -401,7 +401,7 @@ class PlaceBaseView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -431,7 +431,7 @@ class PlaceBaseView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -471,7 +471,7 @@ class PlaceBaseView(ListView):
<property name="tooltip_text" translatable="yes">'''
'''Attempt to see selected locations with a Map Service '''
'''(OpenstreetMap, Google Maps, ...)</property>
<property name="label" translatable="yes">%s</property>
<property name="label">%s</property>
<property name="use-underline">True</property>
</object>
<packing>

View File

@ -200,7 +200,7 @@ class CitationListView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -257,7 +257,7 @@ class CitationListView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -269,7 +269,7 @@ class CitationListView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -281,7 +281,7 @@ class CitationListView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -293,7 +293,7 @@ class CitationListView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text" >%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -324,7 +324,6 @@ class CitationListView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -350,7 +350,7 @@ class CitationTreeView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -403,7 +403,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -415,7 +415,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-source</property>
<property name="action-name">win.AddSource</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Add source...</property>
</object>
<packing>
@ -426,7 +426,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-citation</property>
<property name="action-name">win.AddCitation</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Add citation...</property>
</object>
<packing>
@ -437,7 +437,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -449,7 +449,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -461,7 +461,7 @@ class CitationTreeView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -508,7 +508,7 @@ class CitationTreeView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -214,7 +214,7 @@ class EventView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -271,7 +271,7 @@ class EventView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -283,7 +283,7 @@ class EventView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -295,7 +295,7 @@ class EventView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -307,7 +307,7 @@ class EventView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -338,7 +338,7 @@ class EventView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -173,7 +173,7 @@ class FamilyView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -230,7 +230,7 @@ class FamilyView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -242,7 +242,7 @@ class FamilyView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -254,7 +254,7 @@ class FamilyView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -266,7 +266,7 @@ class FamilyView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -297,7 +297,7 @@ class FamilyView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -104,8 +104,8 @@ _UI_DEF = [
<object class="GtkToolButton">
<property name="icon-name">go-previous</property>
<property name="action-name">win.Back</property>
<property name="tooltip_text" translatable="yes">...
...Go to the previous object in the history</property>
<property name="tooltip_text" translatable="yes">'''
'''Go to the previous object in the history</property>
<property name="label" translatable="yes">_Back</property>
<property name="use-underline">True</property>
</object>

View File

@ -273,7 +273,7 @@ class MediaView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -330,7 +330,7 @@ class MediaView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -342,7 +342,7 @@ class MediaView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -354,7 +354,7 @@ class MediaView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -366,7 +366,7 @@ class MediaView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -422,7 +422,7 @@ class MediaView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -147,7 +147,7 @@ class NoteView(ListView):
</item>
<item>
<attribute name="action">win.EditBook</attribute>
<attribute name="label" translatable="no">%s...</attribute>
<attribute name="label">%s...</attribute>
</item>
</section>
''' % _('Organize Bookmarks'),
@ -173,7 +173,7 @@ class NoteView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -230,7 +230,7 @@ class NoteView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -242,7 +242,7 @@ class NoteView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -254,7 +254,7 @@ class NoteView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -266,7 +266,7 @@ class NoteView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -297,7 +297,7 @@ class NoteView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -186,7 +186,7 @@ class RepositoryView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -243,7 +243,7 @@ class RepositoryView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -255,7 +255,7 @@ class RepositoryView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -267,7 +267,7 @@ class RepositoryView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -279,7 +279,7 @@ class RepositoryView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -310,7 +310,7 @@ class RepositoryView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

View File

@ -172,7 +172,7 @@ class SourceView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>
@ -229,7 +229,7 @@ class SourceView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-add</property>
<property name="action-name">win.Add</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Add...</property>
<property name="use-underline">True</property>
</object>
@ -241,7 +241,7 @@ class SourceView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gtk-edit</property>
<property name="action-name">win.Edit</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">Edit...</property>
<property name="use-underline">True</property>
</object>
@ -253,7 +253,7 @@ class SourceView(ListView):
<object class="GtkToolButton">
<property name="icon-name">list-remove</property>
<property name="action-name">win.Remove</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Delete</property>
<property name="use-underline">True</property>
</object>
@ -265,7 +265,7 @@ class SourceView(ListView):
<object class="GtkToolButton">
<property name="icon-name">gramps-merge</property>
<property name="action-name">win.Merge</property>
<property name="tooltip_text" translatable="yes">%s</property>
<property name="tooltip_text">%s</property>
<property name="label" translatable="yes">_Merge...</property>
<property name="use-underline">True</property>
</object>
@ -296,7 +296,7 @@ class SourceView(ListView):
</item>
<item>
<attribute name="action">win.Edit</attribute>
<attribute name="label" translatable="yes">%s</attribute>
<attribute name="label">%s</attribute>
</item>
<item>
<attribute name="action">win.Remove</attribute>

File diff suppressed because it is too large Load Diff

View File

@ -53,7 +53,7 @@ import os
import sys
import shutil
from argparse import ArgumentParser
from tokenize import tokenize, STRING, COMMENT, NL, TokenError
# Windows OS
if sys.platform in ['linux', 'linux2', 'darwin', 'cygwin'] or shutil.which('msgmerge'):
@ -536,6 +536,8 @@ def headers():
headers.append('''../data/gramps.appdata.xml.in.h''')
if os.path.isfile('''gtklist.h'''):
headers.append('''gtklist.h''')
if os.path.isfile('''fragments.pot'''):
headers.append('''fragments.pot''')
return headers
@ -622,6 +624,76 @@ def extract_gtkbuilder():
print ('Wrote gtklist.h')
def xml_fragments():
""" search through the file for xml fragments that contain the
'translate="yes">string<' pattern. These need to be added to the message
catalog """
with open('tmpfiles') as __f:
files = [file.strip() for file in __f if
file and not (file[0] == '#') and file.endswith('.py\n')]
print("Checking for XML fragments in Python files")
modop = int(len(files) / 20)
wfp = open("fragments.pot", 'w', encoding='utf-8')
for indx, filename in enumerate(files):
if not indx % modop:
print(int(indx / len(files) * 100), end='\r')
fp = open(filename, 'rb')
try:
tokens = tokenize(fp.readline)
in_string = False
for _token, _text, _start, _end, _line in tokens:
if _text.startswith('"""') or _text.startswith("'''"):
_text = _text[3:]
elif _text.startswith('"') or _text.startswith("'"):
_text = _text[1:]
if _text.endswith('"""') or _text.endswith("'''"):
_text = _text[:-3]
elif _text.endswith('"') or _text.endswith("'"):
_text = _text[:-1]
if _token == STRING and not in_string:
in_string = True
line_no = _start[0]
text = _text
continue
elif _token == STRING and in_string:
text += _text
continue
elif _token == COMMENT or _token == NL and in_string:
# need to ignore comments and concatinate strings
_ml = True
continue
elif in_string:
in_string = False
end = 0
# _find_message_in_xml(text)
while True:
fnd = text.find('translatable="yes">', end)
if fnd == -1:
break
end = text.find('<', fnd)
if end == -1:
print("\nBad xml fragment '%s' at %s line %d" %
(text[fnd:], filename, _start[0]))
break
msg = text[fnd + 19 : end]
if "%s" in msg or (msg.startswith('{') and
msg.endswith('}')):
print('\n#: %s:%d Are you sure you want to '
'translate the "%%s"???' %
(filename, line_no))
break
wfp.write('#: %s:%d\nmsgid "%s"\nmsgstr ""\n' %
(filename, line_no, msg))
except TokenError as e:
print('\n%s: %s, line %d, column %d' % (
e.args[0], filename, e.args[1][0], e.args[1][1]),
file=sys.stderr)
finally:
fp.close()
wfp.close()
def retrieve():
"""
Extract messages from all files used by Gramps (python, glade, xml)
@ -633,6 +705,8 @@ def retrieve():
create_template()
create_filesfile()
xml_fragments()
listing('python.txt', ['.py', '.py.in'])
# additional keywords must always be kept in sync with those in genpot.sh