Skip to content
Snippets Groups Projects
Verified Commit 3949b7e1 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame :jack_o_lantern:
Browse files

Bug 41417: Always prompt users to restart after changing language

This is a temporary patch that we need until we switch our strings to
Fluent. The reason is that we currently set strings when we populate
our XUL content.
We could rework the whole mechanism, but it is not worth it because we
want to switch to Fluent, which will handle everything automatically.
parent f46918d6
Branches
Tags
1 merge request!652Bug 41794: Rebased stable to 102.12
......@@ -1216,18 +1216,17 @@ var gMainPane = {
gMainPane.recordBrowserLanguagesTelemetry("reorder");
switch (gMainPane.getLanguageSwitchTransitionType(newLocales)) {
// tor-browser#41417: Always prompt for the restart, until we switch to
// Fluent, since the current way we use to update languages does not allow
// live-reload. We could also call showConfirmLanguageChangeMessageBar in
// the official live-reload case, but the result is inconsistent and makes
// handling the locales-match case harder.
case "requires-restart":
case "live-reload":
// Prepare to change the locales, as they were different.
gMainPane.showConfirmLanguageChangeMessageBar(newLocales);
gMainPane.updatePrimaryBrowserLanguageUI(newLocales[0]);
break;
case "live-reload":
Services.locale.requestedLocales = newLocales;
gMainPane.updatePrimaryBrowserLanguageUI(
Services.locale.appLocaleAsBCP47
);
gMainPane.hideConfirmLanguageChangeMessageBar();
break;
case "locales-match":
// They matched, so we can reset the UI.
gMainPane.updatePrimaryBrowserLanguageUI(
......@@ -1480,18 +1479,12 @@ var gMainPane = {
}
switch (gMainPane.getLanguageSwitchTransitionType(selected)) {
// tor-browser#41417: see onPrimaryBrowserLanguageMenuChange
case "requires-restart":
case "live-reload":
gMainPane.showConfirmLanguageChangeMessageBar(selected);
gMainPane.updatePrimaryBrowserLanguageUI(selected[0]);
break;
case "live-reload":
Services.locale.requestedLocales = selected;
gMainPane.updatePrimaryBrowserLanguageUI(
Services.locale.appLocaleAsBCP47
);
gMainPane.hideConfirmLanguageChangeMessageBar();
break;
case "locales-match":
// They matched, so we can reset the UI.
gMainPane.updatePrimaryBrowserLanguageUI(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment