Bug 445304

Summary: HTML/index.html always redirects to en-US/index.html
Product: Red Hat Enterprise Linux 5 Reporter: Jens Petersen <petersen>
Component: firefoxAssignee: Martin Stransky <stransky>
Status: CLOSED CURRENTRELEASE QA Contact: desktop-bugs <desktop-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 5.2CC: bugzilla, caillon, eng-i18n-bugs, lihuang, llim, mhideo, pnemade, stransky, syeghiay
Target Milestone: rcKeywords: i18n, Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-02-11 06:09:13 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 445616    
Bug Blocks: 455727    
Attachments:
Description Flags
proposed patch none

Description Jens Petersen 2008-05-05 22:24:23 EDT
Description of problem:
With RHEL5 rc1 the initial page of firefox is always going to
/usr/share/doc/HTML/en-US/index.html not the page of the locale
the desktop is running in.

I am not sure if this is a regression but it would certainly
be good for customers to fix this problem for 5.2 or at least 5.3.

How reproducible:
every time

Steps to Reproduce:
1. install RHEL 5.2 in supported language other than English
2. login to desktop and start firefox (or just run "LANG=ja_JP.UTF-8 firefox")
  
Actual results:
2. startup page is in English

Expected results:
3. startup page in native supported language

Additional info:
/usr/share/doc/HTML/index.html redirects to /usr/share/doc/HTML/en-US/index.html
irrespective of the locale.
Comment 1 Jens Petersen 2008-05-05 22:37:05 EDT
This is a regression relative to 5.0 at least.
Comment 2 Don Domingo 2008-05-05 22:45:19 EDT
adding mhideo@redhat.com and jfearn@redhat.com to this bug, as i am not sure how
to address this (packaging issue?)
Comment 3 Jens Petersen 2008-05-05 23:40:09 EDT
This is also a regression against 5.1.

Jeff and I looked at this with firebug and window.navigator.language
returns "en-US" always, it seems?
Comment 4 Jens Petersen 2008-05-05 23:41:41 EDT
I meant to add:

So has the handling of window.navigator.language
in Firefox 3 changed or moved to another javascript variable?
Comment 5 Martin Stransky 2008-05-06 05:40:09 EDT
window.navigator.language is derived from user agent string and this string is
set during build. The proper variable is "intl.accept_languages" (it's a list of
preferred languages, the first one should be the current locale)
Comment 6 Jens Petersen 2008-05-06 06:05:35 EDT
Thanks, moving back to redhat-release-notes then.
Comment 7 Jens Petersen 2008-05-06 08:30:26 EDT
(In reply to comment #5)
> window.navigator.language is derived from user agent string and this string is
> set during build.

Nevertheless this is a change of behaviour from Firefox 1.5 and 2.0.
Comment 8 Jens Petersen 2008-05-06 08:47:05 EDT
Anyway going by comment 5, I guess something like:

 var lang = intl.accept_languages.split(',')[0];

should do the right thing.
Comment 9 Jens Petersen 2008-05-06 21:35:12 EDT
(In reply to comment #5)
> window.navigator.language is derived from user agent string and this string is
> set during build.

There is an upstream bug open for this: since we only ship one firefox build for
all langs this seems unacceptable, and it used to be different for firefox2.

> The proper variable is "intl.accept_languages" (it's a list of
> preferred languages, the first one should be the current locale)

I don't know how to access that from client side javascript.
Comment 10 Jeff Fearn 2008-05-06 21:58:04 EDT
Changing the behavior of window.navigator.language is going to break every
existing locale checking script in use today; they all use
window.navigator.language to determine the current language.

This will make Firefox work differently than Konqueror and thus require browser
checking logic to be added. The latest Konqueror works as expected.

I have found no way to access intl.* variables from within client side javascript.
Comment 12 RHEL Product and Program Management 2008-05-07 20:45:18 EDT
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being proposed as a blocker for this release.  

Please resolve ASAP.
Comment 14 Martin Stransky 2008-07-14 16:39:48 EDT
Created attachment 311775 [details]
proposed patch

This patch to firefox-redhat-default-prefs.js seems to fix the problem (based
on https://bugzilla.mozilla.org/show_bug.cgi?id=285267#c7)
Comment 15 Martin Stransky 2008-07-16 07:38:04 EDT
Actually we used to manage it by this code for 1.5. But it has been removed
during rebase to 3.0.

%{__cat} > $RPM_BUILD_ROOT/%{mozappdir}/defaults/preferences/firefox-l10n.js << EOF
pref("general.useragent.locale", "chrome://global/locale/intl.properties");
EOF
%{__chmod} 644 $RPM_BUILD_ROOT/%{mozappdir}/defaults/preferences/firefox-l10n.js
Comment 17 Martin Stransky 2008-07-28 01:45:39 EDT
*** Bug 456815 has been marked as a duplicate of this bug. ***
Comment 19 lihuang 2009-01-12 02:22:51 EST
ON rhel5.3 20090106.0
can reproduce this problem under following locales :as_IN,bn_IN,kn_IN,ml_IN,mr_IN,or_IN,ta_IN,te_IN.
(window.navigator.language=en-US)

under other locales :pt_BR,de_DE,es_ES,fr_FR,ru_RU,ko_KR,
ja_JP,zh_CN,zh_TW,gu_IN,hi_IN,pa_IN,si_LK
HTML/index.html redirect to the right index page
Comment 20 Lawrence Lim 2009-01-12 03:07:24 EST
Moving to ASSIGNED based on Comment #19.
Comment 21 RHEL Product and Program Management 2009-01-27 15:41:47 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 22 Martin Stransky 2009-02-11 06:09:13 EST
(In reply to comment #19)
> ON rhel5.3 20090106.0
> can reproduce this problem under following locales
> :as_IN,bn_IN,kn_IN,ml_IN,mr_IN,or_IN,ta_IN,te_IN.
> (window.navigator.language=en-US)
> 
> under other locales :pt_BR,de_DE,es_ES,fr_FR,ru_RU,ko_KR,
> ja_JP,zh_CN,zh_TW,gu_IN,hi_IN,pa_IN,si_LK
> HTML/index.html redirect to the right index page

Please open a new bug report about missing start page translations. This one is about broken firefox (which is fixed already) but you need to report missing HTML pages from redhat-release-notes package.