diff --git a/gramps/gen/config.py b/gramps/gen/config.py
index 006db5ba8..ede7d7d9a 100644
--- a/gramps/gen/config.py
+++ b/gramps/gen/config.py
@@ -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)
diff --git a/gramps/gen/const.py b/gramps/gen/const.py
index 3bf2c47c0..fca6cc248 100644
--- a/gramps/gen/const.py
+++ b/gramps/gen/const.py
@@ -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"
diff --git a/gramps/gen/db/exceptions.py b/gramps/gen/db/exceptions.py
index 6c9f38749..776149b2b 100644
--- a/gramps/gen/db/exceptions.py
+++ b/gramps/gen/db/exceptions.py
@@ -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 newer version of Gramps and '
- ''
- 'make a backup 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' : '' ,
+ 'html_end' : '' ,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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 newer version of Gramps and '
- ''
- 'make a backup 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' : '' ,
+ 'html_end' : '' ,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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 old version of Gramps and '
- ''
- 'make a backup 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' : '' ,
+ 'html_end' : '' ,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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 '
- 'backup '
- 'or export '
- '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 old version of Gramps and '
- 'make a backup '
- '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' : '' ,
+ 'html_end' : '' ,
+ 'gramps_manual' : URL_MANUAL_PAGE,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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 newer version of Gramps and '
- ''
- 'make a backup 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' : '' ,
+ 'html_end' : '' ,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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 '
- 'backup '
- 'or export '
- '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 old version of Gramps and '
- 'make a backup '
- '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' : '' ,
+ 'html_end' : '' ,
+ 'gramps_manual' : URL_MANUAL_PAGE,
+ 'bold_start' : '' ,
+ 'bold_end' : '' ,
+ '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'))
diff --git a/gramps/gen/plug/_gramplet.py b/gramps/gen/plug/_gramplet.py
index f2ba8e1c7..8b3c4bb36 100644
--- a/gramps/gen/plug/_gramplet.py
+++ b/gramps/gen/plug/_gramplet.py
@@ -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.
diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py
index 459eae02c..86d80b306 100644
--- a/gramps/gui/configure.py
+++ b/gramps/gui/configure.py
@@ -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,
diff --git a/gramps/gui/dbman.py b/gramps/gui/dbman.py
index b3e1d31e5..b95945171 100644
--- a/gramps/gui/dbman.py
+++ b/gramps/gui/dbman.py
@@ -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 Proceed, Gramps will attempt to recover your Family Tree"
-" from the last good backup. There are several ways this can cause unwanted"
-" effects, so backup 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"
-"Details: 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 need_recover 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' : '' ,
+ 'bold_end' : '' ,
+ 'recover_file' : 'need_recover' ,
+ 'gramps_wiki_url' : URL_WIKISTRING ,
+ 'dirname' : dirname },
_("Proceed, I have taken a backup"),
_("Stop"))
prompt = yes_no.run()
diff --git a/gramps/gui/dialog.py b/gramps/gui/dialog.py
index f0931a7ca..7d333b149 100644
--- a/gramps/gui/dialog.py
+++ b/gramps/gui/dialog.py
@@ -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):
diff --git a/gramps/gui/display.py b/gramps/gui/display.py
index 2cabfef23..b6c7d5d68 100644
--- a/gramps/gui/display.py
+++ b/gramps/gui/display.py
@@ -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
diff --git a/gramps/gui/editors/displaytabs/surnametab.py b/gramps/gui/editors/displaytabs/surnametab.py
index c7c5f7892..079b0a0c0 100644
--- a/gramps/gui/editors/displaytabs/surnametab.py
+++ b/gramps/gui/editors/displaytabs/surnametab.py
@@ -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=_('Multiple Surnames')):
+ top_label='%s' % _("Multiple Surnames") ):
self.obj = name
self.on_change = on_change
self.curr_col = -1
diff --git a/gramps/gui/grampsgui.py b/gramps/gui/grampsgui.py
index 35b6a3181..2f17275be 100644
--- a/gramps/gui/grampsgui.py
+++ b/gramps/gui/grampsgui.py
@@ -226,9 +226,12 @@ def _display_welcome_message():
"5) Save data in a format that is incompatible with the "
"official release.\n"
"\n"
- "BACKUP 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' : '',
+ 'bold_end' : '' } )
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.
-Gramps 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' : '' ,
+ 'bold_end' : '' } )
dbstate = DbState()
self.vm = ViewManager(dbstate,
diff --git a/gramps/gui/logger/_errorreportassistant.py b/gramps/gui/logger/_errorreportassistant.py
index cc43e3bab..ea254fc84 100644
--- a/gramps/gui/logger/_errorreportassistant.py
+++ b/gramps/gui/logger/_errorreportassistant.py
@@ -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 %s" %
(_("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)
diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py
index b78af0bf0..deef083ad 100644
--- a/gramps/gui/plug/report/_docreportdialog.py
+++ b/gramps/gui/plug/report/_docreportdialog.py
@@ -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='%s'%_("Paper Options"))
+ self.paper_label = Gtk.Label(label='%s' % _("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()
diff --git a/gramps/gui/plug/report/_graphvizreportdialog.py b/gramps/gui/plug/report/_graphvizreportdialog.py
index 83ba28471..422e32a9e 100644
--- a/gramps/gui/plug/report/_graphvizreportdialog.py
+++ b/gramps/gui/plug/report/_graphvizreportdialog.py
@@ -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='%s'%_("Paper Options"))
+ self.paper_label = Gtk.Label(label='%s' % _("Paper Options"))
self.paper_label.set_use_markup(True)
handler = self.options.handler
self.paper_frame = PaperFrame(
diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py
index d11a38a69..3187c193e 100644
--- a/gramps/gui/viewmanager.py
+++ b/gramps/gui/viewmanager.py
@@ -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})
diff --git a/gramps/plugins/docgen/odfdoc.py b/gramps/plugins/docgen/odfdoc.py
index 15b168031..6f8689320 100644
--- a/gramps/plugins/docgen/odfdoc.py
+++ b/gramps/plugins/docgen/odfdoc.py
@@ -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 = '''\
PT0S
- http://gramps-project.org
+ %(gramps_home_url)s
@@ -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()
diff --git a/gramps/plugins/export/exportxml.py b/gramps/plugins/export/exportxml.py
index d3858dd82..bb9b28e77 100644
--- a/gramps/plugins/export/exportxml.py
+++ b/gramps/plugins/export/exportxml.py
@@ -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('\n')
self.g.write('\n'
- % (libgrampsxml.GRAMPS_XML_VERSION,
+ '"%sxml/%s/grampsxml.dtd">\n'
+ % (libgrampsxml.GRAMPS_XML_VERSION, URL_HOMEPAGE,
libgrampsxml.GRAMPS_XML_VERSION))
- self.g.write('\n'
- % libgrampsxml.GRAMPS_XML_VERSION)
+ self.g.write('\n'
+ % (URL_HOMEPAGE, libgrampsxml.GRAMPS_XML_VERSION))
self.g.write(" \n")
self.g.write(' Frequently Asked Questions\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' : '' ,
+ 'bold_end' : '' ,
+ 'gramps_wiki_html_start' : "" ,
+ 'html_end' : '' }
+ 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%s\n\n" % _("Editing Spouses"))
- self.render_text(_(" 1. How do I change the order of spouses?\n") % WIKI)
- self.render_text(_(" 2. How do I add an additional spouse?\n") % WIKI)
- self.render_text(_(" 3. How do I remove a spouse?\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%s\n\n" % _("Backups and Updates"))
- self.render_text(_(" 4. How do I make backups safely?\n") % WIKI)
- self.render_text(_(" 5. Is it necessary to update Gramps every time an update is released?\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%s\n\n" % _("Data Entry"))
- self.render_text(_(" 6. How should information about marriages be entered?\n") % WIKI)
- self.render_text(_(" 7. What's the difference between a residence and an address?\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%s\n\n" % _("Media Files"))
- self.render_text(_(" 8. How do you add a photo of a person/source/event?\n") % WIKI)
- self.render_text(_(" 9. How do you find unused media objects?\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%s\n\n" % _("Miscellaneous"))
- self.render_text(_(" 10. How can I make a website with Gramps and my tree?\n") % WIKI)
- self.render_text(_(" 11. How do I record one's occupation?\n"))
- self.render_text(_(" 12. What do I do if I have found a bug?\n") % WIKI)
- self.render_text(_(" 13. Is there a manual for Gramps?\n"))
- self.render_text(_(" 14. Are there tutorials available?\n"))
- self.render_text(_(" 15. How do I ...?\n"))
- self.render_text(_(" 16. How can I help with Gramps?\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' :
+ "%(title)s\n"
- "The following places are similar : %(gid)s\n"
- "Eiher you rename the places either you merge them."
- "\n\nI can't proceed your request.\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' : '',
+ 'bold_end' : '',
+ 'title': '' + place.get_title() + '',
+ 'gid': gids}
)
else:
self.mark = [None, None, None, None, None, None, None,
diff --git a/gramps/plugins/tool/mediamanager.py b/gramps/plugins/tool/mediamanager.py
index 4d1e5e2d3..a48c9471c 100644
--- a/gramps/plugins/tool/mediamanager.py
+++ b/gramps/plugins/tool/mediamanager.py
@@ -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 do not include the file itself.\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' : '' ,
+ 'bold_end' : '' }
class SelectionPage(Gtk.VBox):
"""
diff --git a/gramps/plugins/view/geography.gpr.py b/gramps/plugins/view/geography.gpr.py
index 104ea64a2..a554de6b4 100644
--- a/gramps/plugins/view/geography.gpr.py
+++ b/gramps/plugins/view/geography.gpr.py
@@ -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.
diff --git a/gramps/plugins/view/htmlrenderer.py b/gramps/plugins/view/htmlrenderer.py
index b2ce42dc9..cd27b7377 100644
--- a/gramps/plugins/view/htmlrenderer.py
+++ b/gramps/plugins/view/htmlrenderer.py
@@ -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)s
- %(content)s
+ %(content)s%(gramps_home_url)s