Closed Bug 1755181 Opened 4 years ago Closed 4 years ago

History/Bookmarks (Places) trees don't switch language with intl.multilingual.liveReload enabled (Library, sidebar, star UI)

Categories

(Core :: Internationalization, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
100 Branch
Tracking Status
firefox100 --- fixed

People

(Reporter: Paenglab, Assigned: gregtatum)

References

Details

Attachments

(5 files)

Set intl.multilingual.liveReload to true and open the History sidebar.
When using the en-US locale the tree shows Today, Yesterday etc.
Now switch to de-DE for example. The tree still shows Today, Yesterday etc. but should show Heute, Gestern etc.

Not sure if this is only an issue because it's not yet moved to Fluent or it comes from the issue noted in Bug 1751784 comment 8:
The thread pane is redrawn, but only partly updates: The content of the (usually unused) status column updates, but the date column does not. We debugged it a bit and saw that mozilla::intl::AppDateTimeFormat::Format() returns the date/time formatted to the original locale even when switching language (and setting the formatting to follow the app locale and not the OS locale). This is visible when changing between English and German, especially when adding a weekday (mail.ui.display.dateformat.thisweek set to 4).

Blocks: 1751784
Blocks: 62174

It looks like it's only translating once.

Scenario 1 (working)

Steps to reproduce:

  • Open Firefox fresh.
  • Switch from "en-US" to "es-ES".
  • Open history panel.

Expected and actual behavior:

  • The panel is correctly translated to "es-ES".

Scenario 2 (broken)

Steps to reproduce:

  • Open Firefox fresh.
  • Open history panel.
  • Switch from "en-US" to "es-ES".

Expected behavior:

  • The panel is correctly translated to "es-ES".
  • The top title say "Historial"

Actual behavior:

  • The top title say "History"

Marking as an enhancement until we enable the feature, then it would be a defect, since no users can see it yet.

Type: defect → enhancement
Priority: -- → P2

TB uses mozilla::intl::AppDateTimeFormat::Format() also used for certificate display in FF:
https://searchfox.org/mozilla-central/rev/41614c2fb53602e9a4c9793afa76f2422c0bf9a2/security/manager/ssl/nsCertTree.cpp#544
When you look at this bug, please check that certificate display follows the locale the user chose.

(In reply to Rachel Martin from comment #3)

TB uses mozilla::intl::AppDateTimeFormat::Format() also used for certificate display in FF:
https://searchfox.org/mozilla-central/rev/41614c2fb53602e9a4c9793afa76f2422c0bf9a2/security/manager/ssl/nsCertTree.cpp#544
When you look at this bug, please check that certificate display follows the locale the user chose.

Let's not lump too much into one bug, it'll only cause things to be missed or confused. The fact that AppDataTimeFormat is still returning the wrong thing after a switch feels like it warrants a bug in itself - it is a specific issue that some of these others may depend on. The certificate display is probably best filed as a separate bug as well - then we have an explicit reminder to check it.

Updating the subject - the history & bookmarks trees are all maintained by the same tree/places code implementation, so fixing one will fix the rest.

Summary: History sidebar tree doesn't switch language with intl.multilingual.liveReload enabled → History/Bookmarks (Places) trees don't switch language with intl.multilingual.liveReload enabled (Library, sidebar, star UI)

(In reply to Mark Banner (:standard8) from comment #4)

Let's not lump too much into one bug, it'll only cause things to be missed or confused. The fact that AppDataTimeFormat is still returning the wrong thing after a switch feels like it warrants a bug in itself - it is a specific issue that some of these others may depend on. The certificate display is probably best filed as a separate bug as well - then we have an explicit reminder to check it.

Filed bug 1755961 for this. If the subject is wrong correct it as I don't know what this function does.

Priority: P2 → P1
Assignee: nobody → gtatum

The startup cache essentially leaks memory here for the old startup cache
data. My assumption here is that there can be dangling pointers into this
data so it's not safe to delete these old tables. Live language switching
is a relatively rare event, so this leak should be acceptable compared to
adding locking mechanisms to the underlying data.

Depends on D140667

Pushed by gtatum@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/df0671c449b9 Keep sidebar title in sync with l10n changes; r=platform-i18n-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/00c77cbfd73a Reload sidebar contents on app locale change; r=platform-i18n-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/b61343e0db5a Invalidate locale cache in AppDateTimeFormat; r=platform-i18n-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/9e4a3a9fe4cd Invalidate string bundle in nsNavHistory.cpp; r=platform-i18n-reviewers,nordzilla https://hg.mozilla.org/integration/autoland/rev/7f04f6c7c9c2 Allow live language reloading to invalidate the startup cache; r=dthayer
Blocks: 1755961
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: