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

""" % { '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
\n' - 'For example: http://gramps-project.org

') - } + ' page\n
\nFor example: '), + 'gramps_home_url' : "%s" % 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. diff --git a/gramps/plugins/webreport/narrativeweb.py b/gramps/plugins/webreport/narrativeweb.py index 6ff3c1a01..21e3e8bee 100644 --- a/gramps/plugins/webreport/narrativeweb.py +++ b/gramps/plugins/webreport/narrativeweb.py @@ -1597,11 +1597,13 @@ class BasePage(object): # attach note user_footer += note - msg = _('Generated by
' - 'Gramps %(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' : + '' , + 'html_end' : '' , + '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 += _('
Created for %(name)s') % { - 'url': center_person_url, 'name': person_name} + msg += _('%(http_break)sCreated for %(url_start)s' + '%(name)s%(url_end)s') % { + 'http_break' : '
' , + 'url_start' : + '' , + 'url_end' : '' , + '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’s name " - "will take you to that person’s individual page.") % html_escape(surname) + "database with the surname of %s. " + "Selecting the person’s name " + "will take you to that person’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’s " - "name will take you to their family/ relationship’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’s " + "name will take you to their " + "family/ relationship’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’s " + "database, sorted by their title. " + "Clicking on a place’s " "title will take you to that place’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’s " + "database, sorted by their title. " + "Clicking on a source’s " "title will take you to that source’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’s page. " - "If you see media size dimensions above an image, click on the " + "the title will take you to that " + "media object’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 = _('%(page_number)d of ' - '%(total_pages)d' ) % { - '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' : + '' , + 'strong2_start' : + '' , + 'strong_end' : '' , + '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’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’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’s " - "name will take you to that person’s individual page.") + msg = _("This page contains an index of all the individuals in " + "the database, sorted by their last names. " + "Selecting the person’s " + "name will take you to that " + "person’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’s " - "name in the Reference section will take you to that place’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’s " + "name in the Reference section will take you " + "to that place’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’s " - "title will take you to that repositories’s page.") + msg = _("This page contains an index of " + "all the repositories in the " + "database, sorted by their title. " + "Clicking on a repositories’s " + "title will take you to that repositories’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’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’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 " diff --git a/gramps/plugins/webreport/webcal.py b/gramps/plugins/webreport/webcal.py index 3ba54a4e7..6c9219e43 100644 --- a/gramps/plugins/webreport/webcal.py +++ b/gramps/plugins/webreport/webcal.py @@ -463,9 +463,13 @@ class WebCalReport(Report): # Created for ? msg = None if self.author and self.email: - msg = _('Created for %(author)s') % {'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' : + '' + self.author + '' } 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 ' - 'Gramps 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' : + '' , + 'html_end' : '' , + 'date' : _dd.display(Today()) } footer += Html("p", msg, id = 'createdate') copy_nr = self.copy