Follow-up to bug 1751493: C++ part and folder pane part of live language switching
Categories
(Thunderbird :: Upstream Synchronization, task)
Tracking
(thunderbird_esr91 unaffected)
| Tracking | Status | |
|---|---|---|
| thunderbird_esr91 | --- | unaffected |
People
(Reporter: rachel, Assigned: rachel)
References
Details
Attachments
(3 files, 4 obsolete files)
|
42.07 KB,
patch
|
benc
:
review+
|
Details | Diff | Splinter Review |
|
539.88 KB,
video/webm
|
Details | |
|
6.44 KB,
patch
|
rachel
:
review+
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #1751493 +++
| Assignee | ||
Comment 1•4 years ago
|
||
This refreshes the thread pane content (status column), not the thread pane column headers. It doesn't work for the folder pane although the correct localised special folder names are correctly updated when the locale changes. When a second 3pane window is launched, most the UI including the thread pane headers are in the correct new language, apart from the localised special folder names :-(
| Assignee | ||
Comment 2•4 years ago
|
||
The patch covers all the C++ issues, however, the folder pane has more problems:
Units are cached in an internal object here:
https://searchfox.org/comm-central/rev/6d4243f466f708d8c119bf869eee09231b7cbcaf/mail/base/content/folderPane.js#3986-3992
And the reason the folder tree doesn't update is likely in the cache which even survives a _rebuild():
https://searchfox.org/comm-central/rev/6d4243f466f708d8c119bf869eee09231b7cbcaf/mail/base/content/folderPane.js#1943-1944
| Assignee | ||
Comment 3•4 years ago
|
||
This takes care of the C++ bits but there is more work required in the folder pane update. Please find a different developer for that. Refer to comment #2 for the issues with the folder pane.
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 4•4 years ago
|
||
Please assign someone else for the second part, the folder pane.
| Assignee | ||
Comment 5•4 years ago
|
||
Comment on attachment 9260501 [details] [diff] [review]
Part 1: 1751784-refresh-static-cpp-strings-on-locale-change.patch
Just for the record, this is based on:
https://hg.mozilla.org/comm-central/rev/8c7735bd0dc3
https://hg.mozilla.org/comm-central/rev/3834c3b93900
Comment 6•4 years ago
|
||
| Assignee | ||
Comment 7•4 years ago
|
||
Thanks for the review. We'll address the comments when we're back at the office in March. Meanwhile it would be good if you could find a developer to cover the folder pane part.
| Assignee | ||
Comment 8•4 years ago
|
||
(We found a development machine earlier than anticipated.)
This adds comments to the IDL files and replaces the instance count with another static variable.
Overall, this is far from finished: When switching language, the folder pane doesn't update. 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). Someone should file a bug in M-C saying that the date format doesn't follow the language (or does it in FF?).
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 9•4 years ago
|
||
Clearing the folder cache over in bug 1755208 hasn't helped. Looks like at least for IMAP folders the localised pretty name is set during folder discovery at startup:
https://searchfox.org/comm-central/rev/7a0e536f6bbef48d2bd17a410017f2d5ac5e4b0a/mailnews/imap/src/nsImapIncomingServer.cpp#1127
called from here:
https://searchfox.org/comm-central/rev/7a0e536f6bbef48d2bd17a410017f2d5ac5e4b0a/mailnews/imap/src/nsImapProtocol.cpp#5224
nsMsgDBFolder::SetPrettyName() is the function that does the localising:
https://searchfox.org/comm-central/rev/7a0e536f6bbef48d2bd17a410017f2d5ac5e4b0a/mailnews/base/src/nsMsgDBFolder.cpp#3149
and then stores the name against the folder:
https://searchfox.org/comm-central/rev/7a0e536f6bbef48d2bd17a410017f2d5ac5e4b0a/mailnews/base/src/nsMsgDBFolder.cpp#3200
So to re-localise, one would have to call all SetPrettyName() again. We haven't looked at how local folders get localised at startup.
| Assignee | ||
Comment 10•4 years ago
|
||
Just removed incorrect comment referring to folder cache. Changes wrt. to original already-r+ patch are:
Comments in IDL files and replacement of instance count with another static variable.
We'll submit part 2 soon with update to folder pane; overall idea:
SetPrettyName() to store original folder name; when locale changes, iterate over all folders in the map in the "folder lookup service", then SetPrettyNameFromOriginal() on all folders in the map.
Comment 11•4 years ago
|
||
Rachel, here's the screen recording of daily on Linux with your patch applied.
With the live reload prefs set to TRUE, most of the strings change when I switch language.
As you can see, if I open and close a parent root folder, the names of the folders are updated with a slight delay.
I'll try to investigate and see why this happens and what's preventing the FtvItem.getText() from using the refreshed message bundle.
I hope this helps.
| Assignee | ||
Comment 12•4 years ago
|
||
This is the cheapest way to refresh the folder pane. Of course it's quite a bit of hackery, why should the FLS have a function to whack all the folders to they change names. We've considered to return an array of all the folders in the map and process them in the mail glue, but that's less efficient. Open to better ideas.
@Alessandro: Thanks for the video. We don't see this sort of refresh. Most likely in your case a new IMAP discovery is run explaining the slight delay and name update, see comment #9 for details.
Comment 13•4 years ago
|
||
Comment 14•4 years ago
|
||
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Comment 15•4 years ago
|
||
Updated HG header.
Updated•4 years ago
|
Comment 16•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/02c86bd08e63
Re-initialize static C++ variables in nsMsgDBFolder.cpp and nsMsgDBView.cpp when locale changes. r=benc
| Assignee | ||
Comment 17•4 years ago
|
||
Please commit part 2 as well.
Comment 18•4 years ago
|
||
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/76b9b11571b1
Re-localise all folder names when locale changes. r=benc
Description
•