mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1142758 - Use the getLocalizedValue language when falling back to manifest values r=ferjm
This commit is contained in:
parent
6cac5a5d17
commit
e0e241e7b2
@ -785,7 +785,7 @@ this.AppsUtils = {
|
||||
/**
|
||||
* Helper object to access manifest information with locale support
|
||||
*/
|
||||
this.ManifestHelper = function(aManifest, aOrigin, aManifestURL) {
|
||||
this.ManifestHelper = function(aManifest, aOrigin, aManifestURL, aLang) {
|
||||
// If the app is packaged, we resolve uris against the origin.
|
||||
// If it's not, against the manifest url.
|
||||
|
||||
@ -801,10 +801,15 @@ this.ManifestHelper = function(aManifest, aOrigin, aManifestURL) {
|
||||
this._manifestURL = Services.io.newURI(aManifestURL, null, null);
|
||||
|
||||
this._manifest = aManifest;
|
||||
let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Ci.nsIXULChromeRegistry)
|
||||
.QueryInterface(Ci.nsIToolkitChromeRegistry);
|
||||
let locale = chrome.getSelectedLocale("global").toLowerCase();
|
||||
|
||||
let locale = aLang;
|
||||
if (!locale) {
|
||||
let chrome = Cc["@mozilla.org/chrome/chrome-registry;1"]
|
||||
.getService(Ci.nsIXULChromeRegistry)
|
||||
.QueryInterface(Ci.nsIToolkitChromeRegistry);
|
||||
locale = chrome.getSelectedLocale("global").toLowerCase();
|
||||
}
|
||||
|
||||
this._localeRoot = this._manifest;
|
||||
|
||||
if (this._manifest.locales && this._manifest.locales[locale]) {
|
||||
|
@ -245,7 +245,7 @@ this.Langpacks = {
|
||||
|
||||
// We need to get the app with the manifest since the version is only
|
||||
// available in the manifest.
|
||||
this._appFromManifestURL(aData.manifestURL, aData.entryPoint)
|
||||
this._appFromManifestURL(aData.manifestURL, aData.entryPoint, aData.lang)
|
||||
.then(aApp => {
|
||||
let manifest = aApp.manifest;
|
||||
|
||||
|
@ -4674,7 +4674,7 @@ this.DOMApplicationRegistry = {
|
||||
},
|
||||
|
||||
// Returns a promise that resolves to the app object with the manifest.
|
||||
getFullAppByManifestURL: function(aManifestURL, aEntryPoint) {
|
||||
getFullAppByManifestURL: function(aManifestURL, aEntryPoint, aLang) {
|
||||
let app = this.getAppByManifestURL(aManifestURL);
|
||||
if (!app) {
|
||||
return Promise.reject("NoSuchApp");
|
||||
@ -4692,7 +4692,8 @@ this.DOMApplicationRegistry = {
|
||||
manifest.version = aManifest.version;
|
||||
}
|
||||
|
||||
app.manifest = new ManifestHelper(manifest, app.origin, app.manifestURL);
|
||||
app.manifest =
|
||||
new ManifestHelper(manifest, app.origin, app.manifestURL, aLang);
|
||||
return app;
|
||||
});
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user