7276: translate some punctuation marks -- partial

This commit is contained in:
Paul Franklin 2014-04-09 18:40:42 -07:00
parent 6836dbd5bd
commit 9c4aa37b8c

View File

@ -115,6 +115,11 @@ _F_RAWFN = 4 # name format raw function
PAT_AS_SURN = False
# translators: needed for Arabic, ignore otherwise
COMMAGLYPH = _(',')
LNFN_STR = "%s" + COMMAGLYPH + " %s %s"
#-------------------------------------------------------------------------
#
# Local functions
@ -308,7 +313,7 @@ def cleanup_name(namestring):
return ""
result = parts[0]
for val in parts[1:]:
if len(val) == 1 and val in [',', ';', ':']:
if len(val) == 1 and val in [',', ';', ':', COMMAGLYPH]:
result += val
else:
result += ' ' + val
@ -335,15 +340,15 @@ class NameDisplay(object):
STANDARD_FORMATS = [
(Name.DEF, _("Default format (defined by Gramps preferences)"), '', _ACT),
(Name.LNFN, _("Surname, Given Suffix"), '%l, %f %s', _ACT),
(Name.LNFN, _("Surname, Given Suffix"), '%l' + COMMAGLYPH + ' %f %s', _ACT),
(Name.FN, _("Given"), '%f', _ACT),
(Name.FNLN, _("Given Surname Suffix"), '%f %l %s', _ACT),
# primary name primconnector other, given pa/matronynic suffix, primprefix
# translators, long string, have a look at Preferences dialog
(Name.LNFNP, _("Main Surnames, Given Patronymic Suffix Prefix"),
'%1m %2m %o, %f %1y %s %0m', _ACT),
'%1m %2m %o' + COMMAGLYPH + ' %f %1y %s %0m', _ACT),
# DEPRECATED FORMATS
(Name.PTFN, _("Patronymic, Given"), '%y, %s %f', _INA),
(Name.PTFN, _("Patronymic, Given"), '%y' + COMMAGLYPH + ' %s %f', _INA),
]
def __init__(self):
@ -384,7 +389,7 @@ class NameDisplay(object):
return lambda x: self.format_str_raw(x, fmt_str)
def _raw_lnfn(self, raw_data):
result = "%s, %s %s" % (_raw_full_surname(raw_data[_SURNAME_LIST]),
result = LNFN_STR % (_raw_full_surname(raw_data[_SURNAME_LIST]),
raw_data[_FIRSTNAME],
raw_data[_SUFFIX])
return ' '.join(result.split())