Mike FABIAN <mfabian(a)redhat.com> さんはかきました:
Jean-Baptiste Holcroft <jean-baptiste(a)holcroft.fr> さんはかきました:
> But the real fix is to use one of these ways to credits translators:
> * git log (thanks to weblate, you have one commit per real author)
> * weblate's reports
>
https://translate.stg.fedoraproject.org/projects/ibus-typing-booster/#rep...
> * weblate's addon to add contributors in comments:
>
https://docs.weblate.org/en/weblate-3.10.3/admin/addons.html#contributors...
> I activate this by default on every single component
> * you can also enable the statistics generator:
>
https://docs.weblate.org/en/weblate-3.10.3/admin/addons.html#statistics-g...
>
> As you can see, there is many ways to credits translators, and this is
> very nice of you to include us.
> I feel like the "credit-translators" string should not be encouraged
> anymore.
It is used to display the translators in the "About" dialog.
See attached screenshot.
I don’t know how to achieve that with the other ways weblate uses to
credit translators. The comments in the .po files are nice but they
cannot be used in the "About" dialog, at least I have no idea how.
It is supposed to be done that way:
https://wiki.gnome.org/TranslationProject/DevGuidelines/Add%20translator%...
https://developer.gnome.org/gtk3/unstable/GtkAboutDialog.html#gtk-about-d...
If there is no msgid "translator-credits" or similar in the .po files,
this information will not be in the compiled .mo file.
The .po file may have a comment at the top like:
# Thierry Thomas <thierry(a)FreeBSD.org>, 2018.
# Jean-Baptiste Holcroft <jean-baptiste(a)holcroft.fr>, 2016. #zanata, 2019.
# José Fournier <jaaf64(a)zoraldia.com>, 2016. #zanata
# José Fournier <jaaf64(a)zoraldia.com>, 2017. #zanata
# Mike FABIAN <mfabian(a)redhat.com>, 2017. #zanata, 2019.
# Jean-Baptiste Holcroft <jean-baptiste(a)holcroft.fr>, 2018. #zanata, 2019.
# Mike FABIAN <mfabian(a)redhat.com>, 2018. #zanata, 2019.
# Jean-Baptiste Holcroft <jean-baptiste(a)holcroft.fr>, 2019. #zanata
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
...
But these names of the translators are lost when the .po file is
compiled into a .mo file:
$ msgunfmt /usr/share/locale/fr/LC_MESSAGES/ibus-typing-booster.mo |head
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
...
The only place in the .mo file where this information is still available
is the "translator-credits":
$ msgunfmt /usr/share/locale/fr/LC_MESSAGES/ibus-typing-booster.mo | grep -A5 -B5
Jean-Baptiste
msgstr "symboles"
msgid "translator-credits"
msgstr ""
"Thierry Thomas <thierry(a)FreeBSD.org>, 2018.\n"
"Jean-Baptiste Holcroft <jean-baptiste(a)holcroft.fr>, 2016, 2018.\n"
"José Fournier <jaaf64(a)zoraldia.com>, 2016.\n"
"Jérôme Fenal <jfenal(a)gmail.com>, 2016.\n"
"Alexandre Moine <nobrakal(a)gmail.com>, 2016."
msgid "travel"
The .po files are not even installed, so they are not available anymore
when the program runs.
In order to have that information, one would need to install the .po
files as well somewhere, or the extract the comments from the .po files
to some files (different per language) and install these. Then, at
runtime, check the current locale, search for the right file (applying
fallbacks from fr_FR -> fr etc ... loading the file and parsing out the
names ... partly reimplenting gettext in that way.
I think using "translator-credits" is the right way to do this.
--
Mike FABIAN <mfabian(a)redhat.com>
睡眠不足はいい仕事の敵だ。