Bug 1024667 - Switching translations for Serbian in Cyrillic and Serbian in Latin doesn’t seem to work on the welcome page
Summary: Switching translations for Serbian in Cyrillic and Serbian in Latin doesn’t ...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: python
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Bohuslav "Slavek" Kabrda
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 874233 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-30 08:15 UTC by Mike FABIAN
Modified: 2015-04-20 09:47 UTC (History)
13 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-04-20 09:36:53 UTC
Type: Bug
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Python 19534 0 None None None Never

Description Mike FABIAN 2013-10-30 08:15:11 UTC
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 20:17:50 UTC
The problem remains in Fedora-20-Beta-RC3-x86_64-netinst.iso

Comment 2 Mike FABIAN 2013-11-07 06:34:03 UTC
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 06:42:11 UTC
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 10:39:26 UTC
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 10:40:30 UTC
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 08:25:20 UTC
http://bugs.python.org/issue19534

Comment 7 Mike FABIAN 2013-11-10 18:34:30 UTC
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 06:27:33 UTC
*** Bug 874233 has been marked as a duplicate of this bug. ***

Comment 9 Mike FABIAN 2014-02-19 17:42:55 UTC
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 09:36:10 UTC
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 09:47:02 UTC
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.