gramps icon indicating copy to clipboard operation
gramps copied to clipboard

Remove duplicated keywords.

Open Baizley opened this issue 5 years ago • 5 comments

The keywords for the name formats have been duplicated in order to provide a translated version.

To remove this duplication, the translation is produced by mapping over the keywords that was duplicated.

The actual mapping is delayed until a choose is made on which format will be used. This reduces the amount of translation that is done.

Baizley avatar Dec 20 '19 18:12 Baizley

Codecov Report

Merging #973 into master will increase coverage by <.01%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #973      +/-   ##
==========================================
+ Coverage   41.95%   41.95%   +<.01%     
==========================================
  Files        1071     1071              
  Lines      145657   145656       -1     
==========================================
  Hits        61106    61106              
+ Misses      84551    84550       -1
Impacted Files Coverage Δ
gramps/gui/configure.py 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3938fac...467d24a. Read the comment docs.

codecov-io avatar Dec 20 '19 18:12 codecov-io

It looks like the strings stay the same, just reduced duplication/usage in the code, for translators they stay the same. I am fine if it works ;)

Fedik avatar Dec 30 '19 10:12 Fedik

It also works because strings are already translated, but we still need to know what should be translated ... Sure, they are common keys:

#: ../gramps/gen/utils/keyword.py:56 ../gramps/gui/configure.py:851 #: ../gramps/gui/configure.py:858 ../gramps/gui/configure.py:860 #: ../gramps/gui/configure.py:861 ../gramps/gui/configure.py:862 #: ../gramps/gui/configure.py:863 ../gramps/gui/configure.py:864 msgid "SURNAME" msgstr ""

#: ../gramps/gen/display/name.py:356 ../gramps/gen/utils/keyword.py:55 #: ../gramps/gui/configure.py:844 ../gramps/gui/configure.py:846 #: ../gramps/gui/configure.py:851 ../gramps/gui/configure.py:853 #: ../gramps/gui/configure.py:855 ../gramps/gui/configure.py:856 #: ../gramps/gui/configure.py:857 ../gramps/gui/configure.py:858 #: ../gramps/gui/configure.py:860 ../gramps/gui/configure.py:861 #: ../gramps/gui/configure.py:862 ../gramps/gui/configure.py:863 #: ../gramps/gui/configure.py:864 ../gramps/gui/configure.py:865 #: ../gramps/plugins/export/exportcsv.py:354 #: ../gramps/plugins/importer/importcsv.py:163 msgid "Given" msgstr ""

#. show surname and first name #: ../gramps/gen/lib/surname.py:87 ../gramps/gen/lib/surname.py:91 #: ../gramps/gen/utils/keyword.py:56 ../gramps/gui/clipboard.py:596 #: ../gramps/gui/configure.py:844 ../gramps/gui/configure.py:846 #: ../gramps/gui/configure.py:848 ../gramps/gui/configure.py:850 #: ../gramps/gui/configure.py:853 ../gramps/gui/configure.py:854 #: ../gramps/gui/configure.py:855 ../gramps/gui/configure.py:856 #: ../gramps/gui/editors/displaytabs/surnametab.py:78 #: ../gramps/gui/plug/_guioptions.py:88 ../gramps/gui/plug/_guioptions.py:1508 #: ../gramps/plugins/drawreport/statisticschart.py:340 #: ../gramps/plugins/export/exportcsv.py:354 #: ../gramps/plugins/importer/importcsv.py:160 #: ../gramps/plugins/quickview/filterbyname.py:354 #: ../gramps/plugins/webreport/person.py:213 #: ../gramps/plugins/webreport/surname.py:98 #: ../gramps/plugins/webreport/surnamelist.py:147 msgid "Surname" msgstr ""

but need to keep them on '/gramps/gen/utils/keyword.py', otherwise translators will no more get strings to translate!

KEYWORDS = [("title",     "t", _("Person|Title"),     _("Person|TITLE")),
            ("given",     "f", _("Given"),     _("GIVEN")),
            ("surname",   "l", _("Surname"),    _("SURNAME")),
            ("call",      "c", _("Name|Call"),      _("Name|CALL")),
            ("common",    "x", _("Name|Common"),    _("Name|COMMON")),
            ("initials",  "i", _("Initials"),  _("INITIALS")),
            ("suffix",    "s", _("Suffix"),    _("SUFFIX")),
            ("primary",   "m", _("Name|Primary"), _("PRIMARY")),
            ("primary[pre]",    "0m", _("Primary[pre]"), _("PRIMARY[PRE]")),
            ("primary[sur]",    "1m", _("Primary[sur]"), _("PRIMARY[SUR]")),
            ("primary[con]",    "2m", _("Primary[con]"), _("PRIMARY[CON]")),
            ("patronymic",      "y",  _("Patronymic"), _("PATRONYMIC")),
            ("patronymic[pre]", "0y", _("Patronymic[pre]"), _("PATRONYMIC[PRE]")),
            ("patronymic[sur]", "1y", _("Patronymic[sur]"), _("PATRONYMIC[SUR]")),
            ("patronymic[con]", "2y", _("Patronymic[con]"), _("PATRONYMIC[CON]")),
            ("rawsurnames", "q", _("Rawsurnames"), _("RAWSURNAMES")),
            ("notpatronymic", "o", _("Notpatronymic"),_("NOTPATRONYMIC")),
            ("prefix",    "p", _("Prefix"),    _("PREFIX")),
            ("nickname",  "n", _("Nickname"),    _("NICKNAME")),
            ("familynick", "g", _("Familynick"),   _("FAMILYNICK")),
            ]

A deferred key section for gramps has been created on wiki.

romjerome avatar Dec 30 '19 11:12 romjerome

@romjerome What is the status of this PR?

Nick-Hall avatar Sep 24 '20 20:09 Nick-Hall