Bug 559960 - [all Lang]Translation is not available with 3.6 release
Summary: [all Lang]Translation is not available with 3.6 release
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: firefox
Version: 13
Hardware: All
OS: Linux
high
medium
Target Milestone: ---
Assignee: Martin Stransky
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 558226 (view as bug list)
Depends On:
Blocks: F13Blocker, F13FinalBlocker 581392
TreeView+ depends on / blocked
 
Reported: 2010-01-29 13:39 UTC by Praveen Arimbrathodiyil
Modified: 2013-06-17 04:07 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 580444 581392 (view as bug list)
Environment:
Last Closed: 2010-04-13 10:45:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
screenshot of firefox by default (217.38 KB, image/png)
2010-02-17 07:04 UTC, Mamoru TASAKA
no flags Details
screenshot with setting LC_MESSAGES explicitly (180.83 KB, image/png)
2010-02-17 07:05 UTC, Mamoru TASAKA
no flags Details
Another screenshot with setting LC_MESSAGES explicitly (179.73 KB, image/png)
2010-02-17 07:06 UTC, Mamoru TASAKA
no flags Details
patch to firefox.in (1.14 KB, patch)
2010-02-24 13:52 UTC, Martin Stransky
no flags Details | Diff
another fix (1.04 KB, patch)
2010-04-13 09:27 UTC, Martin Stransky
no flags Details | Diff

Description Praveen Arimbrathodiyil 2010-01-29 13:39:34 UTC
Description of problem:
Firefox does not start with Malayalam interface even though locale is set to ml_IN (other applications are correctly picking up the locale) and 3.6 release has Malayalam translations.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. select Malayalam locale from login screen
2. open firefox
3. observe interface language
  
Actual results:

firefox is started in English

Expected results:
firefox should choose the correct interface based on locale

Additional info:
I can see Malayalam langpack is installed /usr/lib64/firefox-3.6/langpacks/langpack-ml.org by the rpm

Comment 1 A S Alam 2010-01-29 17:05:17 UTC
Translation for any language is not working 
Tested with: hi_IN, fr_FR, de_DE, zh_TW

Version:
firefox-3.6.1-1.fc13

Comment 2 Mamoru TASAKA 2010-02-17 03:57:14 UTC
Even in ja_JP.UTF-8 environment, with 
firefox-3.6.1-1.fc13.i686
xulrunner-1.9.2.1-1.fc13.i686

All menus are displayed in English.

One problem is that /usr/bin/firefox reads:
-----------------------------------------------------------------
   188      SHORTMOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*||g"`
   189      MOZLOCALE=`echo $LC_MESSAGES | sed "s|_\([^.]*\).*|-\1|g"`
   190  
   191      # Try to link global langpacks to an extension directory
   192      if [ -f $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then
-----------------------------------------------------------------

However:
-----------------------------------------------------------------
[tasaka1@localhost ~]$ set | grep '^LANG'
LANG=ja_JP.UTF-8
[tasaka1@localhost ~]$ set | grep '^LC'
[tasaka1@localhost ~]$ echo $LC_MESSAGES

[tasaka1@localhost ~]$ locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
---------------------------------------------------------------------

i.e. LC_MESSAGES is empty, only LANG=ja_JP.UTF-8 is set by default.

However even after I set LC_MESSAGES=ja_JP.UTF-8 ; search engine still
show entries for English users (i.e. for Japanese search engine list
should show Wikipedia(ja), however search engine list still shows
Wikipedia(en))

Comment 3 Mamoru TASAKA 2010-02-17 07:04:22 UTC
Created attachment 394688 [details]
screenshot of firefox by default

Some screenshot

By default, only LANG=ja_JP.UTF-8 is set. With this,
firefox shows menus and so on all in English.

Comment 4 Mamoru TASAKA 2010-02-17 07:05:23 UTC
Created attachment 394689 [details]
screenshot with setting LC_MESSAGES explicitly

With setting LC_MESSAGES=ja_JP.UTF-8 firefox shows Japanese
menus.

Comment 5 Mamoru TASAKA 2010-02-17 07:06:57 UTC
Created attachment 394690 [details]
Another screenshot with setting LC_MESSAGES explicitly

However search engine still shows entries for English users.
For example search engine shows "Wikipedia (en)" entry, not
"Wikipedia (ja)" entry.

Comment 6 Martin Stransky 2010-02-17 07:16:26 UTC
see https://bugzilla.redhat.com/show_bug.cgi?id=441973 we switched from $LANG to $LC_MESSAGES.

Comment 7 fujiwara 2010-02-17 07:29:33 UTC
> see https://bugzilla.redhat.com/show_bug.cgi?id=441973 we switched from $LANG
to $LC_MESSAGES.

If you use the shell script to detect locales, I think it's better to follow setlocale(3).

MOZLOCALE=$LC_ALL
MOZLOCALE=${MOZLOCALE:-LC_MESSAGES}
MOZLOCALE=${MOZLOCALE:-LANG}
MOZLOCALE=`echo $MOZLOCALE | sed "s|_\([^.]*\).*|-\1|g"`

Comment 8 fujiwara 2010-02-17 07:33:14 UTC
typo:
-MOZLOCALE=${MOZLOCALE:-$LC_MESSAGES}
+MOZLOCALE=${MOZLOCALE:-$LC_MESSAGES}

Comment 9 Martin Stransky 2010-02-24 13:32:12 UTC
*** Bug 558226 has been marked as a duplicate of this bug. ***

Comment 10 Martin Stransky 2010-02-24 13:52:05 UTC
Created attachment 396064 [details]
patch to firefox.in

Comment 11 Martin Stransky 2010-02-24 14:13:51 UTC
Added to firefox-3.6.1-2.fc14

Comment 12 drago01 2010-02-27 12:15:33 UTC
(In reply to comment #11)
> Added to firefox-3.6.1-2.fc14    

Can we get this change into f13 too?

Comment 13 Bug Zapper 2010-03-15 14:17:36 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 13 development cycle.
Changing version to '13'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 14 Martin Stransky 2010-03-18 13:11:01 UTC
Already in firefox-3.6.1-2.fc13, closing.

Comment 15 drago01 2010-03-20 11:54:39 UTC
(In reply to comment #14)
> Already in firefox-3.6.1-2.fc13, closing.    

You have to push it as an update (same as you would do in F12) or it will only sit in koji.

Comment 16 A S Alam 2010-03-26 02:40:31 UTC
with today's update,
firefox-3.6.2-1.fc13.x86_64 is still not translated

Comment 17 fujiwara 2010-03-26 04:13:19 UTC
(In reply to comment #16)
> firefox-3.6.2-1.fc13.x86_64 is still not translated    

In my env, the same firefox is translated with LANG= ja_JP.utf8, de_DE.utf8 and
fr_FR.utf8.

Comment 18 A S Alam 2010-03-26 05:00:11 UTC
sorry about raw comment #16, 

following is Not working while upstream released [1]:
bn_IN
zh_TW
zh_CN
gu_IN
hi_IN
nn_NO
pt_BR
pt_PT
pa_IN
es_AR
es_ES

it seems there is issue with locale name (LL-RR)
Mozilla upstream releases use "-" (pt-BR) instead of "_" (pt_BR)

which is not with glibc with following warning

"Gtk-WARNING **: Locale not supported by C library.
	Using the fallback 'C' locale"

Test Case:
1. LANG=pt_BR.UTF-8 firefox , result - firefox will be in English
2. LANG=pt-BR.UTF-8 firefox, result - firefox will be in pt_BR, but glibc error.


[1] http://www.mozilla.com/en-US/firefox/all.html

Comment 19 fujiwara 2010-03-26 05:26:10 UTC
I guess the latest issue might be another regression bug.

--- /usr/bin/firefox.orig	2010-03-26 14:12:18.000000000 +0900
+++ /usr/bin/firefox	2010-03-26 14:23:22.000000000 +0900
@@ -191,7 +191,7 @@
     # Try without a local variant first, then with a local variant
     # So that pt-BR doesn't try to use pt for example
     SHORTMOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*||g"`
-    MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"`
+    MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|\(.*\)_\([^.]*\).*|\1-\2|g"`
 
     # Try to link global langpacks to an extension directory
     if [ -f $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then
@@ -203,6 +203,15 @@
                   $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org
             echo "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org" > $FEDORA_LANGPACK_CONFIG
         fi
+    elif [ -f $MOZ_LANGPACKS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then
+        if [ -d $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org ]; then
+            rmdir "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org" > /dev/null 2>&1
+        fi 
+        if ! [ -e $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org ]; then
+            ln -s $MOZ_LANGPACKS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org \
+                  $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org
+            echo "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org" > $FEDORA_LANGPACK_CONFIG
+        fi
     elif [ -f $MOZ_EXTENSIONS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then
         if [ -d $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org ]; then
             rmdir "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org" > /dev/null 2>&1

Comment 20 Mamoru TASAKA 2010-04-08 09:47:08 UTC
Same issue appears on thunderbird-3.0.4-1.fc13.i686, so cloning
for thunderbird.

Comment 21 A S Alam 2010-04-11 05:56:17 UTC
firefox-3.6.3-2.fc13.x86_64 still has problem with pa_IN lang

Comment 22 Martin Stransky 2010-04-13 09:27:15 UTC
Created attachment 406188 [details]
another fix

Comment 23 Martin Stransky 2010-04-13 10:45:49 UTC
Added to firefox-3.6.3-4.fc13

Comment 24 fujiwara 2010-04-14 02:21:46 UTC
(In reply to comment #22)
> Created an attachment (id=406188) [details]
> another fix    

Cool.
Hmm.., I cannot remember why I tried to modify $MOZLOCALE .

Comment 25 Iván Jiménez 2010-05-08 01:19:16 UTC
It isn't completely fixed:

LANG=es_CO.UTF-8 firefox (appears in english)
LANG=es_ES.UTF-8 firefox (appears in spanish)

Same happens if es_XX hasn't a langpack (eg es_EC), I think these cases should fallback to es.

Comment 26 Iván Jiménez 2010-05-10 17:53:14 UTC
On further testing, the interface isn't translated for any system locale if there are firefox langpacks with regional variants and not using that variant, eg:

LANG=zh_HK.UTF-8 firefox (appears in english)
LANG=zh_TW.UTF-8 firefox (appears in chinese)
because there is 
/usr/lib64/firefox-3.6/langpacks/langpack-zh-CN.org/ and
/usr/lib64/firefox-3.6/langpacks/langpack-zh-TW.org/

but

LANG=de_AT.UTF-8 firefox (appears in german)
LANG=de_DE.UTF-8 firefox (appears in german)

because there is only 
/usr/lib64/firefox-3.6/langpacks/langpack-de.org/

Should I open a new bug? at least for a lot of spanish latin american users (those not in AR, CL, ES and MX) it's breaking translations.

Comment 27 Martin Stransky 2010-05-10 18:33:22 UTC
(In reply to comment #26)
> Should I open a new bug? at least for a lot of spanish latin american users
> (those not in AR, CL, ES and MX) it's breaking translations.    

Do you run firefox-3.6.3-4.fc13?

Comment 28 Iván Jiménez 2010-05-12 02:23:03 UTC
(In reply to comment #27)
> Do you run firefox-3.6.3-4.fc13?    

Yes (sorry for not mentioning it). I can reproduce it in an updated installation and in a nigthly live image from about 29 abr.

Comment 29 fujiwara 2010-05-14 01:47:54 UTC
I think it's better if zh_HK community could provide /usr/lib64/firefox-3.6/langpacks/langpack-zh-HK.org/chrome/zh-HK.jar

On the other hand, firefox.spec might provide a symlink while I think a short locale zh could be zh-cn but not zh-tw.

ZH_TW_DIR=%_libdir/firefox-3.6/langpacks/langpack-zh-TW.org/chrome
ZH_HK_DIR=`echo "$ZH_TW_DIR" | sed -e 's|zh-TW|zh-HK|g'`

if [ -f $RPM_BUILD_ROOT$ZH_TW_DIR/zh-TW.jar ] && [ ! -f $RPM_BUILD_ROOT$ZH_HK_DIR/zh_HK.jar ] ; then
  if [ ! -d $RPM_BUILD_ROOT$ZH_HK_DIR ] ; then
    mkdir -p $RPM_BUILD_ROOT$ZH_HK_DIR
  fi
  (cd $RPM_BUILD_ROOT$ZH_HK_DIR; ln -s $ZH_TW_DIR/zh-TW.jar zh_HK.jar)
fi


To fix other short locale issues, probably it's better to swap the lines of $SHORTMOZLOCALE and $MOZLOCALE in /usr/bin/firefox and then the language community could provide the short locale jar files for the fallback languages.

--- /usr/bin/firefox.orig	2010-05-14 10:39:18.000000000 +0900
+++ /usr/bin/firefox	2010-05-14 10:43:58.000000000 +0900
@@ -194,16 +194,7 @@
     MOZLOCALE=`echo $CURRENT_LOCALE | sed "s|_\([^.]*\).*|-\1|g"`
 
     # Try to link global langpacks to an extension directory
-    if [ -f $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then
-        if [ -d $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org ]; then
-            rmdir "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org" > /dev/null 2>&1
-        fi 
-        if ! [ -e $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org ]; then
-            ln -s $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org \
-                  $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org
-            echo "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org" > $FEDORA_LANGPACK_CONFIG
-        fi
-    elif [ -f $MOZ_LANGPACKS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then
+    if [ -f $MOZ_LANGPACKS_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org/chrome/$MOZLOCALE.jar ]; then
         if [ -d $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org ]; then
             rmdir "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org" > /dev/null 2>&1
         fi 
@@ -212,6 +203,15 @@
                   $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org
             echo "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${MOZLOCALE}@firefox.mozilla.org" > $FEDORA_LANGPACK_CONFIG
         fi
+    elif [ -f $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org/chrome/$SHORTMOZLOCALE.jar ]; then
+        if [ -d $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org ]; then
+            rmdir "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org" > /dev/null 2>&1
+        fi 
+        if ! [ -e $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org ]; then
+            ln -s $MOZ_LANGPACKS_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org \
+                  $MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org
+            echo "$MOZ_EXTENSIONS_PROFILE_DIR/langpack-${SHORTMOZLOCALE}@firefox.mozilla.org" > $FEDORA_LANGPACK_CONFIG
+        fi
     fi
 
     # And set it up for mozilla

Comment 30 Iván Jiménez 2010-05-29 01:43:47 UTC
Any progress on this? It's not just the interface, but websites (like facebook) appear in English when they sould appear in Spanish, which is confusing for users. In Fedora 12, Firefox uses es_AR locale when system uses es_CO.

Comment 31 Iván Jiménez 2010-06-25 11:48:30 UTC
(In reply to comment #29)
> I think it's better if zh_HK community could provide
> /usr/lib64/firefox-3.6/langpacks/langpack-zh-HK.org/chrome/zh-HK.jar
>
For latin america it wouldn't be easy (too many regional variants).

> On the other hand, firefox.spec might provide a symlink while I think a short
> locale zh could be zh-cn but not zh-tw.
> 
Could it be tried in a package? (for all affected locales). It's not just the interface, but pages appear in english even if there are other language variants, eg in facebook.com. It's making f13 web experience worse than f12; it also doesn't happen in ubuntu.


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