Bug 1024667 - Switching translations for Serbian in Cyrillic and Serbian in Latin doesn’t seem to work on the welcome page
Switching translations for Serbian in Cyrillic and Serbian in Latin doesn’t ...
Status: CLOSED NEXTRELEASE
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
20
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Bohuslav "Slavek" Kabrda
Fedora Extras Quality Assurance
:
: 874233 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-30 04:15 EDT by Mike FABIAN
Modified: 2015-04-20 05:47 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-04-20 05:36:53 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
serbian.png (100.08 KB, image/png)
2013-10-30 04:15 EDT, Mike FABIAN
no flags Details
punjabi.png (93.46 KB, image/png)
2013-11-07 01:34 EST, Mike FABIAN
no flags Details
serbian-fedora-22-beta.png (130.65 KB, image/png)
2015-04-20 05:47 EDT, Mike FABIAN
no flags Details


External Trackers
Tracker ID Priority Status Summary Last Updated
Python 19534 None None None Never

  None (edit)
Description Mike FABIAN 2013-10-30 04:15:11 EDT
Created attachment 817336 [details]
serbian.png

Fedora 20 Beta TC6.

See attached screen shot.

On the welcome page, select

    Српски Serbian

At the right side one can see now

    Српски (Србија)
    Srpski (Latinica) (Srbija)
    Српски (Црна Гора)

The first one is automatically selected. See left side of the screen shot.

Note that the text below WELCOME TO FEDORA is translated in
Serbian in cyrillic script and the “Next” button at the bottom right as well.
Now select

    Srpski (Latinica) (Srbija)

That gives the picture on the right side of the screen shot.

The “Next” button at the bottom right is now showing “Nastavi”,
i.e. it has changed the translation to Serbian in Latin script.
That is nice. But the text below the WELCOME TO FEDORA
is still Serbian in cyrillic script. That seems wrong.
When doing this for the variants of Chinese, I see the translation
below WELCOME TO FEDORA changing, so this is a strange difference.

Both translations seem to exist:

[mfabian@Fedora-20-Beta-TC6-x86_64-netins ~]$ msgunfmt /usr/share/locale/sr@latin/LC_MESSAGES/anaconda.mo | grep -A1 'What language'
msgid "What language would you like to use during the installation process?"
msgstr "Koji jezik biste želeli da koristite tokom procesa instalacije?"
[mfabian@Fedora-20-Beta-TC6-x86_64-netins ~]$ 

[mfabian@Fedora-20-Beta-TC6-x86_64-netins ~]$ msgunfmt /usr/share/locale/sr/LC_MESSAGES/anaconda.mo | grep -A1 'What language'
msgid "What language would you like to use during the installation process?"
msgstr "Који језик бисте желели да користите током процеса инсталације?"
[mfabian@Fedora-20-Beta-TC6-x86_64-netins ~]$
Comment 1 Mike FABIAN 2013-11-05 15:17:50 EST
The problem remains in Fedora-20-Beta-RC3-x86_64-netinst.iso
Comment 2 Mike FABIAN 2013-11-07 01:34:03 EST
Created attachment 820891 [details]
punjabi.png

Same problem for Punjabi, Fedora-20-Beta-RC5-x86_64-netinst.iso.

When pa_PK.UTF-8 is selected (Punjabi in Arabic script),
the translation above stays in Gurmukhi script.

mfabian@ari:~
$ LANG=pa_IN.UTF-8 date
ਵੀਰ  ਨਵੰਬਰ  7 07:30:13 CET 2013
mfabian@ari:~
$ LANG=pa_PK.UTF-8 date
جمعرات نومبر  7 07:30:17 CET 2013
mfabian@ari:~
$
Comment 3 Mike FABIAN 2013-11-07 01:42:11 EST
Sorry, that is not the same actually because in case of Punjabi,
only translations in Gurmukhi script exist in anaconda. 
So when choosing pa_PK.UTF-8, it cannot do better than falling back
to the "pa" translations which are in Gurmukhi script.

But for Serbian, both sr and sr@latin translations exist.

$ rpm -ql anaconda | grep locale/pa
/usr/share/locale/pa/LC_MESSAGES/anaconda.mo
mfabian@ari:~
$ rpm -ql anaconda | grep locale/sr
/usr/share/locale/sr/LC_MESSAGES/anaconda.mo
/usr/share/locale/sr@latin/LC_MESSAGES/anaconda.mo
mfabian@ari:~
Comment 4 Mike FABIAN 2013-11-07 05:39:26 EST
Looks like a python bug (Thanks to Vratislav Podzimek for help!):

$ LANG='sr_RS.UTF-8'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "What language would you like to use during the installation process?").decode("UTF-8"))'
Који језик бисте желели да користите током процеса инсталације?
mfabian@ari:~
$ LANG='sr_RS.UTF-8@latin'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "What language would you like to use during the installation process?").decode("UTF-8"))'
Који језик бисте желели да користите током процеса инсталације?
mfabian@ari:~
$ LANG='sr_RS@latin'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "What language would you like to use during the installation process?").decode("UTF-8"))'
Koji jezik biste želeli da koristite tokom procesa instalacije?
mfabian@ari:~
$ 

So removing the '.UTF-8' makes the translation for Serbian in Latin script work. Weird.

Results are the same for python2 and python3, i.e. if it really
is a python bug, then it still exists in python3.
Comment 5 Mike FABIAN 2013-11-07 05:40:30 EST
The “gettext” command line tool does not have this problem:

mfabian@ari:~
$ LANG='sr_RS@latin' gettext anaconda "What language would you like to use during the installation process?"
Koji jezik biste želeli da koristite tokom procesa instalacije?mfabian@ari:~
$ LANG='sr_RS.UTF-8@latin' gettext anaconda "What language would you like to use during the installation process?"
Koji jezik biste želeli da koristite tokom procesa instalacije?mfabian@ari:~
$ LANG='sr_RS.UTF-8' gettext anaconda "What language would you like to use during the installation process?"
Који језик бисте желели да користите током процеса инсталације?mfabian@ari:~
$
Comment 6 Mike FABIAN 2013-11-09 03:25:20 EST
http://bugs.python.org/issue19534
Comment 7 Mike FABIAN 2013-11-10 13:34:30 EST
I made a patch for http://bugs.python.org/issue19534 but apparently
this was already reported in 2009 as:

http://bugs.python.org/issue5815
Comment 8 Mike FABIAN 2014-01-15 01:27:33 EST
*** Bug 874233 has been marked as a duplicate of this bug. ***
Comment 9 Mike FABIAN 2014-02-19 12:42:55 EST
The upstream issue http://bugs.python.org/issue5815 is
apparently fixed now, but on Fedora 20 the problem still exists.

It is still reproducible as described in comment#4.
Comment 10 Mike FABIAN 2015-04-20 05:36:10 EDT
This seems to be fixed in in Python in
Fedora-Live-Workstation-x86_64-22_Beta-3.iso :

It works both with Python2 and Python3:

    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS.UTF-8@latin'  python3 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Nastavi
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS.UTF-8@latin'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Nastavi
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS@latin'  python3 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Nastavi
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS@latin'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Nastavi
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS'  python3 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Настави
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS'  python2 -c 'import gettext; print(gettext.ldgettext("anaconda", "Continue").decode("UTF-8"))'
    Настави
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$

And the results are the same as with gettext:

    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS.UTF-8@latin' gettext anaconda "Continue"
    Nastavi[mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS.UTF-8@latin' gettextda "Continue"
    [mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS@latin' gettext anaconda "Continue"
    Nastavi[mfabian@Fedora-Live-Workstation-x86_64-2 ~]$ LANG='sr_RS' gettext anaconda "Continue"
    Настави[mfabian@Fedora-Live-Workstation-x86_64-2 ~]$
Comment 11 Mike FABIAN 2015-04-20 05:47:02 EDT
Created attachment 1016278 [details]
serbian-fedora-22-beta.png

The screenshot still looks wrong in Serbian with Latin script,
the “Quit” button is still labelled with Cyrillic script.

But that seems to be the case only because the translations
for Serbian in Latin script are incomplete,

    /usr/share/locale/sr@latin/LC_MESSAGES/anaconda.mo

has a translation for “Continue” but not for “Quit”. Therefore,
for translating “Quit”, 

    /usr/share/locale/sr/LC_MESSAGES/anaconda.mo

is used which has translations both for “Continue” and “Quit”.

strace shows that the correct files are read, Python2, Python3, and
gettext all behave the same for this.

Therefore, the display of “Quit” in Cyrillic script when selecting
Serbian in Latin is only caused because of the incomplete translations
for Serbian in Latin.

Note You need to log in before you can comment on or make changes to this bug.