6403: Remove markup in translatable messages -- partial

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

View File

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

View File

@ -57,7 +57,8 @@ from ..version import VERSION, VERSION_TUPLE, major_version
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
URL_HOMEPAGE = "http://gramps-project.org/" URL_HOMEPAGE = "http://gramps-project.org/"
URL_MAILINGLIST = "http://sourceforge.net/mail/?group_id=25770" 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_WIKISTRING = "http://gramps-project.org/wiki/index.php?title="
URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version URL_MANUAL_PAGE = "Gramps_%s_Wiki_Manual" % major_version
WIKI_FAQ = "FAQ" WIKI_FAQ = "FAQ"

View File

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

View File

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

View File

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

View File

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

View File

@ -41,11 +41,11 @@ from gi.repository import GdkPixbuf
# Gramps modules # 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 from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = 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 from gramps.gen.constfunc import cuni
try: try:
@ -205,7 +205,8 @@ class RunDatabaseRepair(ErrorDialog):
'usually be resolved by running the "Check and Repair Database" ' 'usually be resolved by running the "Check and Repair Database" '
'tool.\n\nIf this problem continues to exist after running this ' 'tool.\n\nIf this problem continues to exist after running this '
'tool, please file a bug report at ' '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): class DBErrorDialog(ErrorDialog):
def __init__(self, msg, parent=None): def __init__(self, msg, parent=None):

View File

@ -18,13 +18,24 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # 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.const import URL_MANUAL_PAGE, URL_WIKISTRING
from gramps.gen.constfunc import is_quartz from gramps.gen.constfunc import is_quartz
from gramps.gen.config import config 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 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 #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 #completely, or first part, so pt_BR if Brazilian portugeze wiki manual, and

View File

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

View File

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

View File

@ -44,8 +44,9 @@ else:
# Gramps modules # 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 _ = glocale.translation.gettext
from gramps.gen.const import ICON, SPLASH, URL_BUGTRACKER
from gramps.gen.constfunc import get_env_var from gramps.gen.constfunc import get_env_var
from gramps.version import VERSION from gramps.version import VERSION
from ..display import display_help, display_url from ..display import display_help, display_url
@ -141,7 +142,7 @@ class ErrorReportAssistant(Gtk.Assistant):
""" """
Start a web browser to report the bug. 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): def _get_sys_information(self):
""" """
@ -556,7 +557,7 @@ class ErrorReportAssistant(Gtk.Assistant):
"%s <i>%s</i>" % "%s <i>%s</i>" %
(_("Use the two buttons below to first copy the bug report to the " (_("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 "), "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_alignment(0.01, 0.5)
label.set_padding(0, 4) label.set_padding(0, 4)
label.set_line_wrap(True) label.set_line_wrap(True)

View File

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

View File

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

View File

@ -82,7 +82,7 @@ from gramps.gen.relationship import get_relationship_calculator
from .displaystate import DisplayState, RecentDocsMenu from .displaystate import DisplayState, RecentDocsMenu
from gramps.gen.const import (HOME_DIR, ICON, URL_BUGTRACKER, URL_HOMEPAGE, from gramps.gen.const import (HOME_DIR, ICON, URL_BUGTRACKER, URL_HOMEPAGE,
URL_MAILINGLIST, URL_MANUAL_PAGE, URL_WIKISTRING, URL_MAILINGLIST, URL_MANUAL_PAGE, URL_WIKISTRING,
WIKI_EXTRAPLUGINS) WIKI_EXTRAPLUGINS, URL_BUGHOME)
from gramps.gen.constfunc import is_quartz, conv_to_unicode, uni_to_gui from gramps.gen.constfunc import is_quartz, conv_to_unicode, uni_to_gui
from gramps.gen.config import config from gramps.gen.config import config
from gramps.gen.errors import WindowActiveError 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' _('The plugin %(name)s did not load and reported an error.\n\n'
'%(error_msg)s\n\n' '%(error_msg)s\n\n'
'If you are unable to fix the fault yourself then you can ' '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' 'the plugin author (%(firstauthoremail)s).\n\n'
'If you do not want Gramps to try and load this plugin again, ' 'If you do not want Gramps to try and load this plugin again, '
'you can hide it by using the Plugin Manager on the ' 'you can hide it by using the Plugin Manager on the '
'Help menu.') % { 'Help menu.') % {
'name': pdata.name, 'name': pdata.name,
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if 'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...', pdata.authors_email else '...',
'error_msg': pmgr.get_fail_list()[-1][1][1]}) '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' _('The view %(name)s did not load and reported an error.\n\n'
'%(error_msg)s\n\n' '%(error_msg)s\n\n'
'If you are unable to fix the fault yourself then you can ' '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' 'the view author (%(firstauthoremail)s).\n\n'
'If you do not want Gramps to try and load this view again, ' 'If you do not want Gramps to try and load this view again, '
'you can hide it by using the Plugin Manager on the ' 'you can hide it by using the Plugin Manager on the '
'Help menu.') % { 'Help menu.') % {
'name': pdata.name, 'name': pdata.name,
'gramps_bugtracker_url' : URL_BUGHOME,
'firstauthoremail': pdata.authors_email[0] if 'firstauthoremail': pdata.authors_email[0] if
pdata.authors_email else '...', pdata.authors_email else '...',
'error_msg': lasterror}) 'error_msg': lasterror})

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -35,6 +35,7 @@ LOG = logging.getLogger(".Db")
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import GRAMPS_LOCALE as glocale from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext _ = glocale.translation.gettext
from gramps.gen.const import URL_WIKISTRING
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -53,6 +54,10 @@ _DBVERSION = 14
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def importData(database, filename, user): def importData(database, filename, user):
migrate_dict = { 'gramps_wiki_migrate_two_to_three_url' :
URL_WIKISTRING +
"Gramps_3.4_Wiki_Manual_-_Manage_Family_Trees#"
"Moving_a_Gramps_2.2_databases_to_Gramps_3.x" }
user.notify_error(_("%s could not be opened") % filename, user.notify_error(_("%s could not be opened") % filename,
_("The Database version is not supported " _("The Database version is not supported "
"by this version of Gramps." "by this version of Gramps."
@ -65,7 +70,6 @@ def importData(database, filename, user):
"create a new empty database and import the " "create a new empty database and import the "
"Gramps XML into that version. " "Gramps XML into that version. "
"Please refer to:" "Please refer to:"
"http://www.gramps-project.org/wiki/index.php?" "%(gramps_wiki_migrate_two_to_three_url)s" ) %
"title=Gramps_3.4_Wiki_Manual_-_Manage_Family_Trees#" migrate_dict )
"Moving_a_Gramps_2.2_databases_to_Gramps_3.x"))
return return

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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