7276: translate some currently-untranslated punctuation marks

This commit is contained in:
Paul Franklin 2017-08-21 00:32:20 -07:00
parent 04bb34b5e3
commit e215393abd
37 changed files with 53 additions and 14 deletions

View File

@ -446,7 +446,7 @@ class CommandLineReport:
else:
print(_("Unknown option: %s") % option, file=sys.stderr)
print(_(" Valid options are:") +
", ".join(list(self.options_dict.keys())),
_(", ").join(list(self.options_dict.keys())), # Arabic OK
file=sys.stderr)
print(_(" Use '%(donottranslate)s' to see description "
"and acceptable values"
@ -527,7 +527,7 @@ class CommandLineReport:
else:
print(_("Ignoring unknown option: %s") % opt, file=sys.stderr)
print(_(" Valid options are:"),
", ".join(list(self.options_dict.keys())),
_(", ").join(list(self.options_dict.keys())), # Arabic OK
file=sys.stderr)
print(_(" Use '%(donottranslate)s' to see description "
"and acceptable values"

View File

@ -342,6 +342,7 @@ class DateDisplay:
for item in [scal, snewyear]:
if item:
if retval:
# TODO for Arabic, should the next comma be translated?
retval += ", "
retval += item
if retval:

View File

@ -80,6 +80,7 @@ class PlaceDisplay:
if config.get('preferences.place-reverse'):
names.reverse()
# TODO for Arabic, should the next line's comma be translated?
return ", ".join(names)
def _find_populated_place(places):

View File

@ -74,6 +74,7 @@ class HasRepo(Rule):
if self.list[2]:
addr_match = False
for addr in repo.address_list:
# TODO for Arabic, should the next line's comma be translated?
addr_text = ', '.join(addr.get_text_data_list())
if self.match_substring(2, addr_text):
addr_match = True
@ -84,6 +85,7 @@ class HasRepo(Rule):
if self.list[3]:
url_match = False
for url in repo.urls:
# TODO for Arabic, should the next line's comma be translated?
url_text = ', '.join(url.get_text_data_list())
if self.match_substring(3, url_text):
url_match = True

View File

@ -267,6 +267,7 @@ class MergePerson(ManagedWindow):
if len(alist) > 0:
self.add(tobj, title, _("Addresses"))
for addr in alist:
# TODO for Arabic, should the next line's comma be translated?
location = ", ".join([addr.get_street(), addr.get_city(),
addr.get_state(), addr.get_country(),
addr.get_postal_code(), addr.get_phone()])

View File

@ -176,6 +176,7 @@ class PluginDialog(ManagedWindow):
self.title.set_text('<span weight="bold" size="larger">%s</span>' \
% pdata.name)
self.title.set_use_markup(1)
# TODO for Arabic, should the next two lines' commas be translated?
self.author_name.set_text(', '.join(pdata.authors))
self.author_email.set_text(', '.join(pdata.authors_email))
self.item = pdata

View File

@ -1209,6 +1209,7 @@ class UpdateAddons(ManagedWindow):
if errors:
OkDialog(_("Installation Errors"),
_("The following addons had errors: ") +
# TODO for Arabic, should the next comma be translated?
", ".join(errors),
parent=self.parent_window)
if count:

View File

@ -129,6 +129,7 @@ class CitationBaseModel:
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))
def citation_tag_color(self, data):
@ -241,6 +242,7 @@ class CitationBaseModel:
try:
source = self.db.get_source_from_handle(source_handle)
tag_list = list(map(self.get_tag_name, source.get_tag_list()))
# TODO for Arabic, should the next line's comma be translated?
value = ', '.join(sorted(tag_list, key=glocale.sort_key))
except:
value = ''
@ -288,6 +290,7 @@ class CitationBaseModel:
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[COLUMN2_TAGS]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))
def source_src_tag_color(self, data):

View File

@ -224,4 +224,5 @@ class EventModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -236,4 +236,5 @@ class FamilyModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[13]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -187,4 +187,5 @@ class MediaModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[11]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -166,4 +166,5 @@ class NoteModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[Note.POS_TAGS]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -559,6 +559,7 @@ class PeopleBaseModel(BaseModel):
cached, value = self.get_cached_value(handle, "TAGS")
if not cached:
tag_list = list(map(self.get_tag_name, data[COLUMN_TAGS]))
# TODO for Arabic, should the next line's comma be translated?
value = ', '.join(sorted(tag_list, key=glocale.sort_key))
self.set_cached_value(handle, "TAGS", value)
return value

View File

@ -219,6 +219,7 @@ class PlaceBaseModel:
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[16]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))
#-------------------------------------------------------------------------

View File

@ -269,4 +269,5 @@ class RepositoryModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[8]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -161,4 +161,5 @@ class SourceModel(FlatBaseModel):
Return the sorted list of tags.
"""
tag_list = list(map(self.get_tag_name, data[11]))
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(sorted(tag_list, key=glocale.sort_key))

View File

@ -201,6 +201,7 @@ def gramps_upgrade_17(self):
n -= 1
while n > level:
if loc[n]:
# TODO for Arabic, should the next line's comma be translated?
title = ', '.join([item for item in loc[n:] if item])
parent_handle = add_place(self, loc[n], n, parent_handle, title)
locations[tuple([''] * n + loc[n:])] = parent_handle

View File

@ -281,6 +281,7 @@ def write_index(index, doc):
doc.start_cell('IDX-Cell')
doc.start_paragraph('IDX-Entry')
pages = [str(page_nr) for page_nr in index[key]]
# TODO for Arabic, should the next line's comma be translated?
doc.write_text(', '.join(pages))
doc.end_paragraph()
doc.end_cell()

View File

@ -359,7 +359,7 @@ class FanChart(Report):
else:
name = p_pn.get_first_name() + p_pn.get_surname()
if (name != "") and (val != ""):
string = name + ", " + val
string = name + self._(", ") + val # Arabic OK
else:
string = name + val
return [string]
@ -375,7 +375,7 @@ class FanChart(Report):
return [name, val]
else:
if (name != "") and (val != ""):
string = name + ", " + val
string = name + self._(", ") + val # Arabic OK
else:
string = name + val
return [string]

View File

@ -228,6 +228,7 @@ class PersonDetails(Gramplet):
if attr.get_type() == attr_key:
values.append(attr.get_value())
if values:
# translators: needed for Arabic, ignore otherwise
self.add_row(attr_key, _(', ').join(values))
def display_type(self, active_person, event_type):

View File

@ -367,7 +367,7 @@ class WhatNextGramplet(Gramplet):
if missingbits:
self.link(name, 'Person', person.get_handle())
self.append_text(_(": %(list)s\n") % {
'list': _(", ").join(missingbits)})
'list': _(", ").join(missingbits)}) # Arabic OK
self.__counter += 1
append_list.append(person)
@ -389,7 +389,7 @@ class WhatNextGramplet(Gramplet):
if missingbits:
self.link(name, 'Person', person.get_handle())
self.append_text(_(": %(list)s\n") % {
'list': _(", ").join(missingbits)})
'list': _(", ").join(missingbits)}) # Arabic OK
self.__counter += 1
@ -437,7 +437,7 @@ class WhatNextGramplet(Gramplet):
if missingbits:
self.link(name, 'Family', family.get_handle())
self.append_text(_(": %(list)s\n") % {
'list': _(", ").join(missingbits)})
'list': _(", ").join(missingbits)}) # Arabic OK
self.__counter += 1
append_list.append((family, person1, person2))
@ -470,7 +470,7 @@ class WhatNextGramplet(Gramplet):
if missingbits:
self.link(name, 'Family', family.get_handle())
self.append_text(_(": %(list)s\n") % {
'list': _(", ").join(missingbits)})
'list': _(", ").join(missingbits)}) # Arabic OK
self.__counter += 1
@ -492,7 +492,7 @@ class WhatNextGramplet(Gramplet):
# translators: needed for French, ignore otherwise
return [_("%(str1)s: %(str2)s"
) % {'str1' : event.get_type(),
'str2' : _(", ").join(missingbits)}]
'str2' : _(", ").join(missingbits)}] # Arabic OK
else:
return []

View File

@ -657,7 +657,7 @@ class RelGraphReport(Report):
label += '%s' % desc
if place:
if date or desc:
label += ', '
label += self._(', ') # Arabic OK
label += '%s' % place
label += ')'

View File

@ -676,6 +676,7 @@ class GeneWebParser:
except IndexError: # not all parts are written all the time
pass
if tnth: # Append title numer to title
# TODO for Arabic, should the next comma be translated?
ttitle += ", " + tnth
title = self.create_event(
EventType.NOB_TITLE, ttitle, tstart, tplace)

View File

@ -293,6 +293,7 @@ class PG30DefTableField(object):
self.size = int(self.fields[3])
def __repr__(self):
# TODO for Arabic, should the next line's comma be translated?
return self.fieldname + ' -> ' + ', '.join(self.fields)

View File

@ -3306,6 +3306,7 @@ class GedcomParser(UpdateCallback):
for elmn in str_list:
if elmn:
if title != '':
# TODO for Arabic, should the next comma be translated?
title += ', '
title += elmn
return title

View File

@ -88,6 +88,7 @@ class PlaceImport:
n -= 1
while n > type_num:
if loc[n]:
# TODO for Arabic, should the next comma be translated?
title = ', '.join([item for item in loc[n:] if item])
parent = self.__add_place(loc[n], n, parent, title, trans)
self.loc2handle[tuple([''] * n + loc[n:])] = parent

View File

@ -1063,6 +1063,7 @@ class GeoGraphyView(OsmGps, NavigationView):
if gids == "":
gids = plce.gramps_id
else:
# TODO for Arabic, should the next comma be translated?
gids = gids + ", " + plce.gramps_id
if nb_places > 1:
from gramps.gui.dialog import WarningDialog

View File

@ -77,10 +77,13 @@ def _build_title(db, place):
if descr:
title_descr += descr.strip()
if parish:
# TODO for Arabic, should the next line's comma be translated?
title_descr += ', ' + parish.strip() + _(" parish")
if city:
# TODO for Arabic, should the next line's comma be translated?
title_descr += ', ' + city.strip()
if state:
# TODO for Arabic, should the next line's comma be translated?
title_descr += ', ' + state.strip() + _(" state")
return _strip_leading_comma(title_descr)
@ -91,6 +94,7 @@ def _build_city(db, place):
# Build a title description string that will work for Eniro
city_descr = _build_area(db, place)
if county:
# TODO for Arabic, should the next line's comma be translated?
city_descr += ', ' + county
return _strip_leading_comma(city_descr)
@ -104,6 +108,7 @@ def _build_area(db, place):
if street:
area_descr += street.strip()
if city:
# TODO for Arabic, should the next line's comma be translated?
area_descr += ', ' + city
return _strip_leading_comma(area_descr)

View File

@ -315,6 +315,7 @@ class AllRelReport:
if isinstance(fam, list):
famstr = str(fam[0]+1)
for val in fam[1:] :
# TODO for Arabic, should the next comma be translated?
famstr += ', ' + str(val+1)
else:
famstr = str(fam+1)

View File

@ -225,6 +225,7 @@ def add_rem(remark, text):
""" Allow for extension of remark, return new remark string
"""
if remark:
# TODO for Arabic, should the next line's comma be translated?
return remark + ', ' + text
else:
return text

View File

@ -266,7 +266,7 @@ class Printinfo:
tmp = self.__date_place(
get_death_or_fallback(self.database, person))
if string and tmp:
string += ", "
string += self._(", ") # Arabic OK
string += tmp
if string:
@ -276,13 +276,13 @@ class Printinfo:
tmp = self.__date_place(
get_marriage_or_fallback(self.database, family))
if tmp:
string += ", " + tmp
string += self._(", ") + tmp # Arabic OK
if family and self.showdivorce:
tmp = self.__date_place(
get_divorce_or_fallback(self.database, family))
if tmp:
string += ", " + tmp
string += self._(", ") + tmp # Arabic OK
if family and self.want_ids:
string += ' (%s)' % family.get_gramps_id()

View File

@ -484,6 +484,7 @@ class NotRelated(tool.ActivePersonTool, ManagedWindow) :
tag = self.db.get_tag_from_handle(handle)
tags.append(tag.get_name())
tags.sort(key=glocale.sort_key)
# TODO for Arabic, should the next line's comma be translated?
return ', '.join(tags)
#------------------------------------------------------------------------

View File

@ -232,6 +232,7 @@ class RelCalc(tool.Tool, ManagedWindow):
for person_handle in common:
person = self.db.get_person_from_handle(person_handle)
if index:
# TODO for Arabic, should the next comma be translated?
commontext += ", "
commontext += name_displayer.display(person)
index += 1

View File

@ -355,6 +355,7 @@ def _get_short_name(gender, name):
short_name = name.get_first_name()
suffix = name.get_suffix()
if suffix:
# TODO for Arabic, should the next line's comma be translated?
short_name = short_name + ", " + suffix
return short_name

View File

@ -765,6 +765,7 @@ class NavWebReport(Report):
family = self._db.get_family_from_handle(ref_handle)
ref_name = self.get_family_name(family)
if ref_name != "":
# TODO for Arabic, should the next line's comma be translated?
event_name += ", " + ref_name
# end descriptions to media pages
if self.inc_events:

View File

@ -331,6 +331,7 @@ class PersonPages(BasePage):
tcell[-1].inside += ","
else:
tcell = tcell[:-1] + (
# TODO for Arabic, translate?
(tcell[-1] + ", "),)
# Have to manipulate as tuples so that
# subsequent people are not nested
@ -1322,7 +1323,7 @@ class PersonPages(BasePage):
# if we have just a firstname, then the name is preceeded
# by ", " which doesn't exactly look very nice printed on
# the web page
if pname[:2] == ', ':
if pname[:2] == ', ': # TODO for Arabic, translate this?
pname = pname[2:]
if name != primary_name:
datetext = self.rlocale.get_date(name.date)

View File

@ -1901,6 +1901,7 @@ def _regular_surname(sex, name):
surname = name.get_surname()
suffix = name.get_suffix()
if suffix:
# TODO for Arabic, should the next line's comma be translated?
surname = surname + ", " + suffix
return surname