bug 94404 moving sidebar into branding. sr=ben r=pchen

This commit is contained in:
matt%netscape.com 2001-08-10 21:30:12 +00:00
parent b1eb7d424c
commit 720cfc6160
8 changed files with 64 additions and 35 deletions

View File

@ -24,7 +24,12 @@
type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/sidebar/customize.dtd" >
<!DOCTYPE window [
<!ENTITY % customizeDTD SYSTEM "chrome://communicator/locale/sidebar/customize.dtd" >
%customizeDTD;
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
]>
<window
xmlns:html="http://www.w3.org/1999/xhtml"

View File

@ -22,9 +22,9 @@
<!-- extracted from ./customize.xul -->
<!-- LOCALIZATION NOTE sidebar.customize.title.label: Do NOT localize the term "Sidebar" -->
<!ENTITY sidebar.customize.title.label "Customize Sidebar">
<!ENTITY sidebar.customize.title.label "Customize &sidebarName;">
<!-- LOCALIZATION NOTE sidebar.customize.current.label: Do NOT localize the term "Sidebar" -->
<!ENTITY sidebar.customize.current.label "Tabs in Sidebar:">
<!ENTITY sidebar.customize.current.label "Tabs in &sidebarName;:">
<!ENTITY sidebar.customize.reorder.label "Reorder">
<!ENTITY sidebar.customize.customize.label "Customize Tab...">
<!ENTITY sidebar.customize.remove.label "Remove">

View File

@ -1,9 +1,8 @@
addPanelConfirmTitle=Add Tab to Sidebar
addPanelConfirmMessage=Add the tab '%title%' to the Sidebar?##Source: %url%
addPanelConfirmMessage=Add the tab '%title%' to the %name%?##Source: %url%
dupePanelAlertTitle=Sidebar
dupePanelAlertMessage=%url% already exists in the Sidebar.
dupePanelAlertMessage=%url% already exists in the %name%.
addEngineConfirmTitle=Add Search Engine
addEngineConfirmMessage=Add the following search engine to the Sidebar Internet Search tab?##Name: %title%#Search Category: %category%#Source: %url%
addEngineConfirmMessage=Add the following search engine to the %name% Internet Search tab?##Name: %title%#Search Category: %category%#Source: %url%

View File

@ -20,23 +20,23 @@
- Blake Ross <BlakeR1234@aol.com>
-->
<!ENTITY sidebar.panels.label "Sidebar">
<!ENTITY sidebar.panels.label "&sidebarName;">
<!ENTITY sidebar.reload.label "Reload">
<!ENTITY sidebar.picker.label "Tabs">
<!ENTITY sidebar.customize.label "Customize Sidebar...">
<!ENTITY sidebar.customize.label "Customize &sidebarName;...">
<!ENTITY sidebar.customize.accesskey "u">
<!ENTITY sidebar.hide.label "Hide Panel">
<!ENTITY sidebar.hide.accesskey "H">
<!ENTITY sidebar.switch.label "Switch to Panel">
<!ENTITY sidebar.switch.accesskey "S">
<!ENTITY sidebarCmd.label "Sidebar">
<!ENTITY sidebarCmd.label "&sidebarName;">
<!ENTITY sidebarCmd.accesskey "b">
<!ENTITY sidebar.loading.label "Loading...">
<!ENTITY sidebar.loading.stop.label "Stop">
<!ENTITY sidebar.no-panels.state "The Sidebar is currently empty.">
<!ENTITY sidebar.no-panels.state "The &sidebarName; is currently empty.">
<!ENTITY sidebar.no-panels.add 'You may add tabs by clicking on the "Tabs" button above.'>
<!ENTITY sidebar.no-panels.hide 'If you would like to completely hide the Sidebar, click on the "View" menu above, and select "Sidebar."'>
<!ENTITY sidebar.no-panels.hide 'If you would like to completely hide the &sidebarName;, click on the "View" menu above, and select "&sidebarName;."'>
<!ENTITY sidebar.sbDirectory.label "Sidebar Directory...">
<!ENTITY sidebar.pagenotfound.label "This tab is not available right now.">

View File

@ -21,7 +21,13 @@
<?xml-stylesheet href="chrome://communicator/content/sidebar/sidebarOverlay.css" type="text/css"?>
<?xul-overlay href="chrome://communicator/content/contentAreaContextOverlay.xul"?>
<!DOCTYPE window SYSTEM "chrome://communicator/locale/sidebar/sidebarOverlay.dtd">
<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % sidebarOverlayDTD SYSTEM "chrome://communicator/locale/sidebar/sidebarOverlay.dtd" >
%sidebarOverlayDTD;
]>
<overlay id="sidebarOverlay"
xmlns:html="http://www.w3.org/1999/xhtml"

View File

@ -129,16 +129,19 @@ function (aTitle, aContentURL, aCustomizeURL)
{
var titleMessage, dialogMessage;
try {
var stringBundle = getStringBundle("chrome://communicator/locale/sidebar/sidebar.properties");
if (stringBundle) {
var stringBundle = srGetStrBundle("chrome://communicator/locale/sidebar/sidebar.properties");
var brandStringBundle = srGetStrBundle("chrome://global/locale/brand.properties");
if (stringBundle) {
sidebarName = brandStringBundle.GetStringFromName("sidebarName");
titleMessage = stringBundle.GetStringFromName("dupePanelAlertTitle");
dialogMessage = stringBundle.GetStringFromName("dupePanelAlertMessage");
dialogMessage = dialogMessage.replace(/%url%/, aContentURL);
dialogMessage = dialogMessage.replace(/%name%/, sidebarName);
}
}
catch (e) {
titleMessage = "Sidebar";
dialogMessage = aContentURL + " already exists in Sidebar.";
dialogMessage = aContentURL + " already exists in Sidebar. No string bundle";
}
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
@ -152,18 +155,21 @@ function (aTitle, aContentURL, aCustomizeURL)
var titleMessage, dialogMessage;
try {
var stringBundle = getStringBundle("chrome://communicator/locale/sidebar/sidebar.properties");
if (stringBundle) {
var stringBundle = srGetStrBundle("chrome://communicator/locale/sidebar/sidebar.properties");
var brandStringBundle = srGetStrBundle("chrome://global/locale/brand.properties");
if (stringBundle) {
sidebarName = brandStringBundle.GetStringFromName("sidebarName");
titleMessage = stringBundle.GetStringFromName("addPanelConfirmTitle");
dialogMessage = stringBundle.GetStringFromName("addPanelConfirmMessage");
dialogMessage = dialogMessage.replace(/%title%/, aTitle);
dialogMessage = dialogMessage.replace(/%url%/, aContentURL);
dialogMessage = dialogMessage.replace(/#/g, "\n");
dialogMessage = dialogMessage.replace(/%name%/, sidebarName);
}
}
catch (e) {
titleMessage = "Add Tab to Sidebar";
dialogMessage = "Add the Tab '" + aTitle + "' to Sidebar?\n\n" + "Source: " + aContentURL;
dialogMessage = "No string bundle. Add the Tab '" + aTitle + "' to Sidebar?\n\n" + "Source: " + aContentURL;
}
var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"].getService();
@ -257,14 +263,17 @@ function (engineURL, iconURL, suggestedTitle, suggestedCategory)
var titleMessage, dialogMessage;
try {
var stringBundle = getStringBundle("chrome://communicator/locale/sidebar/sidebar.properties");
var stringBundle = srGetStrBundle("chrome://communicator/locale/sidebar/sidebar.properties");
var brandStringBundle = srGetStrBundle("chrome://global/locale/brand.properties");
if (stringBundle) {
titleMessage = stringBundle.GetStringFromName("addEngineConfirmTitle");
sidebarName = brandStringBundle.GetStringFromName("sidebarName");
titleMessage = stringBundle.GetStringFromName("addEngineConfirmTitle");
dialogMessage = stringBundle.GetStringFromName("addEngineConfirmMessage");
dialogMessage = dialogMessage.replace(/%title%/, suggestedTitle);
dialogMessage = dialogMessage.replace(/%category%/, suggestedCategory);
dialogMessage = dialogMessage.replace(/%url%/, engineURL);
dialogMessage = dialogMessage.replace(/#/g, "\n");
dialogMessage = dialogMessage.replace(/%name%/, sidebarName);
}
}
catch (e) {
@ -392,17 +401,27 @@ function getSidebarDatasourceURI(panels_file_id)
}
}
function getStringBundle(aURL)
var strBundleService = null;
function srGetStrBundle(path)
{
var stringBundleService = Components.classes["@mozilla.org/intl/stringbundle;1"].getService();
stringBundleService = stringBundleService.QueryInterface(Components.interfaces.nsIStringBundleService);
var appLocale;
var localeService = Components.classes["@mozilla.org/intl/nslocaleservice;1"].getService();
if (localeService)
localeService = localeService.QueryInterface(Components.interfaces.nsILocaleService);
if (localeService)
appLocale = localeService.GetApplicationLocale();
var stringBundle = stringBundleService.CreateBundle(aURL, appLocale);
if (stringBundle)
return stringBundle.QueryInterface(Components.interfaces.nsIStringBundle);
var strBundle = null;
if (!strBundleService) {
try {
strBundleService =
Components.classes["@mozilla.org/intl/stringbundle;1"].getService();
strBundleService =
strBundleService.QueryInterface(Components.interfaces.nsIStringBundleService);
} catch (ex) {
dump("\n--** strBundleService failed: " + ex + "\n");
return null;
}
}
strBundle = strBundleService.createBundle(path);
if (!strBundle) {
dump("\n--** strBundle createInstance failed **--\n");
}
return strBundle;
}

View File

@ -1,4 +1,4 @@
<!ENTITY brandShortName "Mozilla">
<!ENTITY vendorShortName "Mozilla">
<!ENTITY sidebarName "Sidebar">

View File

@ -1,3 +1,3 @@
brandShortName=Mozilla
vendorShortName=Mozilla
sidebarName=Sidebar