зеркало из https://github.com/mozilla/pjs.git
[mq]: locales
This commit is contained in:
Родитель
6cde2ffa0e
Коммит
9de5516730
|
@ -310,7 +310,6 @@ pref("privacy.item.sessions", true);
|
|||
pref("privacy.item.geolocation", true);
|
||||
pref("privacy.item.siteSettings", true);
|
||||
|
||||
|
||||
pref("plugins.enabled", true);
|
||||
|
||||
// URL to the Learn More link XXX this is the firefox one. Bug XXX fixes this.
|
||||
|
@ -354,3 +353,6 @@ pref("app.support.baseURL", "http://support.mozilla.com/1/%APP%/%VERSION%/%OS%/%
|
|||
|
||||
// Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
|
||||
pref("security.alternate_certificate_error_page", "certerror");
|
||||
|
||||
// Inherit OS locale
|
||||
pref("intl.locale.matchOS", true);
|
||||
|
|
|
@ -396,6 +396,7 @@ var BrowserUI = {
|
|||
|
||||
ExtensionsView.init();
|
||||
DownloadsView.init();
|
||||
PreferencesView.init();
|
||||
},
|
||||
|
||||
uninit : function() {
|
||||
|
@ -603,7 +604,7 @@ var BrowserUI = {
|
|||
let panelUI = document.getElementById("panel-container");
|
||||
panelUI.hidden = true;
|
||||
},
|
||||
|
||||
|
||||
handleEvent: function (aEvent) {
|
||||
switch (aEvent.type) {
|
||||
// Browser events
|
||||
|
|
|
@ -74,6 +74,7 @@
|
|||
<script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/browser-ui.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/sanitize.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/preferences.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/extensions.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/downloads.js"/>
|
||||
<script type="application/x-javascript" src="chrome://browser/content/console.js"/>
|
||||
|
@ -349,38 +350,48 @@
|
|||
<hbox id="prefs-header" class="panel-header">
|
||||
<label value="&prefsHeader.label;"/>
|
||||
</hbox>
|
||||
<richlistbox id="prefs-list" seltype="single" flex="1">
|
||||
<setting title="&about.title;" type="control">
|
||||
&about.description;
|
||||
<button id="prefs-about-button" label="&about.button;"
|
||||
<notificationbox id="prefs-messages" flex="1">
|
||||
<richlistbox id="prefs-list" seltype="single" flex="1">
|
||||
<setting title="&about.title;" type="control">
|
||||
&about.description;
|
||||
<button id="prefs-about-button" label="&about.button;"
|
||||
#ifdef MOZ_OFFICIAL_BRANDING
|
||||
# these two point to the same page, this just matters for what shows up in the
|
||||
# URL bar
|
||||
oncommand="Browser.addTab('about:firefox', true);"/>
|
||||
oncommand="Browser.addTab('about:firefox', true);"/>
|
||||
#else
|
||||
oncommand="Browser.addTab('about:fennec', true);"/>
|
||||
oncommand="Browser.addTab('about:fennec', true);"/>
|
||||
#endif
|
||||
</setting>
|
||||
<settings id="prefs-content" label="&content.title;">
|
||||
<setting pref="permissions.default.image" title="&showImages.title;" type="boolint" on="1" off="2"/>
|
||||
<setting pref="javascript.enabled" type="bool" title="&enableJavaScript.title;">
|
||||
&enableJavaScript.description;
|
||||
</setting>
|
||||
<setting pref="plugins.enabled" type="bool" title="&enablePlugins.title;" onsynctopreference="Browser.setPluginState(this.value);">
|
||||
&enablePlugins.description;
|
||||
</setting>
|
||||
</settings>
|
||||
<settings id="prefs-privacy" label="&privacy.title;">
|
||||
<setting pref="network.cookie.cookieBehavior" title="&allowCookies.title;" type="boolint" on="0" off="2">
|
||||
&allowCookies.description;
|
||||
</setting>
|
||||
<setting pref="signon.rememberSignons" title="&rememberPasswords.title;" type="bool"/>
|
||||
<setting title="&clearPrivateData.title;" type="control">
|
||||
&clearPrivateData.description;
|
||||
<button id="prefs-clear-data" label="&clearPrivateData.button;" command="cmd_sanitize"/>
|
||||
</setting>
|
||||
</settings>
|
||||
</richlistbox>
|
||||
<setting id="prefs-uilanguage" title="&language.title;" type="control">
|
||||
&language.description;
|
||||
<menulist id="prefs-languages" onchange="PreferencesView.updateLocale();">
|
||||
<menupopup>
|
||||
<menuitem label="&language.auto;" value="auto"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
</setting>
|
||||
<settings id="prefs-content" label="&content.title;">
|
||||
<setting pref="permissions.default.image" title="&showImages.title;" type="boolint" on="1" off="2"/>
|
||||
<setting pref="javascript.enabled" type="bool" title="&enableJavaScript.title;">
|
||||
&enableJavaScript.description;
|
||||
</setting>
|
||||
<setting pref="plugins.enabled" type="bool" title="&enablePlugins.title;" onsynctopreference="Browser.setPluginState(this.value);">
|
||||
&enablePlugins.description;
|
||||
</setting>
|
||||
</settings>
|
||||
<settings id="prefs-privacy" label="&privacy.title;">
|
||||
<setting pref="network.cookie.cookieBehavior" title="&allowCookies.title;" type="boolint" on="0" off="2">
|
||||
&allowCookies.description;
|
||||
</setting>
|
||||
<setting pref="signon.rememberSignons" title="&rememberPasswords.title;" type="bool"/>
|
||||
<setting title="&clearPrivateData.title;" type="control">
|
||||
&clearPrivateData.description;
|
||||
<button id="prefs-clear-data" label="&clearPrivateData.button;" command="cmd_sanitize"/>
|
||||
</setting>
|
||||
</settings>
|
||||
</richlistbox>
|
||||
</notificationbox>
|
||||
</vbox>
|
||||
|
||||
<vbox id="console-container" flex="1">
|
||||
|
|
|
@ -35,8 +35,6 @@
|
|||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
|
||||
|
||||
const PREFIX_ITEM_URI = "urn:mozilla:item:";
|
||||
const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#";
|
||||
|
||||
|
@ -171,8 +169,8 @@ var ExtensionsView = {
|
|||
|
||||
if (this._msg) {
|
||||
let strings = document.getElementById("bundle_browser");
|
||||
this.showMessage(strings.getString("addonsRestart"), "restart-app",
|
||||
strings.getString("addonsRestartButton.label"), false, "addons-restart-app");
|
||||
this.showMessage(strings.getString("notificationRestart.label"), "restart-app",
|
||||
strings.getString("notificationRestart.button"), false, "addons-restart-app");
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
# LOCALIZATION NOTE: do not localize
|
||||
af=Afrikaans
|
||||
ak=Akan
|
||||
ar=عربي
|
||||
as=অসমীয়া
|
||||
ast-ES=Asturianu
|
||||
be=Беларуская
|
||||
bg=Български
|
||||
bn-BD=বাংলা (বাংলাদেশ)
|
||||
bn-IN=বাংলা (ভারত)
|
||||
br-FR=Brezhoneg
|
||||
ca=català
|
||||
ca-valencia=català (valencià)
|
||||
cs=Čeština
|
||||
cy=Cymraeg
|
||||
da=Dansk
|
||||
de=Deutsch
|
||||
de-AT=Deutsch (Österreich)
|
||||
de-CH=Deutsch (Schweiz)
|
||||
de-DE=Deutsch (Deutschland)
|
||||
el=Ελληνικά
|
||||
en-AU=English (Australian)
|
||||
en-CA=English (Canadian)
|
||||
en-GB=English (British)
|
||||
en-NZ=English (New Zealand)
|
||||
en-US=English (US)
|
||||
en-ZA=English (South African)
|
||||
eo=Esperanto
|
||||
es-AR=Español (de Argentina)
|
||||
es-CL=Español (de Chile)
|
||||
es-ES=Español (de España)
|
||||
es-MX=Español (de México)
|
||||
et=Eesti keel
|
||||
eu=Euskara
|
||||
fa=فارسی
|
||||
fi=suomi
|
||||
fr=Français
|
||||
fur-IT=Furlan
|
||||
fy-NL=Frysk
|
||||
ga-IE=Gaeilge
|
||||
gl=Galego
|
||||
gu-IN=ગુજરાતી
|
||||
he=עברית
|
||||
hi=हिन्दी
|
||||
hi-IN=हिन्दी (भारत)
|
||||
hr=Hrvatski
|
||||
hsb=Hornjoserbsce
|
||||
hu=Magyar
|
||||
hy-AM=Հայերեն
|
||||
id=Bahasa Indonesia
|
||||
is=íslenska
|
||||
it=Italiano
|
||||
ja=日本語
|
||||
ka=ქართული
|
||||
kk=Қазақ
|
||||
kn=ಕನ್ನಡ
|
||||
ko=한국어
|
||||
ku=Kurdî
|
||||
la=Latina
|
||||
lt=lietuvių kalba
|
||||
lv=Latviešu
|
||||
mg=Malagasy
|
||||
mi=Māori (Aotearoa)
|
||||
mk=Македонски
|
||||
ml=മലയാളം
|
||||
mn=Монгол
|
||||
mr=मराठी
|
||||
nb-NO=Norsk bokmål
|
||||
ne-NP=नेपाली
|
||||
nl=Nederlands
|
||||
nn-NO=Norsk nynorsk
|
||||
nr=isiNdebele Sepumalanga
|
||||
nso=Sepedi
|
||||
oc=occitan (lengadocian)
|
||||
or=ଓଡ଼ିଆ
|
||||
pa-IN=ਪੰਜਾਬੀ
|
||||
pl=Polski
|
||||
pt-BR=Português (do Brasil)
|
||||
pt-PT=Português (Europeu)
|
||||
rm=rumantsch
|
||||
ro=română
|
||||
ru=Русский
|
||||
rw=Ikinyarwanda
|
||||
si=සිංහල
|
||||
sk=slovenčina
|
||||
sl=slovensko
|
||||
sq=Shqip
|
||||
sr=Српски
|
||||
sr-Latn=Srpski
|
||||
ss=Siswati
|
||||
st=Sesotho
|
||||
sv-SE=Svenska
|
||||
ta=தமிழ்
|
||||
ta-IN=தமிழ் (இந்தியா)
|
||||
ta-LK=தமிழ் (இலங்கை)
|
||||
te=తెలుగు
|
||||
th=ไทย
|
||||
tn=Setswana
|
||||
tr=Türkçe
|
||||
ts=Mutsonga
|
||||
tt-RU=Tatarça
|
||||
uk=Українська
|
||||
ur=اُردو
|
||||
ve=Tshivenḓa
|
||||
vi=Tiếng Việt
|
||||
wo=Wolof
|
||||
xh=isiXhosa
|
||||
zh-CN=中文 (简体)
|
||||
zh-TW=正體中文 (繁體)
|
||||
zu=isiZulu
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
|
||||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
||||
*
|
||||
* The contents of this file are subject to the Mozilla 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/MPL/
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* The Original Code is Mozilla Mobile Browser.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Mozilla Corporation.
|
||||
* Portions created by the Initial Developer are Copyright (C) 2009
|
||||
* the Initial Developer. All Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Mark Finkle <mfinkle@mozilla.com>
|
||||
*
|
||||
* Alternatively, the contents of this file may be used under the terms of
|
||||
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
||||
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
||||
* in which case the provisions of the GPL or the LGPL are applicable instead
|
||||
* of those above. If you wish to allow use of your version of this file only
|
||||
* under the terms of either the GPL or the LGPL, and not to allow others to
|
||||
* use your version of this file under the terms of the MPL, indicate your
|
||||
* decision by deleting the provisions above and replace them with the notice
|
||||
* and other provisions required by the GPL or the LGPL. If you do not delete
|
||||
* the provisions above, a recipient may use your version of this file under
|
||||
* the terms of any one of the MPL, the GPL or the LGPL.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
var PreferencesView = {
|
||||
_currentLocale: null,
|
||||
_list: null,
|
||||
_msg: null,
|
||||
_restartCount: 0,
|
||||
|
||||
_messageActions: function ev__messageActions(aData) {
|
||||
if (aData == "prefs-restart-app") {
|
||||
// Notify all windows that an application quit has been requested
|
||||
var os = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
|
||||
var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].createInstance(Ci.nsISupportsPRBool);
|
||||
os.notifyObservers(cancelQuit, "quit-application-requested", "restart");
|
||||
|
||||
// If nothing aborted, quit the app
|
||||
if (cancelQuit.data == false) {
|
||||
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].getService(Ci.nsIAppStartup);
|
||||
appStartup.quit(Ci.nsIAppStartup.eRestart | Ci.nsIAppStartup.eAttemptQuit);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
showMessage: function ev_showMessage(aMsg, aValue, aButtonLabel, aShowCloseButton, aNotifyData) {
|
||||
let notification = this._msg.getNotificationWithValue(aValue);
|
||||
if (notification)
|
||||
return;
|
||||
|
||||
let self = this;
|
||||
let buttons = null;
|
||||
if (aButtonLabel) {
|
||||
buttons = [ {
|
||||
label: aButtonLabel,
|
||||
accessKey: "",
|
||||
data: aNotifyData,
|
||||
callback: function(aNotification, aButton) {
|
||||
self._messageActions(aButton.data);
|
||||
return true;
|
||||
}
|
||||
} ];
|
||||
}
|
||||
|
||||
this._msg.appendNotification(aMsg, aValue, "", this._msg.PRIORITY_WARNING_LOW, buttons).hideclose = !aShowCloseButton;
|
||||
},
|
||||
|
||||
showRestart: function ev_showRestart() {
|
||||
// Increment the count in case the view is not completely initialized
|
||||
this._restartCount++;
|
||||
|
||||
if (this._msg) {
|
||||
let strings = document.getElementById("bundle_browser");
|
||||
this.showMessage(strings.getString("notificationRestart.label"), "restart-app",
|
||||
strings.getString("notificationRestart.button"), false, "prefs-restart-app");
|
||||
}
|
||||
},
|
||||
|
||||
hideRestart: function ev_hideRestart() {
|
||||
this._restartCount--;
|
||||
if (this._restartCount == 0 && this._msg) {
|
||||
let notification = this._msg.getNotificationWithValue("restart-app");
|
||||
if (notification)
|
||||
notification.close();
|
||||
}
|
||||
},
|
||||
|
||||
init: function ev_init() {
|
||||
if (this._msg)
|
||||
return;
|
||||
|
||||
this._msg = document.getElementById("prefs-messages");
|
||||
|
||||
let self = this;
|
||||
let panels = document.getElementById("panel-items");
|
||||
panels.addEventListener("select",
|
||||
function(aEvent) {
|
||||
if (panels.selectedPanel.id == "prefs-container")
|
||||
self._delayedInit();
|
||||
},
|
||||
false);
|
||||
},
|
||||
|
||||
_delayedInit: function ev__delayedInit() {
|
||||
if (this._list)
|
||||
return;
|
||||
|
||||
this._list = document.getElementById("prefs-languages");
|
||||
this._loadLocales();
|
||||
},
|
||||
|
||||
_loadLocales: function _loadLocales() {
|
||||
// Query available and selected locales
|
||||
let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"].getService(Ci.nsIXULChromeRegistry);
|
||||
chrome.QueryInterface(Ci.nsIToolkitChromeRegistry);
|
||||
|
||||
let selectedLocale = chrome.getSelectedLocale("browser");
|
||||
let availableLocales = chrome.getLocalesForPackage("browser");
|
||||
|
||||
let bundles = Cc["@mozilla.org/intl/stringbundle;1"].getService(Ci.nsIStringBundleService);
|
||||
let strings = bundles.createBundle("chrome://browser/content/languages.properties");
|
||||
|
||||
// Render locale menulist by iterating through the query result from getLocalesForPackage()
|
||||
let selectedItem = null;
|
||||
let localeCount = 0;
|
||||
while (availableLocales.hasMore()) {
|
||||
let locale = availableLocales.getNext();
|
||||
try {
|
||||
var label = strings.GetStringFromName(locale);
|
||||
} catch (e) {
|
||||
label = locale;
|
||||
}
|
||||
let item = this._list.appendItem(label, locale);
|
||||
if (locale == selectedLocale) {
|
||||
this._currentLocale = locale;
|
||||
selectedItem = item;
|
||||
}
|
||||
localeCount++;
|
||||
}
|
||||
|
||||
// Highlight current locale
|
||||
this._list.selectedItem = selectedItem;
|
||||
|
||||
// Hide the setting if we only have one locale
|
||||
if (localeCount == 1)
|
||||
document.getElementById("prefs-uilanguage").hidden = true;
|
||||
},
|
||||
|
||||
updateLocale: function updateLocale() {
|
||||
// Which locale did the user select?
|
||||
let newLocale = this._list.selectedItem.value;
|
||||
|
||||
if (newLocale == "auto") {
|
||||
gPrefService.clearUserPref("general.useragent.locale");
|
||||
gPrefService.setBoolPref("intl.locale.matchOS", true);
|
||||
} else {
|
||||
gPrefService.setBoolPref("intl.locale.matchOS", false);
|
||||
gPrefService.setCharPref("general.useragent.locale", newLocale);
|
||||
}
|
||||
|
||||
// Show the restart notification, if needed
|
||||
if (this._currentLocale == newLocale)
|
||||
this.hideRestart();
|
||||
else
|
||||
this.showRestart();
|
||||
}
|
||||
};
|
|
@ -5,6 +5,7 @@ chrome.jar:
|
|||
* content/about.xhtml (content/about.xhtml)
|
||||
content/aboutCertError.xhtml (content/aboutCertError.xhtml)
|
||||
content/aboutCertError.css (content/aboutCertError.css)
|
||||
content/languages.properties (content/languages.properties)
|
||||
* content/browser.xul (content/browser.xul)
|
||||
* content/browser.js (content/browser.js)
|
||||
content/browser-ui.js (content/browser-ui.js)
|
||||
|
@ -30,6 +31,7 @@ chrome.jar:
|
|||
content/TileManager.js (content/TileManager.js)
|
||||
* content/InputHandler.js (content/InputHandler.js)
|
||||
content/Util.js (content/Util.js)
|
||||
content/preferences.js (content/preferences.js)
|
||||
content/extensions.js (content/extensions.js)
|
||||
content/downloads.js (content/downloads.js)
|
||||
content/console.js (content/console.js)
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
# Add-on Manager
|
||||
addonsRestart=Restart to complete changes
|
||||
addonsRestartButton.label=Restart
|
||||
addonsLocalNone.label=No add-ons installed
|
||||
addonsSearchStart.label=Searching for add-ons…
|
||||
addonsSearchStart.button=Cancel
|
||||
|
@ -51,6 +49,10 @@ alertDownloads=Downloads
|
|||
alertDownloadsStart=Downloading: %S
|
||||
alertDownloadsDone=%S has finished downloading
|
||||
|
||||
# Notifications
|
||||
notificationRestart.label=Restart to complete changes
|
||||
notificationRestart.button=Restart
|
||||
|
||||
# Popup Blocker
|
||||
popupWarning=%S prevented this site from opening a pop-up window.
|
||||
popupWarningMultiple=%S prevented this site from opening %S pop-up windows.
|
||||
|
|
|
@ -15,3 +15,6 @@
|
|||
<!ENTITY clearPrivateData.button "Clear">
|
||||
<!ENTITY clearPrivateData.description "Your history helps &brandShortName; suggest where you want to go">
|
||||
<!ENTITY rememberPasswords.title "Remember passwords">
|
||||
<!ENTITY language.title "Language">
|
||||
<!ENTITY language.description "Choose your preferred language for &brandShortName;">
|
||||
<!ENTITY language.auto "Auto-detect">
|
||||
|
|
Загрузка…
Ссылка в новой задаче