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

Many texts in "dnf install" output are not internationalized #1688

Closed
bittin opened this issue Sep 10, 2024 · 12 comments · Fixed by #1696
Closed

Many texts in "dnf install" output are not internationalized #1688

bittin opened this issue Sep 10, 2024 · 12 comments · Fixed by #1696
Assignees
Labels
bug Originally reported in Jira or Bugzilla Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@bittin
Copy link

bittin commented Sep 10, 2024

dnf5 in Fedora 41 installed with https://kojipkgs.fedoraproject.org/compose/branched/Fedora-41-20240910.n.0/compose/Workstation/x86_64/iso/Fedora-Workstation-Live-x86_64-41-20240910.n.0.iso is still in English: https://github.com/rpm-software-management/dnf5/blob/main/dnf5/po/sv.po even if there is a Swedish translation

https://i.imgur.com/FjgHw5d.png

@ppisar
Copy link
Contributor

ppisar commented Sep 11, 2024

Could you copy the DNF command and its output here as a plain text? I cannot fetch the image from the third-party server due to excessive JavaScript.

@bittin
Copy link
Author

bittin commented Sep 11, 2024

Could you copy the DNF command and its output here as a plain text? I cannot fetch the image from the third-party server due to excessive JavaScript.

fed41betarc11@localhost-live:~$ sudo dnf install emacs
[sudo] lösenord för fed41betarc11:
Updating and loading repositories:
Repositories loaded.
Package Arch Version Repository Size
Installing:
emacs x86_64 1:29.4-29.fc41 fedora 167.0 MiB
Installing dependencies:
emacs-common x86_64 1:29.4-29.fc41 fedora 101.2 MiB
emacsclient x86_64 1:29.4-29.fc41 fedora 69.2 KiB
gcc x86_64 14.2.1-1.fc41 fedora 104.1 MiB
glibc-devel x86_64 2.40-3.fc41 fedora 35.0 KiB
glibc-headers-x86 noarch 2.40-3.fc41 fedora 2.2 MiB
kernel-headers x86_64 6.11.0-0.rc7.56.fc41 updates-testing 6.4 MiB
libXaw x86_64 1.0.16-2.fc41 fedora 515.2 KiB
libgccjit x86_64 14.2.1-1.fc41 fedora 37.4 MiB
libotf x86_64 0.9.16-5.fc41 fedora 251.6 KiB
libstdc++-devel x86_64 14.2.1-1.fc41 fedora 15.4 MiB
libtree-sitter x86_64 0.22.5-2.fc41 fedora 197.7 KiB
libxcrypt-devel x86_64 4.4.36-7.fc41 fedora 30.3 KiB
make x86_64 1:4.4.1-8.fc41 fedora 1.8 MiB
Installing weak dependencies:
gcc-c++ x86_64 14.2.1-1.fc41 fedora 38.2 MiB
info x86_64 7.1-3.fc41 fedora 361.8 KiB
libtree-sitter-java x86_64 0.21.0-2.fc41 fedora 465.3 KiB

Transaction Summary:
Installing: 17 packages

Total size of inbound packages is 142 MiB. Need to download 142 MiB.
After this operation 476 MiB will be used (install 476 MiB, remove 0 B).
Is this ok [y/N]:

but pretty much everything is in English even if there is a Swedish translation me and @goeranu have worked on in Weblate: https://translate.fedoraproject.org/projects/dnf5/dnf5/sv/

and the files are in the repo: https://github.com/rpm-software-management/dnf5-l10n/blob/main/dnf5/sv.po
so would be nice if our work actually was used

@ppisar
Copy link
Contributor

ppisar commented Sep 11, 2024

Could you tell us what locale do you use (locale command output) and what DNF5 version you have installed (rpm -q dnf5)?

For me it works. The first message in the linked sv.po is:

#: commands/advisory/advisory_info.hpp:33
msgid "Print details about advisories"
msgstr "Skriv ut detaljer om rekommendationer"

It's a description of "info" command in dnf advisory --help output.

When I install a Swedish locale (dnf install glibc-langpack-sv) and call dnf5 advisory --help in sv_SE.utf8 locale, I get:

# LC_ALL=sv_SE.utf8 dnf5 advisory --help
Användning:
  dnf5 [GLOBAL OPTIONS] advisory <COMMAND> ...
                                
Query Commands:                 
  list                          Lista rekommendationer
  info                          Skriv ut detaljer om rekommendationer
  summary                       Skriv ut en sammanfattning av rekommendationer

That matches the translation.

@bittin
Copy link
Author

bittin commented Sep 11, 2024

Could you tell us what locale do you use (locale command output) and what DNF5 version you have installed (rpm -q dnf5)?

For me it works. The first message in the linked sv.po is:

#: commands/advisory/advisory_info.hpp:33
msgid "Print details about advisories"
msgstr "Skriv ut detaljer om rekommendationer"

It's a description of "info" command in dnf advisory --help output.

When I install a Swedish locale (dnf install glibc-langpack-sv) and call dnf5 advisory --help in sv_SE.utf8 locale, I get:

# LC_ALL=sv_SE.utf8 dnf5 advisory --help
Användning:
  dnf5 [GLOBAL OPTIONS] advisory <COMMAND> ...
                                
Query Commands:                 
  list                          Lista rekommendationer
  info                          Skriv ut detaljer om rekommendationer
  summary                       Skriv ut en sammanfattning av rekommendationer

That matches the translation.

fed41betarc11@localhost-live:$ locale
LANG=sv_SE.UTF-8
LC_CTYPE="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_MESSAGES="sv_SE.UTF-8"
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"
LC_IDENTIFICATION="sv_SE.UTF-8"
LC_ALL=
fed41betarc11@localhost-live:
$ rpm -q dnf5
dnf5-5.2.5.0-2.fc41.x86_64
fed41betarc11@localhost-live:~$ dnf advisory --help
Användning:
dnf5 [GLOBAL OPTIONS] advisory ...

Query Commands:
list Lista rekommendationer
info Skriv ut detaljer om rekommendationer
summary Skriv ut en sammanfattning av rekommendationer

still getting english when trying to install a package with sudo dnf5 install emacs

as the example above, even if everything should be fully translated

@ppisar
Copy link
Contributor

ppisar commented Sep 11, 2024

I see. Your problem is that not all messages printed by DNF5 are internationalized. That means they are not in the message catalogs and they do not undergo a lookup in for the translation. That's e.g. the case of "Updating and loading repositories: message.

This is not specific to Swedish. It concerns all languages. That's a cause of sloppy programming when internationalization was not implemented from the very beginning.

@bittin
Copy link
Author

bittin commented Sep 11, 2024

I see. Your problem is that not all messages printed by DNF5 are internationalized. That means they are not in the message catalogs and they do not undergo a lookup in for the translation. That's e.g. the case of "Updating and loading repositories: message.

This is not specific to Swedish. It concerns all languages. That's a cause of sloppy programming when internationalization was not implemented from the very beginning.

heh then you have something to do ;)
have fun :)

would be great if mine and @goeranu

and the other translators work was actually used

@ppisar ppisar changed the title dnf5 in Fedora 41 not in Swedish yet? Many texts in "dnf install" output are not internationalized Sep 11, 2024
@ppisar ppisar added Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take labels Sep 11, 2024
@ppisar
Copy link
Contributor

ppisar commented Sep 11, 2024

Corresponding Fedora bug report https://bugzilla.redhat.com/show_bug.cgi?id=2311298.

@ppisar ppisar added the bug Originally reported in Jira or Bugzilla label Sep 11, 2024
@ppisar ppisar self-assigned this Sep 12, 2024
ppisar added a commit to ppisar/dnf5 that referenced this issue Sep 13, 2024
Many texts were always in English because the code did not
internatialinze them. This patch fixes it.

fmt::format() calls were replaced with libdnf5::utils::sformat()
calls to be able to pass a localized string as a formatting string.

Sentences glued from words, e.g. "Installing dependencies:" in
a transaction table, were changed to a single-string sentences in the
code. Having a full sentece is important for the translators.

I fixed spelling at few places, especially around importing PGP keys.

I used internatinoalized plural forms in the transaction summary
("Installing: 1 package" vs "Installing: 2 packages").

I also internationalized output to DNF log. At the end, it's
a human-oriented text.

I intentionally left out libdnf_throw_assertion() arguments from the
internationalization because that function needs changing its
implmentation to accept nonconst-literal formatting string. That will
be implemented in a separate patch.

I manully tested significant parts of the output to be sure the
messages propetly undergo localization.

Resolves: rpm-software-management#1688
ppisar added a commit to ppisar/dnf5 that referenced this issue Sep 13, 2024
Many texts were always in English because the code did not
internatialinze them. This patch fixes it.

fmt::format() calls were replaced with libdnf5::utils::sformat()
calls to be able to pass a localized string as a formatting string.

Sentences glued from words, e.g. "Installing dependencies:" in
a transaction table, were changed to a single-string sentences in the
code. Having a full sentece is important for the translators.

I fixed spelling at few places, especially around importing PGP keys.

I used internatinoalized plural forms in the transaction summary
("Installing: 1 package" vs "Installing: 2 packages").

I also internationalized output to DNF log. At the end, it's
a human-oriented text.

I intentionally left out libdnf_throw_assertion() arguments from the
internationalization because that function needs changing its
implmentation to accept nonconst-literal formatting string. That will
be implemented in a separate patch.

I manully tested significant parts of the output to be sure the
messages propetly undergo localization.

Resolves: rpm-software-management#1688
github-merge-queue bot pushed a commit that referenced this issue Sep 16, 2024
Many texts were always in English because the code did not
internatialinze them. This patch fixes it.

fmt::format() calls were replaced with libdnf5::utils::sformat()
calls to be able to pass a localized string as a formatting string.

Sentences glued from words, e.g. "Installing dependencies:" in
a transaction table, were changed to a single-string sentences in the
code. Having a full sentece is important for the translators.

I fixed spelling at few places, especially around importing PGP keys.

I used internatinoalized plural forms in the transaction summary
("Installing: 1 package" vs "Installing: 2 packages").

I also internationalized output to DNF log. At the end, it's
a human-oriented text.

I intentionally left out libdnf_throw_assertion() arguments from the
internationalization because that function needs changing its
implmentation to accept nonconst-literal formatting string. That will
be implemented in a separate patch.

I manully tested significant parts of the output to be sure the
messages propetly undergo localization.

Resolves: #1688
@bittin
Copy link
Author

bittin commented Sep 16, 2024

yay, thanks for the C++ code writing you people in Czechia, now mine and @goeranu Swedish
and other peoples translations, actually can be shown in dnf5 for the Fedora Linux 41 release in 1-2 months

@bittin
Copy link
Author

bittin commented Sep 17, 2024

talked to @ppisar on #fedora-devel on irc.libera.chat Libera.chat IRC yesterday
and have started translating the new strings for dnf5 into Swedish now

@bittin
Copy link
Author

bittin commented Sep 17, 2024

talked to @ppisar on #fedora-devel on irc.libera.chat Libera.chat IRC yesterday and have started translating the new strings for dnf5 into Swedish now

one i was unsure of but now its 99% done
@goeranu do you have time to look at the last 1% :) ;)

@goeranu
Copy link

goeranu commented Sep 17, 2024

Done.

@bittin
Copy link
Author

bittin commented Sep 17, 2024

@goeranu thx :)
@ppisar so everything is in Swedish again for the Fedora 41 release in 1,5-2 months time now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Originally reported in Jira or Bugzilla Priority: LOW Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants