Support langpacks in the crash reporter
Categories
(Toolkit :: Crash Reporting, enhancement, P3)
Tracking
()
People
(Reporter: afranchuk, Assigned: afranchuk)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-esr128+
|
Details | Review |
The crash reporter supports using localization data from the omnijar, but it should also support reading the user pref for localization and, if necessary, getting the localization data from the associated langpack.
The pref is intl.locale.requested. When set, that is a comma-delimited list of locale identifiers.
Under the root directory of the user profile (not sure if this will be tricky to get), the langpack zip file should be at extensions/langpack-LOCALE@firefox.mozilla.org.xpi where LOCALE is replaced by the locale code.
Normally we check that extensions are signed, but that may not be feasible for the crash reporter. That's probably okay since we are only using the extension to pull out the localization data?
| Assignee | ||
Comment 2•1 year ago
•
|
||
After a lot of discussion, we've come to the following conclusions:
- Figuring out the crashing profile (if any) should likely be done by recording it in a crash annotation. We already use it to set the events directory. Setting it as a crash annotation will allow us to potentially use it for other things, like bug 1774345 or proxy settings for bug 1866863.
- Figuring out the selected locale is more complicated than simply looking at
intl.locale.requested. See https://firefox-source-docs.mozilla.org/intl/locale.html#requested-locales. We already record the UserAgent locale as a crash annotation, so that may also be acceptable. It might be more accurate to record and use the list of UI locales though. - Finding the langpack extension (if any) relating to the current locale is not as easy as looking in the profile. It may be elsewhere. It would be easier if we record this as a crash annotation as well (when applicable).
So much of this boils down to recording the state when we have knowledge about it, so if a crash occurs it is easy to get the correct information. If a crash occurs before a profile is loaded, we can only fall back to using the installation locale.
| Assignee | ||
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
This passes the profile directory as a crash annotation (which is not
sent in the crash report). The profile directory is already indirectly
passed to the crash reporter through
MOZ_CRASHREPORTER_EVENTS_DIRECTORY, however I don't think that's
something to rely upon.
The pref parsing and langpack extension search are done on a best-effort
basis; there may be some odd configurations for which it does not
account. However, it should cover the vast majority of cases. While we
don't want to underserve niche populations that may have an odd
configuration, we do always have fallback behaviors that are likely
still reasonable for most (like using the installation locale).
Comment 5•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Comment 6•1 year ago
|
||
I've replicated this issue using Nightly 133.0a1 on macOS 13 with the following steps:
- Install the en-US Firefox build
- Add the corresponding language pack (in this case it.xpi)
- Change the language from English to Italian in the Preferences page
- Simulate a crash using about:crashparent
- Check the Firefox Crash Reporter
The issue is verified as fixed in the latest Nightly 134.0a1 and Firefox 133.0b8 on Windows 11 x64, macOS 13, and Ubuntu 22.04, where the Firefox Crash Reporter correctly appears in Italian. Please let me know if any additional testing is needed.
| Assignee | ||
Comment 7•1 year ago
|
||
That test sounds sufficient. Can we have this as a recurring QA test (if not already)?
Comment 8•1 year ago
|
||
(In reply to Alex Franchuk [:afranchuk] from comment #7)
That test sounds sufficient. Can we have this as a recurring QA test (if not already)?
The test case has been created and added to the suite of recurrent QA tests to be executed on a regular basis.
| Assignee | ||
Comment 9•1 year ago
|
||
This passes the profile directory as a crash annotation (which is not
sent in the crash report). The profile directory is already indirectly
passed to the crash reporter through
MOZ_CRASHREPORTER_EVENTS_DIRECTORY, however I don't think that's
something to rely upon.
The pref parsing and langpack extension search are done on a best-effort
basis; there may be some odd configurations for which it does not
account. However, it should cover the vast majority of cases. While we
don't want to underserve niche populations that may have an odd
configuration, we do always have fallback behaviors that are likely
still reasonable for most (like using the installation locale). We also
first try the useragent_locale annotation before getting locales from
the prefs.
This only looks in the profile and the installation for langpack
extensions. There are a few other system-wide locations that Firefox
looks in. However, the assumptions are:
- overwhelmingly users install langpacks using the UI rather than
manually downloading the file, and - if installed with a package manager (mostly applicable to linux),
langpacks are put in the installation. This is the case for the few
major linux distros I checked.
If we think this is not enough, I can also add the system-wide
directories.
Original Revision: https://phabricator.services.mozilla.com/D222356
Updated•1 year ago
|
Updated•1 year ago
|
Comment 10•1 year ago
|
||
| uplift | ||
Updated•1 year ago
|
Comment 11•1 year ago
|
||
The issue has been verified as fixed in Firefox 128.7.0esr on Windows 11 x64, macOS 13, and Ubuntu 22.04 (non-Snap version), where the Firefox Crash Reporter correctly appears in Italian after changing the language in about:preferences.
In Firefox Snap on Ubuntu 22.04, the localization is applied after a browser restart (see Bug 1940769). Additionally, I noticed a new issue where the Crash Reporter does not update its language properly after a second language change: after switching from English to Italian, the Crash Reporter is correctly localized, but switching again (e.g. from English to French) does not update the localization until another browser restart. I have submitted a separate bug for this: Bug 1944530 .
Description
•