Offline home page always English (browser language hard-coded to en-US)

Bug #353924 reported by Timo Jyrinki
40
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ubufox Extension
Won't Fix
High
Chris Coulson
ubufox (Ubuntu)
Invalid
High
Unassigned
Nominated for Karmic by Sergey "Shnatsel" Davidoff
Nominated for Lucid by Sergey "Shnatsel" Davidoff
Jaunty
Fix Released
High
Alexander Sack

Bug Description

Binary package hint: ubufox

The problem seems to be that general.useragent.locale is always en-US, and only general.useragent.locale is queried in the startpage.html code. Probably some sort of thing returned by JavaScript should be used instead, since I don't have anything in about:config that would tell my Ubuntu's and browser's language correctly.

However, I don't know how would I be able to get the correct language even in JavaScript, since navigator.language, window.navigator.language seem to also be hard-coded to en-US, together with the part of navigator.userAgent. _Only_ the Accept-Language HTTP header shows the correct language.

Attaching a test HTML page. With Ubuntu 8.10, I get correct fi-FI locale in all three boxes. In Ubuntu 9.04, I get en-US in all of those.

This bug probably should be limited to ubufox / start page problem even though it now has lots of information. Therefore I re-opened bug #117915 for the navigator language problem in general. It was now again closed, but there is a relevant upstream bug linked to it.

(
   Original description was...

   Commit http://bazaar.launchpad.net/~asac/ubufox/main/revision/141.1.1 resetted all URLs for the offline home page to the English version, resulting in that the (existing) localized versions aren't shown. The URLs are browser.throbber.url and app.update.url.details in ubufox.properties.

   ...and it was false in that the URLs in ubufox.properties are not needed anymore because of the code in startpage.html, which works in Ubuntu 8.10

  Then the description was...

   Probably commit http://bazaar.launchpad.net/~asac/ubufox/main/revision/149 broke the showing of localized home page in offline mode. The code is still there but in jaunty it doesn't seem to work anymore. For example, file:///usr/share/ubuntu-artwork/home/locales/index-fi_FI.html would still be there to use in Ubuntu 9.04, and it is also updated for 9.04. However, it is now never shown to the users.

   ...but it is also false, or at least the code would work with the patch in this bug, but probably otherwise too. So we just don't get anything else than en-US from anywhere.
)

Changed in ubufox (Ubuntu):
status: New → Confirmed
description: updated
description: updated
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :
description: updated
summary: - Offline home page URLs resetted to English version for all languages
+ Offline home page always English (browser language hard-coded to en-US)
description: updated
Revision history for this message
Alexander Sack (asac) wrote :

Thanks for the evaluation. Can you try this patch or do you need a package?

Changed in ubufox (Ubuntu):
assignee: nobody → asac
importance: Undecided → High
milestone: none → ubuntu-9.04
status: Confirmed → In Progress
Revision history for this message
Alexander Sack (asac) wrote :

sorry, this is the right one.

Changed in ubufox:
importance: Undecided → High
status: New → In Progress
assignee: nobody → asac
Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Tested that the fix is not working, mostly because the browser always returns en-US.

22:19 < asac> so we need to fix the other bug which was made wontfix upstream
              because we shouldnt use the other mechanism
---
(what changed since intrepid)
22:26 < asac> Mirv: we dropped localized pref for user locale
---
22:28 < asac> usually i dont like reopening old bugs
22:28 < asac> if its a regression its a different bug
22
:28 < asac> this is different because its an upstream bug
---

description: updated
Revision history for this message
Alexander Sack (asac) wrote :

bzr commit -m "* revert changes from revno 149 to ubuntu-mods.js preferences that broke
  localization of websites (LP: #353924)
  - update defaults/preferences/ubuntu-mods.js" --fixes lp:353924 defaults/
Committing to: bzr+ssh://<email address hidden>/~asac/ubufox/main/
modified defaults/preferences/ubuntu-mods.js
Committed revision 159.

Changed in ubufox:
status: In Progress → Fix Committed
Revision history for this message
Alexander Sack (asac) wrote :

10:26 < asac> Mirv: can you bzr branch lp:ubufox; cd ubufox; sh build.sh; firefox ubufox.xpi

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

Fixes it for me, tested with the f.html I attached earlier to this bug report. All fields now report the actual locale instead of en-US.

Also tested that the offline home page code now works and shows the correct, localized page.

Revision history for this message
Alexander Sack (asac) wrote :

thanks timo. remember to uninstall ubufox in tools->addons again - otherwise you get stuck with the .xpi you installed now forever :).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubufox - 0.7-0ubuntu1

---------------
ubufox (0.7-0ubuntu1) jaunty; urgency=low

  * ubufox 0.7 final release
    + fix plugin finder urls to properly point to 9.04 distributionID
      - update ./defaults/preferences/ubufox-pfs.js
    + using the localstore.rdf in the users profile as a source for the startup
      time turned out to be too unreliable; we drop that approach and use nsCategoryManager singleton to
      store a timestamp pretty close to the actual startup time; this fixes the infamous infinit startup
      notification bug (LP: #270303)
      - update content/updateRestart.js
    + add pfsdb meta file sources.list for 9.04 (jaunty)
      - add pfs/db/sources.list.9.04
    + revert changes from revno 149 to ubuntu-mods.js preferences that broke
      localization of websites (LP: #353924)
      - update defaults/preferences/ubuntu-mods.js
    + properly fallback to not-localized useragent.locale pref
      - update content/startpage.html

 -- Alexander Sack <email address hidden> Tue, 14 Apr 2009 12:00:58 +0200

Changed in ubufox (Ubuntu Jaunty):
status: In Progress → Fix Released
Revision history for this message
Alexander Sack (asac) wrote :

fixed in 0.7

Changed in ubufox:
status: Fix Committed → Fix Released
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

This bug is still present in 0.8, which is Karmic and Lucid. Any workarounds?

Changed in ubufox (Ubuntu):
status: Fix Released → Confirmed
Changed in ubufox:
status: Fix Released → Confirmed
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

I've got a patch for this. It requires startpages to be named with ISO 639-1 codes (Ubuntu currently uses custom naming pattern), but it works.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Here it is. Remember it needs ISO 639-1 compliant naming! That's index-ru.html instead of index-ru_RU.html and similar changes to several others.

tags: added: patch
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

That patch is outdated by now, I'm not sure if this problem is present in Lucid, but I have a better fix for this bug now and I can post it if needed.

Revision history for this message
Timo Jyrinki (timo-jyrinki) wrote :

It is still present in lucid, indeed. Hopefully the (updated) patch can be included.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Here's the updated version. It's suitable only for Lucid.

Revision history for this message
David Stansby (dstansby-deactivatedaccount) wrote :

Set as patch-forwarded-upstream since upstream uses Launchpad to track bugs

tags: added: patch-forwarded-upstream
removed: patch
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

Hmm, sorry, even this patch doesn't make it work normally. No images, for example. The only working version I ever got is http://launchpad.net/ufurmix/karmic/ufurmix-9.10/+download/ufurmix-firefox-tweaks_0.6.4.tar.gz. And all this is still broken in Maverick.

Alexander Sack (asac)
Changed in ubufox:
assignee: Alexander Sack (asac) → Chris Coulson (chrisccoulson)
Changed in ubufox (Ubuntu):
assignee: Alexander Sack (asac) → Chris Coulson (chrisccoulson)
Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

You can find a working version for Lucid, not based on about:home because it doesn't allow any CSS or images (bug #675273) and doesn't provide localizations (bug #675271), at https://launchpad.net/~ufurmix-maintainers/+archive/ppa/+files/ubufox_0.95%7Eufurmix1.tar.gz Actually it's a forward-port of Karmic system (which didn't work also, so it's a fixed forward-port). It's adapted for my Ubuntu remix, but it will be easy to adapt it back for Ubuntu.

Revision history for this message
Sergey "Shnatsel" Davidoff (shnatsel) wrote :

In Maverick it's packaged in a different way, and I haven't studied it yet (but I'll have to do it sooner or later).

Martin Pitt (pitti)
Changed in ubufox (Ubuntu):
assignee: Chris Coulson (chrisccoulson) → nobody
Revision history for this message
Martin Pitt (pitti) wrote :

I don't think this is even relevant any more. As far as I can see, we dropped the offline start page entirely.

Changed in ubufox (Ubuntu):
milestone: ubuntu-9.04 → none
status: Confirmed → Invalid
Revision history for this message
Chris Coulson (chrisccoulson) wrote :

The offline homepage feature has been removed from ubufox now, as loading content from file:/// URI's hasn't worked correctly for a while

Changed in ubufox:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.