Use Preferences -> Text -> Private Given name instead of hardcoded _('Living')
svn: r12847
This commit is contained in:
@ -39,6 +39,7 @@ from gettext import gettext as _
|
|||||||
from proxybase import ProxyDbBase
|
from proxybase import ProxyDbBase
|
||||||
from gen.lib import Date, Person, Name
|
from gen.lib import Date, Person, Name
|
||||||
from Utils import probably_alive
|
from Utils import probably_alive
|
||||||
|
import Config
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -63,7 +64,8 @@ class LivingProxyDb(ProxyDbBase):
|
|||||||
@param mode: The method for handling living people.
|
@param mode: The method for handling living people.
|
||||||
LivingProxyDb.MODE_EXCLUDE_ALL will remove living people altogether.
|
LivingProxyDb.MODE_EXCLUDE_ALL will remove living people altogether.
|
||||||
LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY will remove all information
|
LivingProxyDb.MODE_INCLUDE_LAST_NAME_ONLY will remove all information
|
||||||
and change their given name to "Living".
|
and change their given name to "[Living]" or what has been set in
|
||||||
|
Preferences -> Text.
|
||||||
LivingProxyDb.MODE_INCLUDE_FULL_NAME_ONLY will remove all information
|
LivingProxyDb.MODE_INCLUDE_FULL_NAME_ONLY will remove all information
|
||||||
but leave the entire name intact.
|
but leave the entire name intact.
|
||||||
@type mode: int
|
@type mode: int
|
||||||
@ -364,7 +366,7 @@ class LivingProxyDb(ProxyDbBase):
|
|||||||
def __restrict_person(self, person):
|
def __restrict_person(self, person):
|
||||||
"""
|
"""
|
||||||
Remove information from a person and replace the first name with
|
Remove information from a person and replace the first name with
|
||||||
"Living".
|
"[Living]" or what has been set in Preferences -> Text.
|
||||||
"""
|
"""
|
||||||
new_person = Person()
|
new_person = Person()
|
||||||
new_name = Name()
|
new_name = Name()
|
||||||
@ -376,7 +378,7 @@ class LivingProxyDb(ProxyDbBase):
|
|||||||
new_name.set_surname_prefix(old_name.get_surname_prefix())
|
new_name.set_surname_prefix(old_name.get_surname_prefix())
|
||||||
new_name.set_type(old_name.get_type())
|
new_name.set_type(old_name.get_type())
|
||||||
if self.mode == self.MODE_INCLUDE_LAST_NAME_ONLY:
|
if self.mode == self.MODE_INCLUDE_LAST_NAME_ONLY:
|
||||||
new_name.set_first_name(_(u'Living'))
|
new_name.set_first_name(Config.get(Config.PRIVATE_GIVEN_TEXT))
|
||||||
else: # self.mode == self.MODE_INCLUDE_FULL_NAME_ONLY
|
else: # self.mode == self.MODE_INCLUDE_FULL_NAME_ONLY
|
||||||
new_name.set_first_name(old_name.get_first_name())
|
new_name.set_first_name(old_name.get_first_name())
|
||||||
new_name.set_suffix(old_name.get_suffix())
|
new_name.set_suffix(old_name.get_suffix())
|
||||||
|
@ -52,6 +52,7 @@ import Utils
|
|||||||
from QuestionDialog import ErrorDialog
|
from QuestionDialog import ErrorDialog
|
||||||
from gen.plug import PluginManager, ExportPlugin
|
from gen.plug import PluginManager, ExportPlugin
|
||||||
from glade import Glade
|
from glade import Glade
|
||||||
|
import Config
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
#
|
#
|
||||||
@ -452,7 +453,7 @@ class GeneWebWriter(object):
|
|||||||
|
|
||||||
def get_ref_name(self,person):
|
def get_ref_name(self,person):
|
||||||
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
||||||
firstname = _("Living")
|
firstname = Config.get(Config.PRIVATE_GIVEN_TEXT))
|
||||||
if not (Utils.probably_alive(person,self.db) and \
|
if not (Utils.probably_alive(person,self.db) and \
|
||||||
self.restrict and self.living):
|
self.restrict and self.living):
|
||||||
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
||||||
@ -463,7 +464,7 @@ class GeneWebWriter(object):
|
|||||||
|
|
||||||
def get_child_ref_name(self,person,father_lastname):
|
def get_child_ref_name(self,person,father_lastname):
|
||||||
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
surname = self.rem_spaces( person.get_primary_name().get_surname())
|
||||||
firstname = _("Living")
|
firstname = Config.get(Config.PRIVATE_GIVEN_TEXT))
|
||||||
if not (Utils.probably_alive(person,self.db) and \
|
if not (Utils.probably_alive(person,self.db) and \
|
||||||
self.restrict and self.living):
|
self.restrict and self.living):
|
||||||
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
firstname = self.rem_spaces( person.get_primary_name().get_first_name())
|
||||||
|
Reference in New Issue
Block a user