Localise profile permission errors
As part of #40924 I want to delete torbutton.properties. The only remaining content is
profileProblemTitle=%S Profile Problem
profileReadOnly=You cannot run %S from a read-only file system. Please copy %S to another location before trying to use it.
profileReadOnlyMac=You cannot run %S from a read-only file system. Please copy %S to your Desktop or Applications folder before trying to use it.
profileAccessDenied=%S does not have permission to access the profile. Please adjust your file system permissions and try again.
which is used in toolkit/xre/nsAppRunner.cpp. This was added in #14631 (closed) and it looks like the patch hasn't changed much since the original implementation.
However, I'm pretty sure it fails to localise since:
- It tries to read a single app locale from
intl.locale.requested. This string is meant to be a comma-separated list of locales. And I think it is actually empty when read. Is this before the user preferences are read? - As a result,
torbutton.propertiesis never loaded (even foren-US). Instead it usestoolkit/locales/en-US/chrome/mozapps/profile/profileSelection.propertiesfor the string bundle, which contains duplicates of the content oftorbutton.properties. But is not localized. - Even if the above had worked,
profileProblemTitleis read from the wrong bundle.
@morgan and @pierov before I work on replacing this:
- How common is the problem that #14631 (closed) tried to address: installing Tor Browser in a read-only directory.
- If it is hardly ever expected, could we just drop our patch entirely? In this scenario firefox assumes you have a locked profile and shows: "Firefox is already running, but is not responding. To use Firefox, you must first close the existing Firefox process, restart your device, or use a different profile."
- Otherwise, if it is rare, could we use an existing Firefox message for this case, like "Profile Missing Your Tor Browser profile cannot be loaded. It may be missing or inaccessible."? This is what you get shown if the profile parent directory is unreadable.
- Otherwise, if we do want our own message, is the advice still correct. E.g. for macOS "Please copy %S to your Desktop or Applications folder"?
Edited by henry