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

I18N: Mark messages in "dnf install" output for a translation #1696

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented 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: #1688

Copy link

We were not able to find or create Copr project packit/rpm-software-management-dnf5-1696 specified in the config with the following error:

Packit received HTTP 500 Internal Server Error from Copr Service. Check the Copr status page: https://copr.fedorainfracloud.org/status/stats/, or ask for help in Fedora Build System matrix channel: https://matrix.to/#/#buildsys:fedoraproject.org.

Unless the HTTP status code above is >= 500, please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

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
@m-blaha m-blaha self-assigned this Sep 16, 2024
Copy link
Member

@m-blaha m-blaha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@m-blaha m-blaha added this pull request to the merge queue Sep 16, 2024
Merged via the queue into rpm-software-management:main with commit 8ad4614 Sep 16, 2024
12 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Many texts in "dnf install" output are not internationalized
2 participants