6403: Remove markup in translatable messages -- partial

This commit is contained in:
Paul Franklin 2014-07-06 13:14:01 -07:00
parent 5680becf16
commit 8c94dcfd27
28 changed files with 581 additions and 262 deletions

View File

@ -41,7 +41,7 @@ import logging
#---------------------------------------------------------------
from .const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from .const import HOME_DIR, USER_HOME, VERSION_DIR
from .const import HOME_DIR, USER_HOME, VERSION_DIR, URL_HOMEPAGE
from .utils.configmanager import ConfigManager
#---------------------------------------------------------------
@ -170,7 +170,7 @@ register('geography.zoom_when_center', 12)
register('geography.show_cross', False)
register('geography.path', "")
register('htmlview.start-url', "http://gramps-project.org")
register('htmlview.start-url', URL_HOMEPAGE)
register('htmlview.url-handler', False)
register('interface.address-height', 450)

View File

@ -57,7 +57,8 @@ from ..version import VERSION, VERSION_TUPLE, major_version
#-------------------------------------------------------------------------
URL_HOMEPAGE = "http://gramps-project.org/"
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770"
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_advanced_page.php"
URL_BUGHOME = "http://bugs.gramps-project.org"
URL_BUGTRACKER = "http://bugs.gramps-project.org/bug_report_page.php"
URL_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version
WIKI_FAQ = "FAQ"

View File

@ -25,8 +25,15 @@
# Standard python modules
#
#-------------------------------------------------------------------------
from ..const import URL_WIKISTRING, URL_MANUAL_PAGE
from ..const import GRAMPS_LOCALE as glocale
from __future__ import print_function
#-------------------------------------------------------------------------
#
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
@ -105,12 +112,19 @@ class BsddbDowngradeError(Exception):
'Bsddb version %(bdb_version)s. So you are trying to load '
'data created in a newer format into an older program, and '
'this is bound to fail.\n\n'
'You should start your <b>newer</b> version of Gramps and '
'<a href="http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup">'
'make a backup</a> of your Family Tree. You can then import '
'this backup into this version of Gramps.') % \
{'env_version': self.env_version,
'bdb_version': self.bdb_version}
'You should start your '
'%(bold_start)snewer%(bold_end)s version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree. You can then import '
'this backup into this version of Gramps.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'env_version' : self.env_version,
'bdb_version' : self.bdb_version }
class BsddbDowngradeRequiredError(Exception):
"""
@ -132,11 +146,18 @@ class BsddbDowngradeRequiredError(Exception):
'this particular case, the difference is very small, so it '
'may work.\n\n'
'If you have not already made a backup of your Family Tree, '
'then you should start your <b>newer</b> version of Gramps and '
'<a href="http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup">'
'make a backup</a> of your Family Tree.') % \
{'env_version': self.env_version,
'bdb_version': self.bdb_version}
'then you should start your '
'%(bold_start)snewer%(bold_end)s version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'env_version' : self.env_version,
'bdb_version' : self.bdb_version }
class BsddbUpgradeRequiredError(Exception):
"""
@ -158,11 +179,18 @@ class BsddbUpgradeRequiredError(Exception):
'irretrievably corrupt your Family Tree. You are strongly '
'advised to backup your Family Tree.\n\n'
'If you have not already made a backup of your Family Tree, '
'then you should start your <b>old</b> version of Gramps and '
'<a href="http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup">'
'make a backup</a> of your Family Tree.') % \
{'env_version': self.env_version,
'bdb_version': self.bsddb_version}
'then you should start your %(bold_start)sold%(bold_end)s '
'version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'env_version' : self.env_version,
'bdb_version' : self.bsddb_version }
class DbEnvironmentError(Exception):
"""
@ -175,14 +203,16 @@ class DbEnvironmentError(Exception):
def __str__(self):
return (_("Gramps has detected a problem in opening the 'environment' "
"of the underlying Berkeley database used to store this Family Tree. "
"The most likely cause "
"of the underlying Berkeley database used to store this "
"Family Tree. The most likely cause "
"is that the database was created with an old version "
"of the Berkeley database program, and you are now using a new version. "
"of the Berkeley database program, "
"and you are now using a new version. "
"It is quite likely that your database has not been "
"changed by Gramps.\nIf possible, you should revert to your "
"old version of Gramps and its support software; export "
"your database to XML; close the database; then upgrade again "
"your database to XML; close the database; "
"then upgrade again "
"to this version of Gramps and import the XML file "
"in an empty Family Tree. Alternatively, it may be possible "
"to use the Berkeley database recovery tools.")
@ -206,25 +236,35 @@ class DbUpgradeRequiredError(Exception):
'Family Tree.\n\n'
'If you upgrade then you won\'t be able to use the previous '
'version of Gramps, even if you subsequently '
'<a href="%(gramps_wiki)s%(gramps_manual)s_-_Manage_Family_Trees#Backing_up_a_Family_Tree">backup</a> '
'or <a href="%(gramps_wiki)s%(gramps_manual)s_-_Manage_Family_Trees#Export_into_Gramps_formats">export</a> '
'your upgraded Family Tree.\n\n'
'%(wiki_html_start)s%(gramps_manual)s'
'_-_Manage_Family_Trees#Backing_up_a_Family_Tree'
'%(html_middle)sbackup%(html_end)s or '
'%(wiki_html_start)s%(gramps_manual)s'
'_-_Manage_Family_Trees#Export_into_Gramps_formats'
'%(html_middle)sexport'
'%(html_end)s your upgraded Family Tree.\n\n'
'Upgrading is a difficult task which could irretrievably '
'corrupt your Family Tree if it is interrupted or fails.\n\n'
'If you have not already made a backup of your Family Tree, '
'then you should start your <b>old</b> version of Gramps and '
'<a href="%(gramps_wiki)sHow_to_make_a_backup">make a backup</a> '
'of your Family Tree.') % \
{'gramps_wiki': URL_WIKISTRING,
'gramps_manual': URL_MANUAL_PAGE,
'oldschema': self.oldschema,
'newschema': self.newschema}
'then you should start your %(bold_start)sold%(bold_end)s '
'version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'gramps_manual' : URL_MANUAL_PAGE,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'oldschema' : self.oldschema,
'newschema' : self.newschema }
class PythonDowngradeError(Exception):
"""
Error used to report that the Python version used to create the family tree
(i.e. Python3) is of a version that is newer than the current version
(i.e.Python2), so the Family Tree cannot be opened
(i.e. Python3) is a version that is newer than the current version
(i.e. Python2), so the Family Tree cannot be opened
"""
def __init__(self, db_python_version, current_python_version):
Exception.__init__(self)
@ -238,18 +278,25 @@ class PythonDowngradeError(Exception):
'trying to load '
'data created in a newer format into an older program, and '
'this is bound to fail.\n\n'
'You should start your <b>newer</b> version of Gramps and '
'<a href="http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup">'
'make a backup</a> of your Family Tree. You can then import '
'this backup into this version of Gramps.') % \
{'db_python_version': self.db_python_version,
'current_python_version': self.current_python_version}
'You should start your '
'%(bold_start)snewer%(bold_end)s version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree. You can then import '
'this backup into this version of Gramps.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'db_python_version': self.db_python_version,
'current_python_version': self.current_python_version }
class PythonUpgradeRequiredError(Exception):
"""
Error used to report that the Python version used to create the family tree
(i.e. Python2) is earlier than the current Python version (i.e. Python3), so
the Family Tree needs to be upgraded..
the Family Tree needs to be upgraded.
"""
def __init__(self, db_python_version, current_python_version):
Exception.__init__(self)
@ -264,14 +311,55 @@ class PythonUpgradeRequiredError(Exception):
'Python version of the Family Tree.\n\n'
'If you upgrade then you won\'t be able to use the previous '
'version of Gramps, even if you subsequently '
'<a href="http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Manage_Family_Trees#Backing_up_a_Family_Tree">backup</a> '
'or <a href="http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual_-_Manage_Family_Trees#Export_into_Gramps_formats">export</a> '
'your upgraded Family Tree.\n\n'
'%(wiki_html_start)s%(gramps_manual)s'
'_-_Manage_Family_Trees#Backing_up_a_Family_Tree'
'%(html_middle)sbackup%(html_end)s or '
'%(wiki_html_start)s%(gramps_manual)s'
'_-_Manage_Family_Trees#Export_into_Gramps_formats'
'%(html_middle)sexport'
'%(html_end)s your upgraded Family Tree.\n\n'
'Upgrading is a difficult task which could irretrievably '
'corrupt your Family Tree if it is interrupted or fails.\n\n'
'If you have not already made a backup of your Family Tree, '
'then you should start your <b>old</b> version of Gramps and '
'<a href="http://www.gramps-project.org/wiki/index.php?title=How_to_make_a_backup">make a backup</a> '
'of your Family Tree.') % \
{'db_python_version': self.db_python_version,
'current_python_version': self.current_python_version}
'then you should start your %(bold_start)sold%(bold_end)s '
'version of Gramps and '
'%(wiki_html_start)s'
'How_to_make_a_backup%(html_middle)smake a backup'
'%(html_end)s of your Family Tree.') % {
'wiki_html_start' : '<a href="' + URL_WIKISTRING ,
'html_middle' : '">' ,
'html_end' : '</a>' ,
'gramps_manual' : URL_MANUAL_PAGE,
'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'db_python_version': self.db_python_version,
'current_python_version': self.current_python_version }
if __name__ == "__main__":
"""
Call this from the CLI (in order to find the imported modules):
cd /path/to/gramps; GRAMPS_RESOURCES=. ; PYTHONPATH=.
python gramps/gen/db/exceptions.py
"""
import sys
print("\nDbVersionError:\n",
DbVersionError('1.6.0', '1.5.0', '1.5.1'))
print("\nBsddbDowngradeError:\n",
BsddbDowngradeError('4.8.30', '4.8.29'))
print("\nBsddbDowngradeRequiredError:\n",
BsddbDowngradeRequiredError('4.8.30', '4.8.29'))
print("\nBsddbUpgradeRequiredError:\n",
BsddbUpgradeRequiredError('4.8.29', '4.8.30'))
print("\nDbEnvironmentError:\n",
DbEnvironmentError('test message'))
print("\nDbUpgradeRequiredError:\n",
DbUpgradeRequiredError('1.5.1', '1.6.0'))
print("\nPythonDowngradeError:\n",
PythonDowngradeError('3', '2'))
print("\nPythonUpgradeRequiredError:\n",
PythonUpgradeRequiredError('2', '3'))
sys.exit(0)
print("\nxxx:\n",
xxx('4.8.30', '4.8.29'))

View File

@ -19,16 +19,27 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
from __future__ import print_function
import sys
import types
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
import logging
LOG = logging.getLogger(".Gramplets")
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
from ..const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
class Gramplet(object):
"""
Base class for non-graphical gramplet code.

View File

@ -49,7 +49,8 @@ from gi.repository import Gtk
#
#-------------------------------------------------------------------------
from gramps.gen.config import config
from gramps.gen.const import HOME_DIR, GRAMPS_LOCALE as glocale
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.const import HOME_DIR, URL_WIKISTRING
from gramps.gen.datehandler import get_date_formats
from gramps.gen.display.name import displayer as _nd
from gramps.gen.display.name import NameDisplayError
@ -1235,11 +1236,15 @@ class GrampsPreferences(ConfigureDialog):
current_line, 'behavior.spellcheck')
if not HAVE_GTKSPELL:
obj.set_sensitive(False)
obj.set_tooltip_text(_("GtkSpell not loaded. "
spell_dict = { 'gramps_wiki_build_spell_url' :
URL_WIKISTRING +
"GEPS_029:_GTK3-GObject_introspection"
"_Conversion#Spell_Check_Install" }
obj.set_tooltip_text(
_("GtkSpell not loaded. "
"Spell checking will not be available.\n"
"To build it for Gramps see http://www.gramps-project.org/"
"wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_"
"Conversion#Spell_Check_Install"))
"To build it for Gramps see "
"%(gramps_wiki_build_spell_url)s") % spell_dict )
current_line += 1
self.add_checkbox(table,

View File

@ -74,6 +74,7 @@ from gi.repository import Pango
#-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import URL_WIKISTRING
from .user import User
from .dialog import ErrorDialog, QuestionDialog, QuestionDialog2
from gramps.gen.db import DbBsddb
@ -677,25 +678,36 @@ class DbManager(CLIDbManager):
yes_no = QuestionDialog2(
_("Repair Family Tree?"),
_(
"If you click <b>Proceed</b>, Gramps will attempt to recover your Family Tree"
" from the last good backup. There are several ways this can cause unwanted"
" effects, so <b>backup</b> the Family Tree first.\n"
"The Family Tree you have selected is stored in %s.\n\n"
"Before doing a repair, verify that the Family Tree can really no longer be "
" opened, as the database back-end can recover from some errors automatically.\n\n"
"<b>Details:</b> Repairing a Family Tree actually uses the last backup of"
" the Family Tree, which Gramps stored on last use. If you have worked for"
" several hours/days without closing Gramps, then all this information will"
" be lost! If the repair fails, then the original Family Tree will be lost"
" forever, hence a backup is needed. If the repair fails, or too much"
" information is lost, you can fix the original Family Tree manually."
" For details, see the webpage\n"
"http://gramps-project.org/wiki/index.php?title=Recover_corrupted_family_tree\n"
"Before doing a repair, try to open the Family Tree in the normal manner."
" Several errors that trigger the repair button can be fixed automatically."
" If this is the case, you can disable the repair button by removing the"
" file <i>need_recover</i> in the Family Tree directory."
) % dirname,
"If you click %(bold_start)sProceed%(bold_end)s, Gramps will "
"attempt to recover your Family Tree from the last good "
"backup. There are several ways this can cause unwanted "
"effects, so %(bold_start)sbackup%(bold_end)s the "
"Family Tree first.\nThe Family Tree you have selected "
"is stored in %(dirname)s.\n\n"
"Before doing a repair, verify that the Family Tree can "
"really no longer be opened, as the database back-end can "
"recover from some errors automatically.\n\n"
"%(bold_start)sDetails:%(bold_end)s Repairing a Family Tree "
"actually uses the last backup of the Family Tree, which "
"Gramps stored on last use. If you have worked for "
"several hours/days without closing Gramps, then all "
"this information will be lost! If the repair fails, then "
"the original Family Tree will be lost forever, hence "
"a backup is needed. If the repair fails, or too much "
"information is lost, you can fix the original "
"Family Tree manually. For details, see the webpage\n"
"%(gramps_wiki_url)sRecover_corrupted_family_tree\n"
"Before doing a repair, try to open the Family Tree "
"in the normal manner. Several errors that trigger the "
"repair button can be fixed automatically. "
"If this is the case, you can disable the repair button "
"by removing the file %(recover_file)s in the "
"Family Tree directory."
) % { 'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'recover_file' : '<i>need_recover</i>' ,
'gramps_wiki_url' : URL_WIKISTRING ,
'dirname' : dirname },
_("Proceed, I have taken a backup"),
_("Stop"))
prompt = yes_no.run()

View File

@ -41,11 +41,11 @@ from gi.repository import GdkPixbuf
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import ICON
from gramps.gen.config import config
from gramps.gui.glade import Glade
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import ICON, URL_BUGHOME
from gramps.gen.config import config
from gramps.gui.glade import Glade
from gramps.gen.constfunc import cuni
try:
@ -205,7 +205,8 @@ class RunDatabaseRepair(ErrorDialog):
'usually be resolved by running the "Check and Repair Database" '
'tool.\n\nIf this problem continues to exist after running this '
'tool, please file a bug report at '
'http://bugs.gramps-project.org\n\n') + msg, parent)
'%(gramps_bugtracker_url)s\n\n')
% {'gramps_bugtracker_url' : URL_BUGHOME} + msg, parent)
class DBErrorDialog(ErrorDialog):
def __init__(self, msg, parent=None):

View File

@ -18,13 +18,24 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
import os
import webbrowser
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.const import URL_MANUAL_PAGE, URL_WIKISTRING
from gramps.gen.constfunc import is_quartz
from gramps.gen.config import config
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gui.utils import open_file_with_default_application as run_file
import os
import webbrowser
#list of manuals on wiki, map locale code to wiki extension, add language codes
#completely, or first part, so pt_BR if Brazilian portugeze wiki manual, and

View File

@ -79,7 +79,7 @@ class SurnameTab(EmbeddedList):
_column_toggle = (_('Name|Primary'), -1, 80, 4)
def __init__(self, dbstate, uistate, track, name, on_change=None,
top_label=_('<b>Multiple Surnames</b>')):
top_label='<b>%s</b>' % _("Multiple Surnames") ):
self.obj = name
self.on_change = on_change
self.curr_col = -1

View File

@ -226,9 +226,12 @@ def _display_welcome_message():
"5) Save data in a format that is incompatible with the "
"official release.\n"
"\n"
"<b>BACKUP</b> your existing databases before opening "
"%(bold_start)sBACKUP%(bold_end)s "
"your existing databases before opening "
"them with this version, and make sure to export your "
"data to XML every now and then."))
"data to XML every now and then.")
% { 'bold_start' : '<b>',
'bold_end' : '</b>' } )
config.set('behavior.autoload', False)
config.set('behavior.betawarn', True)
config.set('behavior.betawarn', config.get('behavior.betawarn'))
@ -264,12 +267,16 @@ class Gramps(object):
# Translators: the current language will be the one you translate into.
WarningDialog(
_("Gramps detected an incomplete GTK installation"),
_("""GTK translations for the current language (%s) are missing.
<b>Gramps</b> will proceed nevertheless.
The GUI will likely be broken as a result, especially for RTL languages!
See the Gramps README documentation for installation prerequisites,
typically located in /usr/share/doc/gramps.""") % glocale.lang)
_("GTK translations for the current language (%(language)s) "
"are missing.\n%(bold_start)sGramps%(bold_end)s will "
"proceed nevertheless.\nThe GUI will likely be broken "
"as a result, especially for RTL languages!\n\n"
"See the Gramps README documentation for installation "
"prerequisites,\ntypically located in "
"/usr/share/doc/gramps.\n") % {
'language' : glocale.lang ,
'bold_start' : '<b>' ,
'bold_end' : '</b>' } )
dbstate = DbState()
self.vm = ViewManager(dbstate,

View File

@ -44,8 +44,9 @@ else:
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import ICON, SPLASH, GRAMPS_LOCALE as glocale
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import ICON, SPLASH, URL_BUGTRACKER
from gramps.gen.constfunc import get_env_var
from gramps.version import VERSION
from ..display import display_help, display_url
@ -141,7 +142,7 @@ class ErrorReportAssistant(Gtk.Assistant):
"""
Start a web browser to report the bug.
"""
display_url('http://bugs.gramps-project.org/bug_report_page.php')
display_url(URL_BUGTRACKER)
def _get_sys_information(self):
"""
@ -556,7 +557,7 @@ class ErrorReportAssistant(Gtk.Assistant):
"%s <i>%s</i>" %
(_("Use the two buttons below to first copy the bug report to the "
"clipboard and then open a webbrowser to file a bug report at "),
"http://bugs.gramps-project.org/bug_report_page.php."))
URL_BUGTRACKER))
label.set_alignment(0.01, 0.5)
label.set_padding(0, 4)
label.set_line_wrap(True)

View File

@ -125,7 +125,7 @@ class DocReportDialog(ReportDialog):
if self.firstpage_added:
self.notebook.remove_page(0)
if docgen_plugin.get_paper_used():
self.paper_label = Gtk.Label(label='<b>%s</b>'%_("Paper Options"))
self.paper_label = Gtk.Label(label='<b>%s</b>' % _("Paper Options"))
self.paper_label.set_use_markup(True)
self.notebook.insert_page(self.paper_frame, self.paper_label, 0)
self.paper_frame.show_all()

View File

@ -175,7 +175,7 @@ class GraphvizReportDialog(ReportDialog):
self.target_fileentry.set_filename(spath)
def setup_report_options_frame(self):
self.paper_label = Gtk.Label(label='<b>%s</b>'%_("Paper Options"))
self.paper_label = Gtk.Label(label='<b>%s</b>' % _("Paper Options"))
self.paper_label.set_use_markup(True)
handler = self.options.handler
self.paper_frame = PaperFrame(

View File

@ -81,8 +81,8 @@ from .pluginmanager import GuiPluginManager
from gramps.gen.relationship import get_relationship_calculator
from .displaystate import DisplayState, RecentDocsMenu
from gramps.gen.const import (HOME_DIR, ICON, URL_BUGTRACKER, URL_HOMEPAGE,
URL_MAILINGLIST, URL_MANUAL_PAGE, URL_WIKISTRING,
WIKI_EXTRAPLUGINS)
URL_MAILINGLIST, URL_MANUAL_PAGE, URL_WIKISTRING,
WIKI_EXTRAPLUGINS, URL_BUGHOME)
from gramps.gen.constfunc import is_quartz, conv_to_unicode, uni_to_gui
from gramps.gen.config import config
from gramps.gen.errors import WindowActiveError
@ -1603,12 +1603,13 @@ def run_plugin(pdata, dbstate, uistate):
_('The plugin %(name)s did not load and reported an error.\n\n'
'%(error_msg)s\n\n'
'If you are unable to fix the fault yourself then you can '
'submit a bug at http://bugs.gramps-project.org or contact '
'submit a bug at %(gramps_bugtracker_url)s or contact '
'the plugin author (%(firstauthoremail)s).\n\n'
'If you do not want Gramps to try and load this plugin again, '
'you can hide it by using the Plugin Manager on the '
'Help menu.') % {
'name': pdata.name,
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...',
'error_msg': pmgr.get_fail_list()[-1][1][1]})
@ -1658,12 +1659,13 @@ def get_available_views():
_('The view %(name)s did not load and reported an error.\n\n'
'%(error_msg)s\n\n'
'If you are unable to fix the fault yourself then you can '
'submit a bug at http://bugs.gramps-project.org or contact '
'submit a bug at %(gramps_bugtracker_url)s or contact '
'the view author (%(firstauthoremail)s).\n\n'
'If you do not want Gramps to try and load this view again, '
'you can hide it by using the Plugin Manager on the '
'Help menu.') % {
'name': pdata.name,
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...',
'error_msg': lasterror})

View File

@ -88,7 +88,7 @@ from gramps.gen.plug.docgen import (BaseDoc, TextDoc, DrawDoc, graphicstyle,
LOCAL_HYPERLINK, LOCAL_TARGET)
from gramps.gen.plug.docgen.fontscale import string_width
from gramps.plugins.lib.libodfbackend import OdfBackend
from gramps.gen.const import PROGRAM_NAME
from gramps.gen.const import PROGRAM_NAME, URL_HOMEPAGE
from gramps.version import VERSION
from gramps.gen.plug.report import utils as ReportUtils
from gramps.gen.utils.image import (image_size, image_dpi, image_actual_size,
@ -204,7 +204,7 @@ _META_XML = '''\
<meta:editing-duration>PT0S</meta:editing-duration>
<meta:user-defined
meta:name="Genealogical Research and Analysis Management Programming System">
http://gramps-project.org
%(gramps_home_url)s
</meta:user-defined>
<meta:user-defined meta:name="Info 1"/>
<meta:user-defined meta:name="Info 2"/>
@ -1776,6 +1776,7 @@ class ODFDoc(BaseDoc, TextDoc, DrawDoc):
creator = self.get_creator()
date = self.time
lang = self.lang
gramps_home_url = URL_HOMEPAGE
self.meta.write(
_META_XML % locals()

View File

@ -32,7 +32,7 @@ Gramps' XML file format.
#-------------------------------------------------------------------------
#
# load standard python libraries
# Standard python modules
#
#-------------------------------------------------------------------------
import time
@ -40,9 +40,6 @@ import shutil
import os
import codecs
from xml.sax.saxutils import escape
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
#------------------------------------------------------------------------
#
@ -54,17 +51,19 @@ LOG = logging.getLogger(".WriteXML")
#-------------------------------------------------------------------------
#
# load Gramps libraries
# Gramps modules
#
#-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import URL_HOMEPAGE
from gramps.gen.lib import Date, Person
from gramps.gen.updatecallback import UpdateCallback
from gramps.gen.db.exceptions import DbWriteFailure
from gramps.version import VERSION
from gramps.gen.constfunc import win
from gramps.gen.constfunc import win, cuni, conv_to_unicode
from gramps.gui.plug.export import WriterOptionBox
import gramps.plugins.lib.libgrampsxml as libgrampsxml
from gramps.gen.constfunc import cuni, conv_to_unicode
#-------------------------------------------------------------------------
#
@ -218,11 +217,11 @@ class GrampsXmlWriter(UpdateCallback):
self.g.write('<?xml version="1.0" encoding="UTF-8"?>\n')
self.g.write('<!DOCTYPE database '
'PUBLIC "-//Gramps//DTD Gramps XML %s//EN"\n'
'"http://gramps-project.org/xml/%s/grampsxml.dtd">\n'
% (libgrampsxml.GRAMPS_XML_VERSION,
'"%sxml/%s/grampsxml.dtd">\n'
% (libgrampsxml.GRAMPS_XML_VERSION, URL_HOMEPAGE,
libgrampsxml.GRAMPS_XML_VERSION))
self.g.write('<database xmlns="http://gramps-project.org/xml/%s/">\n'
% libgrampsxml.GRAMPS_XML_VERSION)
self.g.write('<database xmlns="%sxml/%s/">\n'
% (URL_HOMEPAGE, libgrampsxml.GRAMPS_XML_VERSION))
self.g.write(" <header>\n")
self.g.write(' <created date="%04d-%02d-%02d\"' % date[:3])
self.g.write(" version=\"" + self.version + "\"")

View File

@ -16,6 +16,12 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#-------------------------------------------------------------------------
#
# Python modules
#
#-------------------------------------------------------------------------
#------------------------------------------------------------------------
#
# GRAMPS modules
@ -35,38 +41,139 @@ class FAQGramplet(Gramplet):
def init(self):
self.set_use_markup(True)
self.clear_text()
WIKI = URL_MANUAL_PAGE
self.render_text(_("<b><a wiki='%s_-_FAQ'>Frequently Asked Questions</a></b>\n(needs a connection to the internet)\n") % WIKI)
"""
The "wiki" HTTP "anchor type" is gramps-specific, and causes
GuiGramplet's on_button_press method to invoke gui/display.py's
display_help method, which prepends URL_WIKISTRING before it then
calls gui/display.py's display_url method. So no URL_WIKISTRING
is needed in this code.
"""
faq_dict = { 'bold_start' : '<b>' ,
'bold_end' : '</b>' ,
'gramps_wiki_html_start' : "<a wiki='" ,
'gramps_manual_html_start' :
"<a wiki='" + URL_MANUAL_PAGE + "_-_" ,
'gramps_FAQ_html_start' :
"<a wiki='" + URL_MANUAL_PAGE + "_-_FAQ" ,
'html_middle' : "'>" ,
'html_end' : '</a>' }
self.render_text(
_("%(bold_start)s%(gramps_FAQ_html_start)s%(html_middle)s"
"Frequently Asked Questions"
"%(html_end)s%(bold_end)s"
"\n(needs a connection to the internet)\n") % faq_dict )
self.render_text("\n<b>%s</b>\n\n" % _("Editing Spouses"))
self.render_text(_(" 1. <a wiki='%s_-_FAQ#How_do_I_change_the_order_of_spouses.3F'>How do I change the order of spouses?</a>\n") % WIKI)
self.render_text(_(" 2. <a wiki='%s_-_FAQ#How_do_I_add_an_additional_spouse.3F'>How do I add an additional spouse?</a>\n") % WIKI)
self.render_text(_(" 3. <a wiki='%s_-_FAQ#How_do_I_remove_a_spouse.3F'>How do I remove a spouse?</a>\n") % WIKI)
faq_dict.update(
{ 'faq_section' : "#How_do_I_change_the_order_of_spouses.3F" })
self.render_text(
_(" 1. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do I change the order of spouses?"
"%(html_end)s\n") % faq_dict )
faq_dict.update(
{ 'faq_section' : "#How_do_I_add_an_additional_spouse.3F" })
self.render_text(
_(" 2. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do I add an additional spouse?"
"%(html_end)s\n") % faq_dict )
faq_dict.update(
{ 'faq_section' : "#How_do_I_remove_a_spouse.3F" })
self.render_text(
_(" 3. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do I remove a spouse?"
"%(html_end)s\n") % faq_dict )
self.render_text("\n<b>%s</b>\n\n" % _("Backups and Updates"))
self.render_text(_(" 4. <a wiki='%s_-_FAQ#How_do_I_keep_backups.3F'>How do I make backups safely?</a>\n") % WIKI)
self.render_text(_(" 5. <a wiki='%s_-_FAQ#How_do_I_upgrade_GRAMPS.3F'>Is it necessary to update Gramps every time an update is released?</a>\n") % WIKI)
faq_dict.update(
{ 'faq_section' : "#How_do_I_keep_backups.3F" })
self.render_text(
_(" 4. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do I make backups safely?"
"%(html_end)s\n") % faq_dict )
faq_dict.update(
{ 'faq_section' : "#How_do_I_upgrade_GRAMPS.3F" })
self.render_text(
_(" 5. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"Is it necessary to update Gramps "
"every time an update is released?"
"%(html_end)s\n") % faq_dict )
self.render_text("\n<b>%s</b>\n\n" % _("Data Entry"))
self.render_text(_(" 6. <a wiki='%s_-_Entering_and_Editing_Data:_Detailed_-_part_1#Editing_Information_About_Relationships'>How should information about marriages be entered?</a>\n") % WIKI)
self.render_text(_(" 7. <a wiki='%s_-_FAQ#What_is_the_difference_between_a_residence_and_an_address.3F'>What's the difference between a residence and an address?</a>\n") % WIKI)
faq_dict.update( { 'section' :
"Entering_and_Editing_Data:_Detailed_-_part_1"
"#Editing_Information_About_Relationships" })
self.render_text(
_(" 6. %(gramps_manual_html_start)s%(section)s%(html_middle)s"
"How should information about marriages be entered?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'faq_section' :
"#What_is_the_difference_"
"between_a_residence_and_an_address.3F" })
self.render_text(
_(" 7. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"What's the difference between a residence and an address?"
"%(html_end)s\n") % faq_dict )
self.render_text("\n<b>%s</b>\n\n" % _("Media Files"))
self.render_text(_(" 8. <a wiki='%s_-_FAQ#How_do_you_add_photos_to_an_item.3F'>How do you add a photo of a person/source/event?</a>\n") % WIKI)
self.render_text(_(" 9. <a wiki='%s_-_FAQ#How_do_you_find_unused_media_objects.3F'>How do you find unused media objects?</a>\n") % WIKI)
faq_dict.update(
{ 'faq_section' : "#How_do_you_add_photos_to_an_item.3F" })
self.render_text(
_(" 8. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do you add a photo of a person/source/event?"
"%(html_end)s\n") % faq_dict )
faq_dict.update(
{ 'faq_section' : "#How_do_you_find_unused_media_objects.3F" })
self.render_text(
_(" 9. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How do you find unused media objects?"
"%(html_end)s\n") % faq_dict )
self.render_text("\n<b>%s</b>\n\n" % _("Miscellaneous"))
self.render_text(_(" 10. <a wiki='%s_-_FAQ#How_can_I_publish_web_sites_generated_by_GRAMPS.3F'>How can I make a website with Gramps and my tree?</a>\n") % WIKI)
self.render_text(_(" 11. <a href='http://sourceforge.net/mailarchive/message.php?msg_id=21487967'>How do I record one's occupation?</a>\n"))
self.render_text(_(" 12. <a wiki='%s_-_FAQ#What_do_I_do_if_I_have_found_a_bug.3F'>What do I do if I have found a bug?</a>\n") % WIKI)
self.render_text(_(" 13. <a wiki='Portal:Using_GRAMPS'>Is there a manual for Gramps?</a>\n"))
self.render_text(_(" 14. <a wiki='Category:Tutorials'>Are there tutorials available?</a>\n"))
self.render_text(_(" 15. <a wiki='Category:How_do_I...'>How do I ...?</a>\n"))
self.render_text(_(" 16. <a wiki='How_you_can_help'>How can I help with Gramps?</a>\n"))
faq_dict.update( { 'faq_section' :
"#How_can_I_publish_web_sites_"
"generated_by_GRAMPS.3F" })
self.render_text(
_(" 10. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"How can I make a website with Gramps and my tree?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'web_html_start' :
"<a href='http://sourceforge.net/mailarchive"
"/message.php?msg_id=21487967" })
self.render_text(
_(" 11. %(web_html_start)s%(html_middle)s"
"How do I record one's occupation?"
"%(html_end)s\n") % faq_dict )
faq_dict.update(
{ 'faq_section' : "#What_do_I_do_if_I_have_found_a_bug.3F" })
self.render_text(
_(" 12. %(gramps_FAQ_html_start)s%(faq_section)s%(html_middle)s"
"What do I do if I have found a bug?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'section' : "Portal:Using_GRAMPS" })
self.render_text(
_(" 13. %(gramps_wiki_html_start)s%(section)s%(html_middle)s"
"Is there a manual for Gramps?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'section' : "Category:Tutorials" })
self.render_text(
_(" 14. %(gramps_wiki_html_start)s%(section)s%(html_middle)s"
"Are there tutorials available?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'section' : "Category:How_do_I..." })
self.render_text(
_(" 15. %(gramps_wiki_html_start)s%(section)s%(html_middle)s"
"How do I ...?"
"%(html_end)s\n") % faq_dict )
faq_dict.update( { 'section' : "How_you_can_help" })
self.render_text(
_(" 16. %(gramps_wiki_html_start)s%(section)s%(html_middle)s"
"How can I help with Gramps?"
"%(html_end)s\n") % faq_dict )
self.append_text("", scroll_to='begin')
def post_init(self):

View File

@ -410,12 +410,15 @@ else:
from gramps.gen.constfunc import has_display
if has_display():
from gramps.gui.dialog import MessageHideDialog
from gramps.gen.const import URL_WIKISTRING
gexiv2_dict = { 'gramps_wiki_build_gexiv2_url' :
URL_WIKISTRING +
"GEPS_029:_GTK3-GObject_introspection"
"_Conversion#GExiv2_for_Image_metadata" }
title = _("GExiv2 module not loaded.")
message = _("Image metadata functionality will not be available.\n"
"To build it for Gramps see "
"http://www.gramps-project.org/wiki/index.php?"
"title=GEPS_029:_GTK3-GObject_introspection"
"_Conversion#GExiv2_for_Image_metadata")
"%(gramps_wiki_build_gexiv2_url)s" % gexiv2_dict )
MessageHideDialog(title, message, 'interface.ignore-gexiv2')
register(GRAMPLET,

View File

@ -29,7 +29,7 @@ from gi.repository import Gtk
# GRAMPS modules
#
#------------------------------------------------------------------------
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE, URL_HOMEPAGE
from gramps.gen.plug import Gramplet
from gramps.gui.widgets.styledtexteditor import StyledTextEditor
from gramps.gui.widgets import SimpleButton
@ -107,13 +107,15 @@ class WelcomeGramplet(Gramplet):
' Although similar to other genealogical programs, Gramps offers '
'some unique and powerful features.\n\n')
welcome += boldst(_('Links')) + '\n\n'
welcome += linkst(_('Home Page'), _('http://gramps-project.org/')) + '\n'
welcome += linkst(_('Home Page'), URL_HOMEPAGE) + '\n'
welcome += linkst(_('Start with Genealogy and Gramps'),
_('http://www.gramps-project.org/wiki/index.php?title=Start_with_Genealogy')) + '\n'
'%(gramps_wiki_url)sStart_with_Genealogy' %
{'gramps_wiki_url': URL_WIKISTRING} ) + '\n'
welcome += linkst(_('Gramps online manual'),
URL_WIKISTRING + URL_MANUAL_PAGE + _('locale_suffix|')) + '\n'
welcome += linkst(_('Ask questions on gramps-users mailing list'),
_('http://gramps-project.org/contact/')) + '\n\n'
'%(gramps_home_url)scontact/' %
{'gramps_home_url': URL_HOMEPAGE} ) + '\n\n'
welcome += boldst(_('Who makes Gramps?')) + '\n\n' + _(
'Gramps is created by genealogists for genealogists, organized in the'

View File

@ -35,6 +35,7 @@ LOG = logging.getLogger(".Db")
#-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
from gramps.gen.const import URL_WIKISTRING
#-------------------------------------------------------------------------
#
@ -53,19 +54,22 @@ _DBVERSION = 14
#
#-------------------------------------------------------------------------
def importData(database, filename, user):
migrate_dict = { 'gramps_wiki_migrate_two_to_three_url' :
URL_WIKISTRING +
"Gramps_3.4_Wiki_Manual_-_Manage_Family_Trees#"
"Moving_a_Gramps_2.2_databases_to_Gramps_3.x" }
user.notify_error(_("%s could not be opened") % filename,
_("The Database version is not supported "
"by this version of Gramps."
"You should use an old copy of Gramps at "
"version 3.0.x and import your database into "
"that version. You should then export a copy "
"of your data to Gramps XML (Family Tree). "
"Then you should upgrade to the latest "
"version of Gramps (for example this version), "
"create a new empty database and import the "
"Gramps XML into that version. "
"Please refer to:"
"http://www.gramps-project.org/wiki/index.php?"
"title=Gramps_3.4_Wiki_Manual_-_Manage_Family_Trees#"
"Moving_a_Gramps_2.2_databases_to_Gramps_3.x"))
_("The Database version is not supported "
"by this version of Gramps."
"You should use an old copy of Gramps at "
"version 3.0.x and import your database into "
"that version. You should then export a copy "
"of your data to Gramps XML (Family Tree). "
"Then you should upgrade to the latest "
"version of Gramps (for example this version), "
"create a new empty database and import the "
"Gramps XML into that version. "
"Please refer to:"
"%(gramps_wiki_migrate_two_to_three_url)s" ) %
migrate_dict )
return

View File

@ -34,6 +34,7 @@ import sys
import time
from xml.parsers.expat import ExpatError, ParserCreate
from xml.sax.saxutils import escape
from gramps.gen.const import URL_WIKISTRING
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
import re
@ -1045,12 +1046,11 @@ class GrampsParser(UpdateCallback):
"recent version %(newgramps)s.\n\n"
"The file will not be imported. Please use an older version"
" of Gramps that supports version %(xmlversion)s of the "
"xml.\nSee\n "
"http://gramps-project.org/wiki/index.php?title=GRAMPS_XML"
"\n for more info."
"xml.\nSee\n %(gramps_wiki_xml_url)s\n for more info."
) % {'oldgramps': self.__gramps_version,
'newgramps': VERSION,
'xmlversion': xmlversion_str,
'gramps_wiki_xml_url': URL_WIKISTRING + "GRAMPS_XML" ,
}
raise GrampsImportError(_('The file will not be imported'), msg)
elif self.__xml_version < (1, 1, 0):
@ -1061,11 +1061,11 @@ class GrampsParser(UpdateCallback):
"the event of problems, please submit a bug and use an "
"older version of Gramps in the meantime to import this "
"file, which is version %(xmlversion)s of the xml.\nSee\n "
"http://gramps-project.org/wiki/index.php?title=GRAMPS_XML"
"\nfor more info."
"%(gramps_wiki_xml_url)s\nfor more info."
) % {'oldgramps': self.__gramps_version,
'newgramps': VERSION,
'xmlversion': xmlversion_str,
'gramps_wiki_xml_url': URL_WIKISTRING + "GRAMPS_XML" ,
}
self.user.warn(_('Old xml file'), msg)

View File

@ -20,20 +20,6 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
#------------------------------------------------------------------------
#
# Html
#
#------------------------------------------------------------------------
from __future__ import print_function
#------------------------------------------------------------------------
# Python modules
#------------------------------------------------------------------------
import re
from gramps.gen.constfunc import STRTYPE, cuni
"""
HTML operations.
@ -43,12 +29,20 @@ This module exports the Html class
__all__ = ['Html']
from __future__ import print_function
#------------------------------------------------------------------------
# Python modules
#------------------------------------------------------------------------
import re
#------------------------------------------------------------------------
#
# GRAMPS modules
#
#------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale
from gramps.gen.constfunc import STRTYPE, cuni
#------------------------------------------------------------------------
#
# Constants

View File

@ -918,13 +918,16 @@ class GeoGraphyView(OsmGps, NavigationView):
from gramps.gui.dialog import WarningDialog
WarningDialog(
_('You have at least two places with the same title.'),
_("The title of the places is :\n"
"<b>%(title)s</b>\n"
"The following places are similar : %(gid)s\n"
"Eiher you rename the places either you merge them."
"\n\n<b>I can't proceed your request</b>.\n") % {
'title': place.get_title(),
'gid': gids}
_("The title of the places is:\n%(title)s\n"
"The following places are similar: %(gid)s\n"
"You should eiher rename the places or merge them.\n\n"
"%(bold_start)s"
"I can't proceed with your request"
"%(bold_end)s.\n") % {
'bold_start' : '<b>',
'bold_end' : '</b>',
'title': '<b>' + place.get_title() + '</b>',
'gid': gids}
)
else:
self.mark = [None, None, None, None, None, None, None,

View File

@ -228,7 +228,8 @@ class IntroductionPage(Gtk.VBox):
"The Gramps media object is a collection of data about "
"the media object file: its filename and/or path, its "
"description, its ID, notes, source references, etc. "
"These data <b>do not include the file itself</b>.\n\n"
"These data "
"%(bold_start)do not include the file itself%(bold_end)s.\n\n"
"The files containing image, sound, video, etc, exist "
"separately on your hard drive. These files are "
"not managed by Gramps and are not included in the Gramps "
@ -238,7 +239,9 @@ class IntroductionPage(Gtk.VBox):
"your Gramps database. If you want to move or rename "
"the files then you need to do it on your own, outside of "
"Gramps. Then you can adjust the paths using this tool so "
"that the media objects store the correct file locations.")
"that the media objects store the correct file locations."
) % { 'bold_start' : '<b>' ,
'bold_end' : '</b>' }
class SelectionPage(Gtk.VBox):
"""

View File

@ -61,12 +61,15 @@ if not OSMGPSMAP:
from gramps.gen.constfunc import has_display
if has_display():
from gramps.gui.dialog import MessageHideDialog
from gramps.gen.const import URL_WIKISTRING
osmgps_dict = { 'gramps_wiki_build_osmgps_url' :
URL_WIKISTRING +
"GEPS_029:_GTK3-GObject_introspection"
"_Conversion#OsmGpsMap_for_Geography" }
title = _("OsmGpsMap module not loaded.")
message = _("Geography functionality will not be available.\n"
"To build it for Gramps see "
"http://www.gramps-project.org/wiki/index.php?"
"title=GEPS_029:_GTK3-GObject_introspection_Conversion"
"#OsmGpsMap_for_Geography")
"%(gramps_wiki_build_osmgps_url)s") % osmgps_dict
MessageHideDialog(title, message, 'interface.ignore-osmgpsmap')
else:
# Load the view only if osmgpsmap library is present.

View File

@ -62,7 +62,7 @@ from gramps.gui.views.bookmarks import PersonBookmarks
from gramps.gen.utils.file import get_empty_tempdir
from gramps.gen.constfunc import lin, mac, win
from gramps.gen.config import config
from gramps.gen.const import TEMP_DIR
from gramps.gen.const import TEMP_DIR, URL_HOMEPAGE
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
@ -543,16 +543,16 @@ class HtmlView(NavigationView):
<title>%(title)s</title>
</head>
<body >
<H4>%(content)s</H4>
<H4>%(content)s%(gramps_home_url)s</H4>
</body>
</html>
""" % { 'height' : 600,
'title' : _('Start page for the Html View'),
'content': _('Type a webpage address at the top, and hit'
' the execute button to load a webpage in this'
' page\n<br>\n'
'For example: <b>http://gramps-project.org</p>')
}
' page\n<br>\nFor example: '),
'gramps_home_url' : "<b>%s</b>" % URL_HOMEPAGE
}
filename = os.path.join(tmpdir, 'startpage.html')
# Now we have two views : Web and Geography, we need to create the
# startpage only once.

View File

@ -1597,11 +1597,13 @@ class BasePage(object):
# attach note
user_footer += note
msg = _('Generated by <a href = "%(homepage)s">'
'Gramps</a> %(version)s on %(date)s') % {
'date': _dd.display(Today()),
'homepage' : URL_HOMEPAGE,
'version': VERSION}
msg = _('Generated by %(gramps_home_html_start)s'
'Gramps%(html_end)s %(version)s on %(date)s'
) % {'gramps_home_html_start' :
'<a href="' + URL_HOMEPAGE + '">' ,
'html_end' : '</a>' ,
'version' : VERSION ,
'date' : _dd.display(Today()) }
# optional "link-home" feature; see bug report #2736
if self.report.options['linkhome']:
@ -1611,8 +1613,13 @@ class BasePage(object):
center_person.handle, "ppl", self.up)
person_name = self.get_name(center_person)
msg += _('<br />Created for <a href = "%(url)s">%(name)s</a>') % {
'url': center_person_url, 'name': person_name}
msg += _('%(http_break)sCreated for %(url_start)s'
'%(name)s%(url_end)s') % {
'http_break' : '<br />' ,
'url_start' :
'<a href="' + center_person_url + '">' ,
'url_end' : '</a>' ,
'name' : person_name }
# creation author
footer += Html("p", msg, id = 'createdate')
@ -2878,8 +2885,10 @@ class SurnamePage(BasePage):
# feature request 2356: avoid genitive form
msg = _("This page contains an index of all the individuals in the "
"database with the surname of %s. Selecting the person&#8217;s name "
"will take you to that person&#8217;s individual page.") % html_escape(surname)
"database with the surname of %s. "
"Selecting the person&#8217;s name "
"will take you to that person&#8217;s "
"individual page.") % html_escape(surname)
surnamedetail += Html("p", msg, id = "description")
# begin surname table and thead
@ -3058,9 +3067,12 @@ class FamilyPages(BasePage):
body +=relationlist
# Families list page message
msg = _("This page contains an index of all the families/ relationships in the "
"database, sorted by their family name/ surname. Clicking on a person&#8217;s "
"name will take you to their family/ relationship&#8217;s page.")
msg = _("This page contains an index of all the "
"families/ relationships in the "
"database, sorted by their family name/ surname. "
"Clicking on a person&#8217;s "
"name will take you to their "
"family/ relationship&#8217;s page.")
relationlist += Html("p", msg, id = "description")
# go through all the families, and construct a dictionary of all the
@ -3337,7 +3349,8 @@ class PlacePages(BasePage):
# place list page message
msg = _("This page contains an index of all the places in the "
"database, sorted by their title. Clicking on a place&#8217;s "
"database, sorted by their title. "
"Clicking on a place&#8217;s "
"title will take you to that place&#8217;s page.")
placelist += Html("p", msg, id = "description")
@ -4182,7 +4195,8 @@ class SourcePages(BasePage):
keys = sorted(source_dict, key=SORT_KEY)
msg = _("This page contains an index of all the sources in the "
"database, sorted by their title. Clicking on a source&#8217;s "
"database, sorted by their title. "
"Clicking on a source&#8217;s "
"title will take you to that source&#8217;s page.")
sourceslist += Html("p", msg, id = "description")
@ -4394,8 +4408,10 @@ class MediaPages(BasePage):
msg = _("This page contains an index of all the media objects "
"in the database, sorted by their title. Clicking on "
"the title will take you to that media object&#8217;s page. "
"If you see media size dimensions above an image, click on the "
"the title will take you to that "
"media object&#8217;s page. "
"If you see media size dimensions "
"above an image, click on the "
"image to see the full sized version. ")
medialist += Html("p", msg, id = "description")
@ -4526,9 +4542,15 @@ class MediaPages(BasePage):
mediadetail += medianav
if prev:
medianav += self.media_nav_link(prev, _("Previous"), True)
data = _('<strong id = "GalleryCurrent">%(page_number)d</strong> of '
'<strong id = "GalleryTotal">%(total_pages)d</strong>' ) % {
'page_number' : page_number, 'total_pages' : total_pages }
data = _('%(strong1_start)s%(page_number)d%(strong_end)s of '
'%(strong2_start)s%(total_pages)d%(strong_end)s'
) % { 'strong1_start' :
'<strong id = "GalleryCurrent">' ,
'strong2_start' :
'<strong id = "GalleryTotal">' ,
'strong_end' : '</strong>' ,
'page_number' : page_number,
'total_pages' : total_pages }
medianav += Html("span", data, id = "GalleryPages")
if next:
medianav += self.media_nav_link(next, _("Next"), True)
@ -4794,10 +4816,13 @@ class ThumbnailPreviewPage(BasePage):
with Html("div", class_ ="content", id ="Preview") as previewpage:
body += previewpage
msg = _("This page displays a indexed list of all the media objects "
"in this database. It is sorted by media title. There is an index "
"of all the media objects in this database. Clicking on a thumbnail "
"will take you to that image&#8217;s page.")
msg = _("This page displays a indexed list "
"of all the media objects "
"in this database. It is sorted by media title. "
"There is an index "
"of all the media objects in this database. "
"Clicking on a thumbnail "
"will take you to that image&#8217;s page.")
previewpage += Html("p", msg, id ="description")
with Html("table", class_ ="calendar") as table:
@ -4969,12 +4994,16 @@ class DownloadPage(BasePage):
with Html("div", class_ = "content", id = "Download") as download:
body += download
msg = _("This page is for the user/ creator of this Family Tree/ "
"Narrative website to share a couple of files with you "
"regarding their family. If there are any files listed "
"below, clicking on them will allow you to download them. The "
"download page and files have the same copyright as the remainder "
"of these web pages.")
msg = _("This page is for the user/ creator "
"of this Family Tree/ Narrative website "
"to share a couple of files with you "
"regarding their family. If there are "
"any files listed "
"below, clicking on them will allow you "
"to download them. The "
"download page and files have the same "
"copyright as the remainder "
"of these web pages.")
download += Html("p", msg, id = "description")
# begin download table and table head
@ -5186,9 +5215,11 @@ class PersonPages(BasePage):
body += individuallist
# Individual List page message
msg = _("This page contains an index of all the individuals in the "
"database, sorted by their last names. Selecting the person&#8217;s "
"name will take you to that person&#8217;s individual page.")
msg = _("This page contains an index of all the individuals in "
"the database, sorted by their last names. "
"Selecting the person&#8217;s "
"name will take you to that "
"person&#8217;s individual page.")
individuallist += Html("p", msg, id = "description")
# add alphabet navigation
@ -5253,8 +5284,10 @@ class PersonPages(BasePage):
tcell += Html(
"a", html_escape(surname), name = letter,
id_ = letter,
title = _("Surnames %(surname)s beginning with letter %(letter)s") %
{'surname' : surname, 'letter' : letter})
title = _("Surnames %(surname)s beginning "
"with letter %(letter)s") %
{'surname' : surname,
'letter' : letter})
elif first_surname:
first_surname = False
tcell += Html("a", html_escape(surname),
@ -5674,11 +5707,15 @@ class PersonPages(BasePage):
self.get_name(person)), inline=True)
# page description
msg = _("This map page represents that person and any descendants with "
msg = _("This map page represents that person "
"and any descendants with "
"all of their event/ places. If you place your mouse over "
"the marker it will display the place name. The markers and the Reference "
"list are sorted in date order (if any?). Clicking on a place&#8217;s "
"name in the Reference section will take you to that place&#8217;s page.")
"the marker it will display the place name. "
"The markers and the Reference "
"list are sorted in date order (if any?). "
"Clicking on a place&#8217;s "
"name in the Reference section will take you "
"to that place&#8217;s page.")
mapdetail += Html("p", msg, id = "description")
# this is the style element where the Map is held in the CSS...
@ -6566,9 +6603,11 @@ class RepositoryPages(BasePage):
with Html("div", class_ = "content", id = "RepositoryList") as repositorylist:
body += repositorylist
msg = _("This page contains an index of all the repositories in the "
"database, sorted by their title. Clicking on a repositories&#8217;s "
"title will take you to that repositories&#8217;s page.")
msg = _("This page contains an index of "
"all the repositories in the "
"database, sorted by their title. "
"Clicking on a repositories&#8217;s "
"title will take you to that repositories&#8217;s page.")
repositorylist += Html("p", msg, id = "description")
# begin repositories table and table head
@ -6699,11 +6738,11 @@ class AddressBookListPage(BasePage):
body += addressbooklist
# Address Book Page message
msg = _("This page contains an index of all the individuals in the "
"database, sorted by their surname, with one of the "
"following: Address, Residence, or Web Links. Selecting the "
"person&#8217;s name will take you to their individual Address "
"Book page.")
msg = _("This page contains an index of all the individuals in "
"the database, sorted by their surname, with one of the "
"following: Address, Residence, or Web Links. "
"Selecting the person&#8217;s name will take you "
"to their individual Address Book page.")
addressbooklist += Html("p", msg, id = "description")
# begin Address Book table
@ -6953,8 +6992,9 @@ class NavWebReport(Report):
elif not os.path.isdir(dir_name):
parent_dir = os.path.dirname(dir_name)
if not os.path.isdir(parent_dir):
msg = _("Neither %(current)s nor %(parent)s are directories") % \
{'current': dir_name, 'parent': parent_dir}
msg = _("Neither %(current)s nor %(parent)s "
"are directories") % {
'current': dir_name, 'parent': parent_dir }
self.user.notify_error(msg)
return
else:
@ -8058,7 +8098,8 @@ class NavWebOptions(MenuReportOptions):
self.__navigation = EnumeratedListOption(_("Navigation Menu Layout"), _nav_opts[0][1])
for layout in _nav_opts:
self.__navigation.add_item(layout[1], layout[0])
self.__navigation.set_help(_("Choose which layout for the Navigation Menus."))
self.__navigation.set_help(_("Choose which layout "
"for the Navigation Menus."))
addopt("navigation", self.__navigation)
self.__stylesheet_changed()
@ -8067,15 +8108,18 @@ class NavWebOptions(MenuReportOptions):
(_("Normal Outline Style"), "Outline"),
(_("Drop-Down -- WebKit Browsers Only"), "DropDown")
]
self.__citationreferents = EnumeratedListOption(_("Citation Referents Layout"), _cit_opts[0][1])
self.__citationreferents = EnumeratedListOption(
_("Citation Referents Layout"), _cit_opts[0][1])
for layout in _cit_opts:
self.__citationreferents.add_item(layout[1], layout[0])
self.__citationreferents.set_help(_("Determine the default layout for the "
"Source Page's Citation Referents section"))
self.__citationreferents.set_help(
_("Determine the default layout for the "
"Source Page's Citation Referents section"))
addopt("citationreferents", self.__citationreferents)
self.__ancestortree = BooleanOption(_("Include ancestor's tree"), True)
self.__ancestortree.set_help(_('Whether to include an ancestor graph on each individual page'))
self.__ancestortree.set_help(_('Whether to include an ancestor '
'graph on each individual page'))
addopt( "ancestortree", self.__ancestortree )
self.__ancestortree.connect('value-changed', self.__graph_changed)
@ -8131,15 +8175,20 @@ class NavWebOptions(MenuReportOptions):
footernote.set_help( _("A note to be used as the page footer"))
addopt( "footernote", footernote )
self.__gallery = BooleanOption(_("Include images and media objects"), True)
self.__gallery.set_help(_('Whether to include a gallery of media objects'))
self.__gallery = BooleanOption(_("Include images and media objects"),
True)
self.__gallery.set_help(_('Whether to include '
'a gallery of media objects'))
addopt( "gallery", self.__gallery )
self.__gallery.connect('value-changed', self.__gallery_changed)
self.__create_thumbs_only = BooleanOption(_("Create and only use thumbnail- sized images"), False)
self.__create_thumbs_only.set_help(_("This option allows you to create only thumbnail images "
"instead of the full-sized images on the Media Page. This will allow you to have a much "
"smaller total upload size to your web hosting site."))
self.__create_thumbs_only = BooleanOption(
_("Create and only use thumbnail- sized images"), False)
self.__create_thumbs_only.set_help(
_("This option allows you to create only thumbnail images "
"instead of the full-sized images on the Media Page. "
"This will allow you to have a much "
"smaller total upload size to your web hosting site."))
addopt("create_thumbs_only", self.__create_thumbs_only)
self.__create_thumbs_only.connect("value-changed", self.__gallery_changed)
@ -8213,7 +8262,8 @@ class NavWebOptions(MenuReportOptions):
self.__down_fname1.set_help(_("File to be used for downloading of database"))
addopt( "down_fname1", self.__down_fname1 )
self.__dl_descr1 = StringOption(_("Description for download"), _('Smith Family Tree'))
self.__dl_descr1 = StringOption(_("Description for download"),
_('Smith Family Tree'))
self.__dl_descr1.set_help(_('Give a description for this file.'))
addopt( "dl_descr1", self.__dl_descr1 )
@ -8222,7 +8272,8 @@ class NavWebOptions(MenuReportOptions):
self.__down_fname2.set_help(_("File to be used for downloading of database"))
addopt( "down_fname2", self.__down_fname2 )
self.__dl_descr2 = StringOption(_("Description for download"), _('Johnson Family Tree'))
self.__dl_descr2 = StringOption(_("Description for download"),
_('Johnson Family Tree'))
self.__dl_descr2.set_help(_('Give a description for this file.'))
addopt( "dl_descr2", self.__dl_descr2 )
@ -8235,7 +8286,8 @@ class NavWebOptions(MenuReportOptions):
category_name = _("Advanced Options")
addopt = partial(menu.add_option, category_name)
encoding = EnumeratedListOption(_('Character set encoding'), _CHARACTER_SETS[0][1] )
encoding = EnumeratedListOption(_('Character set encoding'),
_CHARACTER_SETS[0][1] )
for eopt in _CHARACTER_SETS:
encoding.add_item(eopt[1], eopt[0])
encoding.set_help( _("The encoding to be used for the web files"))
@ -8254,7 +8306,7 @@ class NavWebOptions(MenuReportOptions):
addopt( "showdeath", showdeath )
showpartner = BooleanOption(_("Include a column for partners on the "
"index pages"), False)
"index pages"), False)
showpartner.set_help(_('Whether to include a partners column'))
menu.add_option(category_name, 'showpartner', showpartner)
@ -8264,7 +8316,7 @@ class NavWebOptions(MenuReportOptions):
addopt( "showparents", showparents )
showallsiblings = BooleanOption(_("Include half and/ or "
"step-siblings on the individual pages"), False)
"step-siblings on the individual pages"), False)
showallsiblings.set_help(_( "Whether to include half and/ or "
"step-siblings with the parents and siblings"))
addopt('showhalfsiblings', showallsiblings)
@ -8310,7 +8362,7 @@ class NavWebOptions(MenuReportOptions):
for trans, opt in mapopts:
self.__mapservice.add_item(opt, trans)
self.__mapservice.set_help(_("Choose your choice of map service for "
"creating the Place Map Pages."))
"creating the Place Map Pages."))
self.__mapservice.connect("value-changed", self.__placemap_options)
addopt("mapservice", self.__mapservice)
@ -8321,7 +8373,8 @@ class NavWebOptions(MenuReportOptions):
addopt("placemappages", self.__placemappages)
self.__familymappages = BooleanOption(_("Include Family Map Pages with "
"all places shown on the map"), False)
"all places shown on the map"),
False)
self.__familymappages.set_help(_("Whether or not to add an individual page map "
"showing all the places on this page. "
"This will allow you to see how your family "

View File

@ -463,9 +463,13 @@ class WebCalReport(Report):
# Created for ?
msg = None
if self.author and self.email:
msg = _('Created for <a href="mailto:%(email)s?'
'subject=WebCal">%(author)s</a>') % {'email' : self.email,
'author' : self.author}
msg = _('the "WebCal" will be the potential-email Subject|'
'Created for %(html_email_author_start)s'
'WebCal%(html_email_author_end)s') % {
'html_email_author_start' :
'<a href="mailto:' + self.email + '?subject=' ,
'html_email_author_end' :
'">' + self.author + '</a>' }
elif self.author:
msg = _('Created for %(author)s') % {'author' : self.author}
@ -1201,8 +1205,12 @@ class WebCalReport(Report):
with Html("div", id = "footer", role = "Footer-End") as footer:
# Display date as user set in preferences
msg = _('Generated by <a href="http://gramps-project.org">'
'Gramps</a> on %(date)s') % {'date' : _dd.display(Today())}
msg = _('Generated by %(gramps_home_html_start)s'
'Gramps%(html_end)s on %(date)s') % {
'gramps_home_html_start' :
'<a href="' + URL_HOMEPAGE + '">' ,
'html_end' : '</a>' ,
'date' : _dd.display(Today()) }
footer += Html("p", msg, id = 'createdate')
copy_nr = self.copy