Bug 1132273 - Report general.useragent.locale correctly regardless of whether it's a simple or localized string. r=mfinkle

--HG--
extra : commitid : L4ISIeLBArl
This commit is contained in:
Richard Newman 2015-08-13 14:46:13 -07:00
parent 792263b5e1
commit 6a2c4aba3f

View File

@ -4159,7 +4159,11 @@ XREMain::XRE_mainRun()
#ifdef MOZ_CRASHREPORTER
nsCString userAgentLocale;
if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) {
// Try a localized string first. This pref is always a localized string in
// Fennec, and might be elsewhere, too.
if (NS_SUCCEEDED(Preferences::GetLocalizedCString("general.useragent.locale", &userAgentLocale))) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
} else if (NS_SUCCEEDED(Preferences::GetCString("general.useragent.locale", &userAgentLocale))) {
CrashReporter::AnnotateCrashReport(NS_LITERAL_CSTRING("useragent_locale"), userAgentLocale);
}
#endif