Add "Translator" tag to comments intended for translators

This commit is contained in:
Nick Hall 2021-06-01 14:02:38 +01:00
parent 7ef0cc3bff
commit 7c43a08952
4 changed files with 83 additions and 80 deletions

View File

@ -67,25 +67,27 @@ class DateDisplay:
formats = ( formats = (
# format 0 - must always be ISO # format 0 - must always be ISO
# Translators: Numeric year, month, day
_T_("YYYY-MM-DD (ISO)"), _T_("YYYY-MM-DD (ISO)"),
# format # 1 - must always be locale-preferred numerical format # format # 1 - must always be locale-preferred numerical format
# such as YY.MM.DD, MM-DD-YY, or whatever your locale prefers. # such as YY.MM.DD, MM-DD-YY, or whatever your locale prefers.
# This should be the format that is used under the locale by # This should be the format that is used under the locale by
# strftime() for '%x'. # strftime() for '%x'.
# You may translate this as "Numerical", "System preferred", or similar. # Translators: You may translate this as "Numerical",
# "System preferred", or similar.
_T_("Numerical", "date format"), _T_("Numerical", "date format"),
# Full month name, day, year # Translators: Full month name, day, year
_T_("Month Day, Year"), _T_("Month Day, Year"),
# Abbreviated month name, day, year # Translators: Abbreviated month name, day, year
_T_("MON DAY, YEAR"), _T_("MON DAY, YEAR"),
# Day, full month name, year # Translators: Day, full month name, year
_T_("Day Month Year"), _T_("Day Month Year"),
# Day, abbreviated month name, year # Translators: Day, abbreviated month name, year
_T_("DAY MON YEAR") _T_("DAY MON YEAR")
) )
""" """
@ -182,67 +184,67 @@ class DateDisplay:
"from" "from"
# first date in a span # first date in a span
# If "from <Month>" needs a special inflection in your # Translators: If "from <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "from"), : _("{long_month} {year}", "from"),
"to" "to"
# second date in a span # second date in a span
# If "to <Month>" needs a special inflection in your # Translators: If "to <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "to"), : _("{long_month} {year}", "to"),
"between" "between"
# first date in a range # first date in a range
# If "between <Month>" needs a special inflection in your # Translators: If "between <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "between"), : _("{long_month} {year}", "between"),
"and" "and"
# second date in a range # second date in a range
# If "and <Month>" needs a special inflection in your # Translators: If "and <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "and"), : _("{long_month} {year}", "and"),
"before" "before"
# If "before <Month>" needs a special inflection in your # Translators: If "before <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "before"), : _("{long_month} {year}", "before"),
"after" "after"
# If "after <Month>" needs a special inflection in your # Translators: If "after <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "after"), : _("{long_month} {year}", "after"),
"about" "about"
# If "about <Month>" needs a special inflection in your # Translators: If "about <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "about"), : _("{long_month} {year}", "about"),
"estimated" "estimated"
# If "estimated <Month>" needs a special inflection in your # Translators: If "estimated <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "estimated"), : _("{long_month} {year}", "estimated"),
"calculated" "calculated"
# If "calculated <Month>" needs a special inflection in your # Translators: If "calculated <Month>" needs a special inflection
# language, translate this to "{long_month.f[X]} {year}" # in your language, translate to "{long_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{long_month} {year}", "calculated"), : _("{long_month} {year}", "calculated"),
@ -254,67 +256,67 @@ class DateDisplay:
"from" "from"
# first date in a span # first date in a span
# If "from <Month>" needs a special inflection in your # Translators: If "from <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "from"), : _("{short_month} {year}", "from"),
"to" "to"
# second date in a span # second date in a span
# If "to <Month>" needs a special inflection in your # Translators: If "to <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "to"), : _("{short_month} {year}", "to"),
"between" "between"
# first date in a range # first date in a range
# If "between <Month>" needs a special inflection in your # Translators: If "between <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "between"), : _("{short_month} {year}", "between"),
"and" "and"
# second date in a range # second date in a range
# If "and <Month>" needs a special inflection in your # Translators: If "and <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "and"), : _("{short_month} {year}", "and"),
"before" "before"
# If "before <Month>" needs a special inflection in your # Translators: If "before <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "before"), : _("{short_month} {year}", "before"),
"after" "after"
# If "after <Month>" needs a special inflection in your # Translators: If "after <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "after"), : _("{short_month} {year}", "after"),
"about" "about"
# If "about <Month>" needs a special inflection in your # Translators: If "about <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "about"), : _("{short_month} {year}", "about"),
"estimated" "estimated"
# If "estimated <Month>" needs a special inflection in your # Translators: If "estimated <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "estimated"), : _("{short_month} {year}", "estimated"),
"calculated" "calculated"
# If "calculated <Month>" needs a special inflection in your # Translators: If "calculated <Month>" needs a special inflection
# language, translate this to "{short_month.f[X]} {year}" # in your language, translate to "{short_month.f[X]} {year}"
# (where X is one of the month-name inflections you defined) # (where X is one of the month-name inflections you defined)
# else leave it untranslated # else leave it untranslated
: _("{short_month} {year}", "calculated"), : _("{short_month} {year}", "calculated"),
@ -421,14 +423,14 @@ class DateDisplay:
qual_str = self._qual_str[date.get_quality()] qual_str = self._qual_str[date.get_quality()]
scal = self.format_extras(cal, date.get_new_year()) scal = self.format_extras(cal, date.get_new_year())
d1 = self.display_cal[cal](date.get_start_date(), d1 = self.display_cal[cal](date.get_start_date(),
# If there is no special inflection for "from <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "from <Month>" in your language, DON'T translate this.
# "translate" this to "from" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "from" in ENGLISH!!! ENGLISH!!!
inflect=self._("", "from-date")) inflect=self._("", "from-date"))
d2 = self.display_cal[cal](date.get_stop_date(), d2 = self.display_cal[cal](date.get_stop_date(),
# If there is no special inflection for "to <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "to <Month>" in your language, DON'T translate this.
# "translate" this to "to" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "to" in ENGLISH!!! ENGLISH!!!
inflect=self._("", "to-date")) inflect=self._("", "to-date"))
return self._("{date_quality}from {date_start} to {date_stop}" return self._("{date_quality}from {date_start} to {date_stop}"
"{nonstd_calendar_and_ny}").format( "{nonstd_calendar_and_ny}").format(
@ -446,14 +448,14 @@ class DateDisplay:
qual_str = self._qual_str[date.get_quality()] qual_str = self._qual_str[date.get_quality()]
scal = self.format_extras(cal, date.get_new_year()) scal = self.format_extras(cal, date.get_new_year())
d1 = self.display_cal[cal](date.get_start_date(), d1 = self.display_cal[cal](date.get_start_date(),
# If there is no special inflection for "between <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "between <Month>" in your language, DON'T translate this.
# "translate" this to "between" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "between" in ENGLISH!!! ENGLISH!!!
inflect=self._("", "between-date")) inflect=self._("", "between-date"))
d2 = self.display_cal[cal](date.get_stop_date(), d2 = self.display_cal[cal](date.get_stop_date(),
# If there is no special inflection for "and <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "and <Month>" in your language, DON'T translate this.
# "translate" this to "and" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "and" in ENGLISH!!! ENGLISH!!!
inflect=self._("", "and-date")) inflect=self._("", "and-date"))
return self._("{date_quality}between {date_start} and {date_stop}" return self._("{date_quality}between {date_start} and {date_stop}"
"{nonstd_calendar_and_ny}").format( "{nonstd_calendar_and_ny}").format(
@ -485,29 +487,29 @@ class DateDisplay:
return self.dd_range(date) return self.dd_range(date)
else: else:
if mod == Date.MOD_BEFORE: if mod == Date.MOD_BEFORE:
# If there is no special inflection for "before <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "before <Month>" in your language, DON'T translate this.
# "translate" this to "before" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "before" in ENGLISH!!! ENGLISH!!!
date_type = _("", "before-date") date_type = _("", "before-date")
elif mod == Date.MOD_AFTER: elif mod == Date.MOD_AFTER:
# If there is no special inflection for "after <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "after <Month>" in your language, DON'T translate this.
# "translate" this to "after" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "after" in ENGLISH!!! ENGLISH!!!
date_type = _("", "after-date") date_type = _("", "after-date")
elif mod == Date.MOD_ABOUT: elif mod == Date.MOD_ABOUT:
# If there is no special inflection for "about <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "about <Month>" in your language, DON'T translate this.
# "translate" this to "about" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "about" in ENGLISH!!! ENGLISH!!!
date_type = _("", "about-date") date_type = _("", "about-date")
elif qual == Date.QUAL_ESTIMATED: elif qual == Date.QUAL_ESTIMATED:
# If there is no special inflection for "estimated <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "estimated <Month>" in your language, DON'T translate this.
# "translate" this to "estimated" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "estimated" in ENGLISH!!! ENGLISH!!!
date_type = _("", "estimated-date") date_type = _("", "estimated-date")
elif qual == Date.QUAL_CALCULATED: elif qual == Date.QUAL_CALCULATED:
# If there is no special inflection for "calculated <Month>" # Translators: If there is no special inflection for
# in your language, DON'T translate this string. Otherwise, # "calculated <Month>" in your language, DON'T translate this.
# "translate" this to "calculated" in ENGLISH!!! ENGLISH!!! # Otherwise, translate to "calculated" in ENGLISH!!! ENGLISH!!!
date_type = _("", "calculated-date") date_type = _("", "calculated-date")
else: else:
date_type = "" date_type = ""
@ -761,7 +763,8 @@ class DateDisplay:
# day month_abbreviation year # day month_abbreviation year
value = self.dd_dformat05(date_val, inflect, short_months) value = self.dd_dformat05(date_val, inflect, short_months)
if date_val[2] < 0: if date_val[2] < 0:
# TODO fix BUG 7064: non-Gregorian calendars wrongly use BCE notation for negative dates # TODO fix BUG 7064: non-Gregorian calendars wrongly use BCE notation
# for negative dates
return self._bce_str % value return self._bce_str % value
else: else:
return value return value

View File

@ -487,7 +487,7 @@ class FamilyLinesReport(Report):
person = self._db.get_person_from_handle(handle) person = self._db.get_person_from_handle(handle)
gid = person.get_gramps_id() gid = person.get_gramps_id()
name = person.get_primary_name().get_regular_name() name = person.get_primary_name().get_regular_name()
# Translators: needed for Arabic, ignore othewise # Translators: needed for Arabic, ignore otherwise
id_n = self._("%(str1)s, %(str2)s") % {'str1':gid, 'str2':name} id_n = self._("%(str1)s, %(str2)s") % {'str1':gid, 'str2':name}
self.doc.add_comment('# -> ' + id_n) self.doc.add_comment('# -> ' + id_n)

View File

@ -247,7 +247,7 @@ class IndivCompleteReport(Report):
self.doc.start_row() self.doc.start_row()
self.write_cell(label) self.write_cell(label)
if parent_name: if parent_name:
# for example (a stepfather): John Smith, relationship: Step # Translators: e.g. (a stepfather): John Smith, relationship: Step
text = self._('%(parent-name)s, relationship: %(rel-type)s' text = self._('%(parent-name)s, relationship: %(rel-type)s'
) % {'parent-name' : parent_name, ) % {'parent-name' : parent_name,
'rel-type' : self._(rel_type)} 'rel-type' : self._(rel_type)}

View File

@ -57,31 +57,31 @@ def load_on_reg(dbstate, uistate, plugin):
# "default" is used as default # "default" is used as default
# default style sheet in the options # default style sheet in the options
# Basic Ash style sheet # Translators: Basic Ash style sheet
["Basic-Ash", 1, _("Basic-Ash"), ["Basic-Ash", 1, _("Basic-Ash"),
path_css('Web_Basic-Ash.css'), None, [], []], path_css('Web_Basic-Ash.css'), None, [], []],
# Basic Blue style sheet with navigation menus # Translators: Basic Blue style sheet with navigation menus
["Basic-Blue", 1, _("Basic-Blue"), ["Basic-Blue", 1, _("Basic-Blue"),
path_css('Web_Basic-Blue.css'), None, [], []], path_css('Web_Basic-Blue.css'), None, [], []],
# Basic Cypress style sheet # Translators: Basic Cypress style sheet
["Basic-Cypress", 1, _("Basic-Cypress"), ["Basic-Cypress", 1, _("Basic-Cypress"),
path_css('Web_Basic-Cypress.css'), None, [], []], path_css('Web_Basic-Cypress.css'), None, [], []],
# basic Lilac style sheet # Translators: Basic Lilac style sheet
["Basic-Lilac", 1, _("Basic-Lilac"), ["Basic-Lilac", 1, _("Basic-Lilac"),
path_css('Web_Basic-Lilac.css'), None, [], []], path_css('Web_Basic-Lilac.css'), None, [], []],
# basic Peach style sheet # Translators: Basic Peach style sheet
["Basic-Peach", 1, _("Basic-Peach"), ["Basic-Peach", 1, _("Basic-Peach"),
path_css('Web_Basic-Peach.css'), None, [], []], path_css('Web_Basic-Peach.css'), None, [], []],
# basic Spruce style sheet # Translators: Basic Spruce style sheet
["Basic-Spruce", 1, _("Basic-Spruce"), ["Basic-Spruce", 1, _("Basic-Spruce"),
path_css('Web_Basic-Spruce.css'), None, [], []], path_css('Web_Basic-Spruce.css'), None, [], []],
# Mainz style sheet with its images # Translators: Mainz style sheet with its images
["Mainz", 1, _("Mainz"), ["Mainz", 1, _("Mainz"),
path_css('Web_Mainz.css'), None, path_css('Web_Mainz.css'), None,
[path_img("Web_Mainz_Bkgd.png"), [path_img("Web_Mainz_Bkgd.png"),
@ -89,11 +89,11 @@ def load_on_reg(dbstate, uistate, plugin):
path_img("Web_Mainz_Mid.png"), path_img("Web_Mainz_Mid.png"),
path_img("Web_Mainz_MidLight.png")], []], path_img("Web_Mainz_MidLight.png")], []],
# Nebraska style sheet # Translators: Nebraska style sheet
["Nebraska", 1, _("Nebraska"), ["Nebraska", 1, _("Nebraska"),
path_css('Web_Nebraska.css'), None, [], []], path_css('Web_Nebraska.css'), None, [], []],
# Visually Impaired style sheet with its navigation menus # Translators: Visually Impaired style sheet with its navigation menus
["Visually Impaired", 1, _("Visually Impaired"), ["Visually Impaired", 1, _("Visually Impaired"),
path_css('Web_Visually.css'), "narrative-menus.css", [], []], path_css('Web_Visually.css'), "narrative-menus.css", [], []],