Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"dnf --help" output is not mostly internationalized #1736

Open
bc-lee opened this issue Sep 30, 2024 · 4 comments
Open

"dnf --help" output is not mostly internationalized #1736

bc-lee opened this issue Sep 30, 2024 · 4 comments
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@bc-lee
Copy link
Contributor

bc-lee commented Sep 30, 2024

It seems that the POT file at https://github.com/rpm-software-management/dnf5/blob/5.2.6.2/dnf5/po/dnf5.pot was last updated on 2023-11-21, which is more than 10 months ago. When I run $ ninja dnf5-pot in the dnf5 source repository, a surprisingly large number of strings are updated. This implies that current translations are referring to outdated strings, meaning that even though translation contributors might think their work is 100% complete, many of the texts are actually not translated.

Here’s the output of $ git diff --stat dnf5/po over generated POT file changes:

$ git diff --stat dnf5/po
 dnf5/po/dnf5.pot | 1015 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 977 insertions(+), 38 deletions(-)

I believe we need to update the POT files for dnf5, and it might be beneficial to update them automatically (e.g., every month) to avoid this situation.

The image below shows the result of $ dnf --help in Korean, where many strings are not translated. (dnf5-5.2.6.2-1.fc41.x86_64):

스크린샷 2024-09-30 13-56-16

@ppisar
Copy link
Contributor

ppisar commented Sep 30, 2024

*.pot files, like dnf5/po/dnf5.pot, are not updated here. They are instead updated in https://github.com/rpm-software-management/dnf5-l10n repository every day. The translations are then copied back just before every DNF5 release. It's so not to clutter commit history of this repository with updates from translators. Another reason is to prevent Weblate service from running into merge conflicts. But I agree that it's confusing.

Another question is why the texts you showed in the image are not localized. It's because the texts are not marked for a translation in the code. That needs to be fixed.

@ppisar ppisar changed the title Update POT files for dnf5? "dnf --help" output is not mostly internationalized Sep 30, 2024
@ppisar ppisar added Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Sep 30, 2024
@bc-lee
Copy link
Contributor Author

bc-lee commented Sep 30, 2024

Thanks for the clarification. It turns out that dnf5-i10n's dnf5.pot files are updated regularly, so I don't need to worry about them. I should have checked that first.

@bc-lee
Copy link
Contributor Author

bc-lee commented Sep 30, 2024

I still need to understand why translated entries are not appearing as translated in dnf5.

When I run ninja, the following command is executed:

$ ninja -v
[1/57] cd /path/to/dnf5/cmake-build-debug/dnf5/po && /usr/bin/msgmerge --quiet --update --backup=none -s /path/to/dnf5/cmake-build-debug/dnf5/po/ko.po /path/to/dnf5/dnf5/po/dnf5.pot && /usr/bin/msgfmt -o /path/to/dnf5/cmake-build-debug/dnf5/po/ko.gmo /path/to/dnf5/cmake-build-debug/dnf5/po/ko.po

From what I understand, msgmerge merges the translations from dnf5.pot into ko.po, and then msgfmt compiles ko.po into ko.gmo.

When I count the number of lines starting with msgid (^msgid), the numbers are as follows:

  • dnf5/po/dnf5.pot (which hasn't been updated for a long time): 74
  • dnf5/po/ko.po: 261
  • cmake-build-debug/dnf5/po/ko.po: 74

I also ran $ msgunfmt -o dnf5/po/ko-uncompiled.po cmake-build-debug/dnf5/po/ko.gmo to get the uncompiled version of ko.po. The number of lines starting with msgid in ko-uncompiled.po is also 74.

It seems that the outdated dnf5/po/dnf5.pot is indeed affecting the translation process. If this is the case, I think we need to update the translation template file in this repository, as well as the ones in the dnf-l10n repository.

@ppisar
Copy link
Contributor

ppisar commented Oct 1, 2024

You are right. The translation template files are never updated in dnf5 repository and thus any msgmerge call removes newly added strings for translation. It's a bug in .github/actions/weblate-pull-translations/action.yml script. I opened issue #1744.

bc-lee added a commit to bc-lee/dnf5 that referenced this issue Oct 2, 2024
Use `_(msgId)` in bgettext-lib.h to mark texts as eligible for translation.

Partially resolves: rpm-software-management#1736
bc-lee added a commit to bc-lee/dnf5 that referenced this issue Oct 2, 2024
Use `_(msgId)` in bgettext-lib.h to mark texts as eligible for translation.

Related: rpm-software-management#1736
bc-lee added a commit to bc-lee/dnf5 that referenced this issue Oct 7, 2024
Use _(msgId) in bgettext-lib.h to mark text as eligible for
translation. This will allow translators to translate the short
descriptions of the commands in dnf5 --help. Further changes will be
required to make each command description translatable.

Related: rpm-software-management#1736
github-merge-queue bot pushed a commit that referenced this issue Oct 7, 2024
Use _(msgId) in bgettext-lib.h to mark text as eligible for
translation. This will allow translators to translate the short
descriptions of the commands in dnf5 --help. Further changes will be
required to make each command description translatable.

Related: #1736
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: MEDIUM Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Status: Backlog
Development

No branches or pull requests

2 participants