Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #15980 from timdream/build-l10n-copy-bulid-stage
Browse files Browse the repository at this point in the history
Bug 968187 - Localize manifests copied from build_stage, r=yuren
  • Loading branch information
timdream committed Feb 5, 2014
2 parents 95cea77 + 0512175 commit f217571
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
17 changes: 13 additions & 4 deletions build/copy-build-stage-manifest.js
Expand Up @@ -14,11 +14,20 @@ function execute(options) {
var manifest = app.buildDirectoryFile.clone();
manifest.append(WEBAPP_FILENAME);
if (manifest.exists()) {
var webappTargetDir = webappsBaseDir.clone();
webappTargetDir.append(app.domain);
manifest.copyTo(webappTargetDir, WEBAPP_FILENAME);
if (gaia.l10nManager) {
var manifestContent = gaia.l10nManager.localizeManifest(app);
var targetManifest = webappsBaseDir.clone();
targetManifest.append(app.domain);
targetManifest.append(WEBAPP_FILENAME)

utils.writeContent(targetManifest, JSON.stringify(manifestContent));
} else {
var webappTargetDir = webappsBaseDir.clone();
webappTargetDir.append(app.domain);
manifest.copyTo(webappTargetDir, WEBAPP_FILENAME);
}
}
})
}

exports.execute = execute;
exports.execute = execute;
5 changes: 4 additions & 1 deletion build/multilocale.js
Expand Up @@ -278,8 +278,11 @@ function L10nManager(gaiaDir, sharedDir, localesFilePath, localeBasedir) {
return true;
});

var manifestFile = webapp.buildManifestFile.exists() ?
webapp.buildManifestFile : webapp.manifestFile;

var manifest = addLocaleManifest(localesForManifest, localesProps,
utils.getJSON(webapp.manifestFile));
utils.getJSON(manifestFile));
return manifest;
}

Expand Down
6 changes: 6 additions & 0 deletions build/utils-xpc.js
Expand Up @@ -203,6 +203,7 @@ function makeWebappsObject(appdirs, domain, scheme, port) {
let webapp = {
manifest: getJSON(manifest),
manifestFile: manifest,
buildManifestFile: manifest,
url: scheme + appDomain + (port ? port : ''),
domain: appDomain,
sourceDirectoryFile: manifestFile.parent,
Expand Down Expand Up @@ -235,6 +236,11 @@ function makeWebappsObject(appdirs, domain, scheme, port) {
});

webapp.buildDirectoryFile = buildDirectoryFile;

let buildManifestFile = buildDirectoryFile.clone();
buildManifestFile.append('manifest.webapp');

webapp.buildManifestFile = buildManifestFile;
}
}

Expand Down

0 comments on commit f217571

Please sign in to comment.