Bug 1302935

Summary: Untranslatable element in the header
Product: [Fedora] Fedora Reporter: Piotr Drąg <piotrdrag>
Component: dnfAssignee: rpm-software-management
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: low    
Version: 25CC: jmracek, jrohel, mluscon, noriko, packaging-team-maint, piotrdrag, vmukhame
Target Milestone: ---Keywords: EasyFix, i18n, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-2.4.0-1.fc26 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-05-05 13:34:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Screenshot of dnf-0:2.0.0_1-59gaa9ebc1.fc25.noarch
none
Output of dnf upgrade with dnf-1.1.10-4.fc25
none
Output of dnf upgrade with dnf-2.0.0_1-59gaa9ebc1.fc25
none
Output of dnf-3 upgrade with dnf-2.0.0_1-59gaa9ebc1.fc25 none

Description Piotr Drąg 2016-01-29 03:33:35 UTC
"Package" in the header (" Package           Arch        Version              Repository             Size ") is not translated, even though the translation is complete.

It may have something to do with plural form handling, as this string:

#: ../dnf/cli/output.py:1050 ../dnf/cli/output.py:1090
#: ../dnf/cli/output.py:1106 ../dnf/cli/output.py:1913
msgid "Package"
msgid_plural "Packages"
msgstr[0] "Pakiet"
msgstr[1] "Pakiety"
msgstr[2] "Pakietów"

doesn't actually appear in dnf/cli/output.py:1050 nor dnf/cli/output.py:1913.

Comment 1 Honza Silhan 2016-02-01 13:20:01 UTC
We'll take a look.

Comment 2 Parag Nemade 2016-02-03 15:48:24 UTC
I am not sure how to fix this. We have "Package" as plural string at 3 places and at one place we don't want it plural and that is this 1050 line place and thus its failing to load the translations for that singular "Package" string.

Comment 3 Igor Gnatenko 2016-04-04 08:34:47 UTC
*** Bug 1322682 has been marked as a duplicate of this bug. ***

Comment 4 Fedora Admin XMLRPC Client 2016-07-08 09:33:37 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 5 Fedora End Of Life 2016-11-24 15:15:43 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 6 Jaroslav Mracek 2017-01-12 16:31:56 UTC
I have tried it with dnf-2.0 and I cannot reproduce it. Please can you try upstream version of dnf-2.0 from our test repository ("dnf copr enable rpmsoftwaremanagement/dnf-nightly"). Or provide reproducer. Thanks a lot

Comment 7 Piotr Drąg 2017-01-12 17:39:56 UTC
Created attachment 1240044 [details]
Screenshot of dnf-0:2.0.0_1-59gaa9ebc1.fc25.noarch

It's still happening (with LANG=pl_PL.UTF-8) on:


[root@piotrek-laptop ~]# dnf --version
2.0.0
  Zainstalowane: dnf-0:2.0.0_1-59gaa9ebc1.fc25.noarch w dniu 2017-01-12 17:32
  Zbudowane    :  w dniu 2017-01-12 01:53

  Zainstalowane: rpm-0:4.13.0-6.fc25.x86_64 w dniu 2016-12-07 00:16
  Zbudowane    : Fedora Project w dniu 2016-12-03 12:31

Comment 8 Jaroslav Mracek 2017-01-12 18:09:44 UTC
Thanks a lot, but can you also provide whole output with dnf-2 and dnf-3? Thanks a lot.

Comment 9 Piotr Drąg 2017-01-12 18:39:44 UTC
Created attachment 1240059 [details]
Output of dnf upgrade with dnf-1.1.10-4.fc25

Comment 10 Piotr Drąg 2017-01-12 18:40:31 UTC
Created attachment 1240060 [details]
Output of dnf upgrade with dnf-2.0.0_1-59gaa9ebc1.fc25

Comment 11 Piotr Drąg 2017-01-12 18:41:19 UTC
Created attachment 1240061 [details]
Output of dnf-3 upgrade with dnf-2.0.0_1-59gaa9ebc1.fc25

Comment 12 Jaroslav Rohel 2017-04-20 14:25:08 UTC
Fixed in PR https://github.com/rpm-software-management/dnf/pull/789

Comment 13 Fedora Update System 2017-05-02 15:40:05 UTC
dnf-plugins-core-2.0.0-1.fc26 libdnf-0.8.2-1.fc26 dnf-2.4.0-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4e95959f0d

Comment 14 Fedora Update System 2017-05-04 09:48:20 UTC
dnf-2.4.0-1.fc26 dnf-plugins-core-2.0.0-1.fc26 dnf-plugins-extras-2.0.0-1.fc26 libdnf-0.8.2-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-4e95959f0d

Comment 15 Piotr Drąg 2017-05-04 11:39:28 UTC
With dnf-2.4.0-1.fc26, I have:

================================================================================
 pakiet               Arch.   Wersja                    Repoz.            Rozm.
================================================================================

Which is almost correct. The translation used for the transaction summary must be lower-case (“Instalacja     3 pakiety”), so now the column header is lower-case as well. Any chance of using gettext context to disambiguate the strings?

https://wiki.gnome.org/TranslationProject/DevGuidelines/Translation%20contexts

Comment 16 Fedora Update System 2017-05-04 22:04:43 UTC
dnf-2.4.0-1.fc26, dnf-plugins-core-2.0.0-1.fc26, dnf-plugins-extras-2.0.0-1.fc26, libdnf-0.8.2-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-4e95959f0d

Comment 17 Jaroslav Rohel 2017-05-05 07:44:11 UTC
>Any chance of using gettext context to disambiguate the strings?
https://wiki.gnome.org/TranslationProject/DevGuidelines/Translation%20contexts

I understand your request. I commented the situation here https://github.com/rpm-software-management/dnf/pull/792 .

Our functions for translation (_, P_) are based on "gettext — Multilingual internationalization services" https://docs.python.org/3/library/gettext.html .
And I think that translation with context is not supported in Python. There are requests for add support for translation with context to Python https://bugs.python.org/issue2504. I don't know topical state of the problem. So correct me If it is not true. But remember DNF also must works with older Python 2.

So first task is implement somethink like C_() function. Then we can use translation with  context in DNF.

Comment 18 Fedora Update System 2017-05-05 13:34:18 UTC
dnf-2.4.0-1.fc26, dnf-plugins-core-2.0.0-1.fc26, dnf-plugins-extras-2.0.0-1.fc26, libdnf-0.8.2-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.