Bug 1911321 - Add new set_fallback method to intl.ui.browserLanguage telemetry action. r=settings-reviewers,mossop
Differential Revision: https://phabricator.services.mozilla.com/D218414
This commit is contained in:
@@ -1877,6 +1877,18 @@ var gMainPane = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Track how often locale fallback order is changed.
|
||||||
|
// Drop the first locale and filter to only include the overlapping set
|
||||||
|
const prevLocales = Services.locale.requestedLocales.filter(
|
||||||
|
lc => selected.indexOf(lc) > 0
|
||||||
|
);
|
||||||
|
const newLocales = selected.filter(
|
||||||
|
(lc, i) => i > 0 && prevLocales.includes(lc)
|
||||||
|
);
|
||||||
|
if (prevLocales.some((lc, i) => newLocales[i] != lc)) {
|
||||||
|
this.gBrowserLanguagesDialog.recordTelemetry("set_fallback");
|
||||||
|
}
|
||||||
|
|
||||||
switch (gMainPane.getLanguageSwitchTransitionType(selected)) {
|
switch (gMainPane.getLanguageSwitchTransitionType(selected)) {
|
||||||
case "requires-restart":
|
case "requires-restart":
|
||||||
gMainPane.showConfirmLanguageChangeMessageBar(selected);
|
gMainPane.showConfirmLanguageChangeMessageBar(selected);
|
||||||
|
|||||||
@@ -441,6 +441,24 @@ add_task(async function testReorderingBrowserLanguages() {
|
|||||||
"The second dialog id is larger than the first"
|
"The second dialog id is larger than the first"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// Open the dialog yet again.
|
||||||
|
newDialog = await openDialog(doc);
|
||||||
|
dialog = newDialog.dialog;
|
||||||
|
dialogDoc = newDialog.dialogDoc;
|
||||||
|
let thirdDialogId = getDialogId(dialogDoc);
|
||||||
|
selected = newDialog.selected;
|
||||||
|
|
||||||
|
// Move pl to the top.
|
||||||
|
selectAddedLocale("pl", selected);
|
||||||
|
assertLocaleOrder(selected, "en-US,he,pl", "pl");
|
||||||
|
dialogDoc.getElementById("up").doCommand();
|
||||||
|
dialogDoc.getElementById("up").doCommand();
|
||||||
|
assertLocaleOrder(selected, "pl,en-US,he", "pl");
|
||||||
|
|
||||||
|
dialogClosed = BrowserTestUtils.waitForEvent(dialog, "dialogclosing");
|
||||||
|
dialog.acceptDialog();
|
||||||
|
await dialogClosed;
|
||||||
|
|
||||||
await Promise.all(addons.map(addon => addon.uninstall()));
|
await Promise.all(addons.map(addon => addon.uninstall()));
|
||||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||||
|
|
||||||
@@ -448,9 +466,14 @@ add_task(async function testReorderingBrowserLanguages() {
|
|||||||
["manage", "main", firstDialogId],
|
["manage", "main", firstDialogId],
|
||||||
["reorder", "dialog", firstDialogId],
|
["reorder", "dialog", firstDialogId],
|
||||||
["accept", "dialog", firstDialogId],
|
["accept", "dialog", firstDialogId],
|
||||||
|
["set_fallback", "dialog", firstDialogId],
|
||||||
["manage", "main", secondDialogId],
|
["manage", "main", secondDialogId],
|
||||||
["reorder", "dialog", secondDialogId],
|
["reorder", "dialog", secondDialogId],
|
||||||
["accept", "dialog", secondDialogId],
|
["accept", "dialog", secondDialogId],
|
||||||
|
["manage", "main", thirdDialogId],
|
||||||
|
["reorder", "dialog", thirdDialogId],
|
||||||
|
["reorder", "dialog", thirdDialogId],
|
||||||
|
["accept", "dialog", thirdDialogId],
|
||||||
]);
|
]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -2601,6 +2601,7 @@ intl.ui.browserLanguage:
|
|||||||
- apply
|
- apply
|
||||||
- accept
|
- accept
|
||||||
- cancel
|
- cancel
|
||||||
|
- set_fallback
|
||||||
extra_keys:
|
extra_keys:
|
||||||
installId: The id for an install.
|
installId: The id for an install.
|
||||||
products:
|
products:
|
||||||
@@ -2609,6 +2610,7 @@ intl.ui.browserLanguage:
|
|||||||
notification_emails:
|
notification_emails:
|
||||||
- flod@mozilla.com
|
- flod@mozilla.com
|
||||||
- mstriemer@mozilla.com
|
- mstriemer@mozilla.com
|
||||||
|
- earo@mozilla.com
|
||||||
release_channel_collection: opt-out
|
release_channel_collection: opt-out
|
||||||
record_in_processes: ["main"]
|
record_in_processes: ["main"]
|
||||||
bug_numbers:
|
bug_numbers:
|
||||||
@@ -2619,6 +2621,7 @@ intl.ui.browserLanguage:
|
|||||||
- 1739288
|
- 1739288
|
||||||
- 1796396
|
- 1796396
|
||||||
- 1861299
|
- 1861299
|
||||||
|
- 1911321
|
||||||
|
|
||||||
network.dns:
|
network.dns:
|
||||||
trrConfirmation:
|
trrConfirmation:
|
||||||
|
|||||||
Reference in New Issue
Block a user