From 7c43a08952770d702492d94ba70f3785479f4259 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 1 Jun 2021 14:02:38 +0100 Subject: [PATCH] Add "Translator" tag to comments intended for translators --- gramps/gen/datehandler/_datedisplay.py | 141 +++++++++++---------- gramps/plugins/graph/gvfamilylines.py | 2 +- gramps/plugins/textreport/indivcomplete.py | 2 +- gramps/plugins/webstuff/webstuff.py | 18 +-- 4 files changed, 83 insertions(+), 80 deletions(-) diff --git a/gramps/gen/datehandler/_datedisplay.py b/gramps/gen/datehandler/_datedisplay.py index f037c4979..5913dff9d 100644 --- a/gramps/gen/datehandler/_datedisplay.py +++ b/gramps/gen/datehandler/_datedisplay.py @@ -67,25 +67,27 @@ class DateDisplay: formats = ( # format 0 - must always be ISO + # Translators: Numeric year, month, day _T_("YYYY-MM-DD (ISO)"), # format # 1 - must always be locale-preferred numerical format # 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 # 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"), - # Full month name, day, year + # Translators: Full month name, day, year _T_("Month Day, Year"), - # Abbreviated month name, day, year + # Translators: Abbreviated month name, day, year _T_("MON DAY, YEAR"), - # Day, full month name, year + # Translators: Day, full month name, year _T_("Day Month Year"), - # Day, abbreviated month name, year + # Translators: Day, abbreviated month name, year _T_("DAY MON YEAR") ) """ @@ -182,67 +184,67 @@ class DateDisplay: "from" # first date in a span - # If "from " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "from " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "from"), "to" # second date in a span - # If "to " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "to " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "to"), "between" # first date in a range - # If "between " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "between " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "between"), "and" # second date in a range - # If "and " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "and " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "and"), "before" - # If "before " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "before " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "before"), "after" - # If "after " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "after " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "after"), "about" - # If "about " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "about " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "about"), "estimated" - # If "estimated " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "estimated " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "estimated"), "calculated" - # If "calculated " needs a special inflection in your - # language, translate this to "{long_month.f[X]} {year}" + # Translators: If "calculated " needs a special inflection + # in your language, translate to "{long_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{long_month} {year}", "calculated"), @@ -254,67 +256,67 @@ class DateDisplay: "from" # first date in a span - # If "from " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "from " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "from"), "to" # second date in a span - # If "to " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "to " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "to"), "between" # first date in a range - # If "between " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "between " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "between"), "and" # second date in a range - # If "and " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "and " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "and"), "before" - # If "before " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "before " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "before"), "after" - # If "after " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "after " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "after"), "about" - # If "about " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "about " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "about"), "estimated" - # If "estimated " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "estimated " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "estimated"), "calculated" - # If "calculated " needs a special inflection in your - # language, translate this to "{short_month.f[X]} {year}" + # Translators: If "calculated " needs a special inflection + # in your language, translate to "{short_month.f[X]} {year}" # (where X is one of the month-name inflections you defined) # else leave it untranslated : _("{short_month} {year}", "calculated"), @@ -421,14 +423,14 @@ class DateDisplay: qual_str = self._qual_str[date.get_quality()] scal = self.format_extras(cal, date.get_new_year()) d1 = self.display_cal[cal](date.get_start_date(), - # If there is no special inflection for "from " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "from" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "from " in your language, DON'T translate this. + # Otherwise, translate to "from" in ENGLISH!!! ENGLISH!!! inflect=self._("", "from-date")) d2 = self.display_cal[cal](date.get_stop_date(), - # If there is no special inflection for "to " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "to" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "to " in your language, DON'T translate this. + # Otherwise, translate to "to" in ENGLISH!!! ENGLISH!!! inflect=self._("", "to-date")) return self._("{date_quality}from {date_start} to {date_stop}" "{nonstd_calendar_and_ny}").format( @@ -446,14 +448,14 @@ class DateDisplay: qual_str = self._qual_str[date.get_quality()] scal = self.format_extras(cal, date.get_new_year()) d1 = self.display_cal[cal](date.get_start_date(), - # If there is no special inflection for "between " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "between" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "between " in your language, DON'T translate this. + # Otherwise, translate to "between" in ENGLISH!!! ENGLISH!!! inflect=self._("", "between-date")) d2 = self.display_cal[cal](date.get_stop_date(), - # If there is no special inflection for "and " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "and" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "and " in your language, DON'T translate this. + # Otherwise, translate to "and" in ENGLISH!!! ENGLISH!!! inflect=self._("", "and-date")) return self._("{date_quality}between {date_start} and {date_stop}" "{nonstd_calendar_and_ny}").format( @@ -485,29 +487,29 @@ class DateDisplay: return self.dd_range(date) else: if mod == Date.MOD_BEFORE: - # If there is no special inflection for "before " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "before" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "before " in your language, DON'T translate this. + # Otherwise, translate to "before" in ENGLISH!!! ENGLISH!!! date_type = _("", "before-date") elif mod == Date.MOD_AFTER: - # If there is no special inflection for "after " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "after" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "after " in your language, DON'T translate this. + # Otherwise, translate to "after" in ENGLISH!!! ENGLISH!!! date_type = _("", "after-date") elif mod == Date.MOD_ABOUT: - # If there is no special inflection for "about " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "about" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "about " in your language, DON'T translate this. + # Otherwise, translate to "about" in ENGLISH!!! ENGLISH!!! date_type = _("", "about-date") elif qual == Date.QUAL_ESTIMATED: - # If there is no special inflection for "estimated " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "estimated" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "estimated " in your language, DON'T translate this. + # Otherwise, translate to "estimated" in ENGLISH!!! ENGLISH!!! date_type = _("", "estimated-date") elif qual == Date.QUAL_CALCULATED: - # If there is no special inflection for "calculated " - # in your language, DON'T translate this string. Otherwise, - # "translate" this to "calculated" in ENGLISH!!! ENGLISH!!! + # Translators: If there is no special inflection for + # "calculated " in your language, DON'T translate this. + # Otherwise, translate to "calculated" in ENGLISH!!! ENGLISH!!! date_type = _("", "calculated-date") else: date_type = "" @@ -761,7 +763,8 @@ class DateDisplay: # day month_abbreviation year value = self.dd_dformat05(date_val, inflect, short_months) 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 else: return value diff --git a/gramps/plugins/graph/gvfamilylines.py b/gramps/plugins/graph/gvfamilylines.py index cc0b37b72..a0a6458d9 100644 --- a/gramps/plugins/graph/gvfamilylines.py +++ b/gramps/plugins/graph/gvfamilylines.py @@ -487,7 +487,7 @@ class FamilyLinesReport(Report): person = self._db.get_person_from_handle(handle) gid = person.get_gramps_id() 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} self.doc.add_comment('# -> ' + id_n) diff --git a/gramps/plugins/textreport/indivcomplete.py b/gramps/plugins/textreport/indivcomplete.py index a4f4cb3e5..6fe889139 100644 --- a/gramps/plugins/textreport/indivcomplete.py +++ b/gramps/plugins/textreport/indivcomplete.py @@ -247,7 +247,7 @@ class IndivCompleteReport(Report): self.doc.start_row() self.write_cell(label) 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' ) % {'parent-name' : parent_name, 'rel-type' : self._(rel_type)} diff --git a/gramps/plugins/webstuff/webstuff.py b/gramps/plugins/webstuff/webstuff.py index c2819cb4f..eaacb5820 100644 --- a/gramps/plugins/webstuff/webstuff.py +++ b/gramps/plugins/webstuff/webstuff.py @@ -57,31 +57,31 @@ def load_on_reg(dbstate, uistate, plugin): # "default" is used as default # default style sheet in the options - # Basic Ash style sheet + # Translators: Basic Ash style sheet ["Basic-Ash", 1, _("Basic-Ash"), 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"), path_css('Web_Basic-Blue.css'), None, [], []], - # Basic Cypress style sheet + # Translators: Basic Cypress style sheet ["Basic-Cypress", 1, _("Basic-Cypress"), path_css('Web_Basic-Cypress.css'), None, [], []], - # basic Lilac style sheet + # Translators: Basic Lilac style sheet ["Basic-Lilac", 1, _("Basic-Lilac"), path_css('Web_Basic-Lilac.css'), None, [], []], - # basic Peach style sheet + # Translators: Basic Peach style sheet ["Basic-Peach", 1, _("Basic-Peach"), path_css('Web_Basic-Peach.css'), None, [], []], - # basic Spruce style sheet + # Translators: Basic Spruce style sheet ["Basic-Spruce", 1, _("Basic-Spruce"), path_css('Web_Basic-Spruce.css'), None, [], []], - # Mainz style sheet with its images + # Translators: Mainz style sheet with its images ["Mainz", 1, _("Mainz"), path_css('Web_Mainz.css'), None, [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_MidLight.png")], []], - # Nebraska style sheet + # Translators: Nebraska style sheet ["Nebraska", 1, _("Nebraska"), 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"), path_css('Web_Visually.css'), "narrative-menus.css", [], []],