2006-04-08 00:57:21 +00:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
<!--
|
|
|
|
The contents of this file are subject to the Netscape Public
|
|
|
|
License Version 1.1 (the "License"); you may not use this file
|
|
|
|
except in compliance with the License. You may obtain a copy of
|
|
|
|
the License at http://www.mozilla.org/NPL/
|
|
|
|
|
|
|
|
Software distributed under the License is distributed on an "AS
|
|
|
|
IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
implied. See the License for the specific language governing
|
|
|
|
rights and limitations under the License.
|
2006-04-08 00:57:20 +00:00
|
|
|
|
2006-04-08 00:57:21 +00:00
|
|
|
Contributor(s): J. M. Betak <loadrunner@betak.net>
|
|
|
|
Josh Soref <timeless@mac.com>
|
|
|
|
-->
|
2006-04-08 00:57:20 +00:00
|
|
|
|
2006-04-08 00:57:21 +00:00
|
|
|
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
|
|
|
|
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
|
2006-04-08 00:57:34 +00:00
|
|
|
|
2006-04-08 00:57:21 +00:00
|
|
|
<!DOCTYPE window [
|
|
|
|
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
|
|
|
|
%brandDTD;
|
2006-04-08 00:57:34 +00:00
|
|
|
<!ENTITY % regionDTD SYSTEM "chrome://global-region/locale/region.dtd" >
|
|
|
|
%regionDTD;
|
2006-04-08 00:57:21 +00:00
|
|
|
<!ENTITY % prefContentDTD SYSTEM "chrome://content-packs/locale/pref-contentpacks.dtd" >
|
|
|
|
%prefContentDTD;
|
|
|
|
]>
|
|
|
|
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
2006-04-08 00:57:34 +00:00
|
|
|
onload="parent.initPanel('chrome://content-packs/content/pref-contentpacks.xul'); "
|
2006-04-08 00:57:29 +00:00
|
|
|
headertitle="&lHeader;">
|
2006-04-08 00:57:21 +00:00
|
|
|
|
|
|
|
<script type="application/x-javascript">
|
|
|
|
<![CDATA[
|
2006-04-08 00:57:37 +00:00
|
|
|
var _elementIDs = ["contentPackList", "languagePackList"];
|
2006-04-08 00:57:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
function Startup()
|
|
|
|
{
|
2006-04-08 00:57:37 +00:00
|
|
|
var contentList = document.getElementById( "contentPackList" );
|
|
|
|
var regionName = contentList.getAttribute("prefvalue");
|
|
|
|
var regionElements = contentList.getElementsByAttribute("value", regionName);
|
2006-04-08 00:57:21 +00:00
|
|
|
|
2006-04-08 00:57:34 +00:00
|
|
|
if (regionElements.length) {
|
2006-04-08 00:57:37 +00:00
|
|
|
contentList.selectItem(regionElements[0]);
|
2006-04-08 00:57:21 +00:00
|
|
|
} else {
|
2006-04-08 00:57:37 +00:00
|
|
|
contentList.selectedIndex = 0;
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
|
2006-04-08 00:57:37 +00:00
|
|
|
var languageList = document.getElementById( "languagePackList" );
|
|
|
|
var languageName = languageList.getAttribute("prefvalue");
|
|
|
|
var languageElements =languageList.getElementsByAttribute("value", languageName);
|
2006-04-08 00:57:34 +00:00
|
|
|
|
|
|
|
if (languageElements.length) {
|
2006-04-08 00:57:37 +00:00
|
|
|
languageList.selectItem(languageElements[0]);
|
2006-04-08 00:57:34 +00:00
|
|
|
} else {
|
2006-04-08 00:57:37 +00:00
|
|
|
languageList.selectedIndex = 0;
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
parent.hPrefWindow.registerOKCallbackFunc( SwitchPacks );
|
|
|
|
}
|
2006-04-08 00:57:21 +00:00
|
|
|
|
2006-04-08 00:57:34 +00:00
|
|
|
|
2006-04-08 00:57:36 +00:00
|
|
|
|
|
|
|
|
|
|
|
function SwitchPacks()
|
2006-04-08 00:57:21 +00:00
|
|
|
{
|
2006-04-08 00:57:36 +00:00
|
|
|
//Switch the Content pack if necessary
|
2006-04-08 00:57:25 +00:00
|
|
|
var oldContentPack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.contentlocale");
|
2006-04-08 00:57:21 +00:00
|
|
|
var newContentPack;
|
|
|
|
|
|
|
|
try {
|
2006-04-08 00:57:37 +00:00
|
|
|
var listbox = document.getElementById("contentPackList");
|
|
|
|
if (listbox) {
|
|
|
|
var selectedItem = listbox.selectedItems.length ? listbox.selectedItems[0] : null;
|
2006-04-08 00:57:21 +00:00
|
|
|
if (selectedItem) {
|
2006-04-08 00:57:38 +00:00
|
|
|
newContentPack = selectedItem.getAttribute("value");
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
} else {
|
2006-04-08 00:57:37 +00:00
|
|
|
newContentPack = parent.hPrefWindow.wsm.dataManager.getItemData( "chrome://communicator/content/pref/pref-content.xul", "contentPackList" ).prefvalue;
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e) {}
|
|
|
|
|
|
|
|
if (newContentPack && (newContentPack != oldContentPack))
|
|
|
|
{
|
|
|
|
try {
|
2006-04-08 00:57:40 +00:00
|
|
|
var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIXULChromeRegistry);
|
2006-04-08 00:57:21 +00:00
|
|
|
chromeRegistry.selectLocale(newContentPack, true);
|
2006-04-08 00:57:24 +00:00
|
|
|
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
2006-04-08 00:57:27 +00:00
|
|
|
observerService.notifyObservers(null, "locale-selected", null);
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-04-08 00:57:39 +00:00
|
|
|
//Switch the Language pack if necessary
|
2006-04-08 00:57:34 +00:00
|
|
|
var oldLanguagePack = parent.hPrefWindow.getPref( "localizedstring", "general.useragent.locale");
|
|
|
|
var newLanguagePack;
|
|
|
|
|
|
|
|
try {
|
2006-04-08 00:57:37 +00:00
|
|
|
var languageList = document.getElementById("languagePackList");
|
|
|
|
if (languageList) {
|
|
|
|
var selectedItem = languageList.selectedItems.length ? languageList.selectedItems[0] : null;
|
2006-04-08 00:57:34 +00:00
|
|
|
if (selectedItem) {
|
2006-04-08 00:57:38 +00:00
|
|
|
newLanguagePack = selectedItem.getAttribute("value");
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
} else {
|
2006-04-08 00:57:37 +00:00
|
|
|
newLanguagePack = parent.hPrefWindow.wsm.dataManager.getItemData( "chrome://communicator/content/pref/pref-content.xul", "languagePackList" ).prefvalue;
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
catch (e) {}
|
|
|
|
if (newLanguagePack && (newLanguagePack != oldLanguagePack))
|
|
|
|
{
|
|
|
|
try {
|
2006-04-08 00:57:40 +00:00
|
|
|
var chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"].getService(Components.interfaces.nsIXULChromeRegistry);
|
2006-04-08 00:57:34 +00:00
|
|
|
chromeRegistry.selectLocale(newLanguagePack, true);
|
|
|
|
var observerService = Components.classes["@mozilla.org/observer-service;1"].getService(Components.interfaces.nsIObserverService);
|
|
|
|
observerService.notifyObservers(null, "locale-selected", null);
|
|
|
|
}
|
|
|
|
catch(e) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2006-04-08 00:57:21 +00:00
|
|
|
|
|
|
|
function SelectContentPack()
|
|
|
|
{
|
2006-04-08 00:57:37 +00:00
|
|
|
var listbox = document.getElementById("contentPackList");
|
|
|
|
var selectedItem = listbox.selectedItems.length ? listbox.selectedItems[0] : null;
|
2006-04-08 00:57:21 +00:00
|
|
|
|
|
|
|
if (selectedItem) {
|
2006-04-08 00:57:38 +00:00
|
|
|
var classType = selectedItem.getAttribute("class");
|
2006-04-08 00:57:34 +00:00
|
|
|
if (classType == "outofdate") {
|
|
|
|
//Make it so that out of date content packs cannot be selected by the user
|
2006-04-08 00:57:37 +00:00
|
|
|
listbox.removeItemFromSelection(selectedItem);
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
else {
|
2006-04-08 00:57:38 +00:00
|
|
|
var regionName = selectedItem.getAttribute("value");
|
2006-04-08 00:57:37 +00:00
|
|
|
listbox.setAttribute("prefvalue", regionName);
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function SelectLanguagePack()
|
|
|
|
{
|
2006-04-08 00:57:37 +00:00
|
|
|
var listbox = document.getElementById("languagePackList");
|
|
|
|
var selectedItem = listbox.selectedItems.length ? listbox.selectedItems[0] : null;
|
2006-04-08 00:57:34 +00:00
|
|
|
|
|
|
|
if (selectedItem) {
|
2006-04-08 00:57:38 +00:00
|
|
|
var classType = selectedItem.getAttribute("class");
|
2006-04-08 00:57:34 +00:00
|
|
|
if (classType == "outofdate") {
|
|
|
|
//Make it so that out of date language packs cannot be selected by the user
|
2006-04-08 00:57:37 +00:00
|
|
|
listbox.removeItemFromSelection(selectedItem);
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
|
|
|
else {
|
2006-04-08 00:57:38 +00:00
|
|
|
var languageName = selectedItem.getAttribute("value");
|
2006-04-08 00:57:37 +00:00
|
|
|
listbox.setAttribute("prefvalue", languageName);
|
2006-04-08 00:57:34 +00:00
|
|
|
}
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
function DownloadRegionPacks()
|
|
|
|
{
|
2006-04-08 00:57:23 +00:00
|
|
|
openTopWin(xlateURL("urn:clienturl:viewmenu:intlwebcontent"));
|
2006-04-08 00:57:21 +00:00
|
|
|
}
|
|
|
|
]]>
|
|
|
|
</script>
|
|
|
|
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
<hbox class="box-smallheader" title="&lHeader;"/>
|
2006-04-08 00:57:21 +00:00
|
|
|
|
2006-04-08 00:57:37 +00:00
|
|
|
<!-- Content (aka region) pack listbox -->
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
<description>&contentIntro.label;</description>
|
2006-04-08 00:57:21 +00:00
|
|
|
<separator class="thin"/>
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
<description>&installedContentPacks.label;</description>
|
2006-04-08 00:57:37 +00:00
|
|
|
<listbox id="contentPackList" flex="1" rows="2"
|
2006-04-08 00:57:21 +00:00
|
|
|
ref="urn:mozilla:locale:root" datasources="rdf:chrome"
|
|
|
|
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
preftype="localizedstring" prefstring="general.useragent.contentlocale"
|
2006-04-08 00:57:21 +00:00
|
|
|
prefvalue="" prefattribute="prefvalue" wsm_attributes="prefvalue"
|
2006-04-08 00:57:31 +00:00
|
|
|
seltype="false" onselect="SelectContentPack();"
|
2006-04-08 00:57:21 +00:00
|
|
|
sortDirection="ascending">
|
2006-04-08 00:57:37 +00:00
|
|
|
|
2006-04-08 00:57:21 +00:00
|
|
|
<template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
2006-04-08 00:57:34 +00:00
|
|
|
|
|
|
|
<!-- This rule displays only up to date content packs based on the localeVersion -->
|
|
|
|
<rule chrome:localeType="region" chrome:localeVersion="&content.version;">
|
2006-04-08 00:57:37 +00:00
|
|
|
<listitem uri="..." translation="true" nselected="false"
|
|
|
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
|
|
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
2006-04-08 00:57:34 +00:00
|
|
|
</rule>
|
|
|
|
|
|
|
|
<!-- This rule "falls through" to match obsolete content packs -->
|
2006-04-08 00:57:21 +00:00
|
|
|
<rule chrome:localeType="region">
|
2006-04-08 00:57:37 +00:00
|
|
|
<listitem uri="..." translation="true" nselected="false" class="outofdate"
|
|
|
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName &update.label;"
|
|
|
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
2006-04-08 00:57:34 +00:00
|
|
|
</rule>
|
|
|
|
|
|
|
|
</template>
|
2006-04-08 00:57:37 +00:00
|
|
|
</listbox>
|
2006-04-08 00:57:34 +00:00
|
|
|
|
2006-04-08 00:57:37 +00:00
|
|
|
<!-- Language pack listbox -->
|
2006-04-08 00:57:34 +00:00
|
|
|
<description>&languageIntro.label;</description>
|
|
|
|
<separator class="thin"/>
|
|
|
|
<description>&installedLanguagePacks.label;</description>
|
2006-04-08 00:57:37 +00:00
|
|
|
<listbox id="languagePackList" flex="1" rows="3"
|
2006-04-08 00:57:34 +00:00
|
|
|
ref="urn:mozilla:locale:root"
|
|
|
|
datasources="rdf:chrome"
|
|
|
|
sortResource="http://www.mozilla.org/rdf/chrome#name"
|
|
|
|
preftype="localizedstring"
|
|
|
|
prefstring="general.useragent.locale"
|
|
|
|
prefattribute="prefvalue"
|
|
|
|
wsm_attributes="value"
|
|
|
|
seltype="false"
|
|
|
|
onselect="SelectLanguagePack();"
|
|
|
|
sortDirection="ascending">
|
|
|
|
<template xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
|
|
|
|
|
|
|
<!-- This rule eliminates region packs from the language pack list -->
|
|
|
|
<rule chrome:localeType="region"/>
|
|
|
|
|
|
|
|
<!-- This rule displays only up to date language packs based on the localeVersion -->
|
|
|
|
<rule chrome:localeVersion="&lang.version;">
|
2006-04-08 00:57:37 +00:00
|
|
|
<listitem uri="..." translation="true" nselected="false"
|
|
|
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName"
|
|
|
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
2006-04-08 00:57:21 +00:00
|
|
|
</rule>
|
2006-04-08 00:57:34 +00:00
|
|
|
|
|
|
|
<!-- This rule "falls through" to match obsolete language packs -->
|
|
|
|
<rule>
|
2006-04-08 00:57:37 +00:00
|
|
|
<listitem uri="..." translation="true" nselected="false" class="outofdate"
|
|
|
|
label="rdf:http://www.mozilla.org/rdf/chrome#displayName &update.label;"
|
|
|
|
value="rdf:http://www.mozilla.org/rdf/chrome#name"/>
|
2006-04-08 00:57:34 +00:00
|
|
|
</rule>
|
2006-04-08 00:57:21 +00:00
|
|
|
</template>
|
2006-04-08 00:57:37 +00:00
|
|
|
</listbox>
|
2006-04-08 00:57:21 +00:00
|
|
|
|
|
|
|
<separator class="thin"/>
|
|
|
|
|
2006-04-08 00:57:23 +00:00
|
|
|
<hbox>
|
2006-04-08 00:57:26 +00:00
|
|
|
<spacer flex="1"/>
|
2006-04-08 00:57:23 +00:00
|
|
|
<button id="downloadContentPacks"
|
|
|
|
label="&downloadContentPacks.label;"
|
|
|
|
accesskey="&downloadContentPacks.accesskey;"
|
|
|
|
oncommand="DownloadRegionPacks()"/>
|
|
|
|
</hbox>
|
2006-04-08 00:57:42 +00:00
|
|
|
|
|
|
|
<separator class="thin"/>
|
|
|
|
<description>&restartOnLangChange.label;</description>
|
107642 - XUL syntax/cleanup landing. Fixes 94470, 96008, 96019, 76800, 102637, 80399, 108303, and removes over a thousand unnecessary or nonsensical attributes. Also fixes 108302, 102366, 102367, 105815. r=sspitzer,cmanske on appropriate parts sr=ben
2006-04-08 00:57:28 +00:00
|
|
|
</page>
|