Bladeren bron

use internal constant for the default profile name

Gildas 7 jaren geleden
bovenliggende
commit
c5ee526216
3 gewijzigde bestanden met toevoegingen van 4 en 3 verwijderingen
  1. 1 1
      extension/core/bg/config.js
  2. 1 1
      extension/ui/bg/ui-menu.js
  3. 2 1
      extension/ui/bg/ui-options.js

+ 1 - 1
extension/core/bg/config.js

@@ -22,7 +22,7 @@
 
 singlefile.config = (() => {
 
-	const DEFAULT_PROFILE_NAME = browser.i18n.getMessage("profileDefaultSettingsLabel");
+	const DEFAULT_PROFILE_NAME = "__Default_Settings__";
 
 	const DEFAULT_CONFIG = {
 		removeHiddenElements: true,

+ 1 - 1
extension/ui/bg/ui-menu.js

@@ -115,7 +115,7 @@ singlefile.ui.menu = (() => {
 						id: MENU_ID_SELECT_PROFILE_PREFIX + profileIndex,
 						type: "radio",
 						contexts: defaultContexts,
-						title: profileName,
+						title: profileName == singlefile.config.DEFAULT_PROFILE_NAME ? browser.i18n.getMessage("profileDefaultSettingsLabel") : profileName,
 						checked: tabsData.profileName ? tabsData.profileName == profileName : profileName == singlefile.config.DEFAULT_PROFILE_NAME,
 						parentId: MENU_ID_SELECT_PROFILE
 					});

+ 2 - 1
extension/ui/bg/ui-options.js

@@ -245,7 +245,8 @@
 		profileNamesInput.options.length = 0;
 		profileNames.forEach(profileName => {
 			const optionElement = document.createElement("option");
-			optionElement.value = optionElement.textContent = profileName;
+			optionElement.value = profileName;
+			optionElement.textContent = profileName == singlefile.config.DEFAULT_PROFILE_NAME ? browser.i18n.getMessage("profileDefaultSettingsLabel") : profileName;
 			profileNamesInput.appendChild(optionElement);
 		});
 		profileNamesInput.value = selectedProfileName;