Re: how to credit translators using Weblate? Was: Re: [Fedora Weblate] New comment in ibus-typing-booster/app

Mike FABIAN <[email protected]>
Newsgroups gmane.linux.redhat.internationalization
Organization Red Hat
Message-ID <[email protected]>
Mike FABIAN <[email protected]> さんはかきました:

> Jean-Baptiste Holcroft <[email protected]> さんはかきました:
>
>> 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/#reports
>> * weblate's addon to add contributors in comments:
>>   https://docs.weblate.org/en/weblate-3.10.3/admin/addons.html#contributors-in-comment
>>   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-generator
>>
>> 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%20credits

https://developer.gnome.org/gtk3/unstable/GtkAboutDialog.html#gtk-about-dialog-set-translator-credits

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 <[email protected]>, 2018.
    # Jean-Baptiste Holcroft <[email protected]>, 2016. #zanata, 2019.
    # José Fournier <[email protected]>, 2016. #zanata
    # José Fournier <[email protected]>, 2017. #zanata
    # Mike FABIAN <[email protected]>, 2017. #zanata, 2019.
    # Jean-Baptiste Holcroft <[email protected]>, 2018. #zanata, 2019.
    # Mike FABIAN <[email protected]>, 2018. #zanata, 2019.
    # Jean-Baptiste Holcroft <[email protected]>, 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 <[email protected]>, 2018.\n"
    "Jean-Baptiste Holcroft <[email protected]>, 2016, 2018.\n"
    "José Fournier <[email protected]>, 2016.\n"
    "Jérôme Fenal <[email protected]>, 2016.\n"
    "Alexandre Moine <[email protected]>, 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 <[email protected]>
睡眠不足はいい仕事の敵だ。
_______________________________________________
trans mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.