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

Commit

Permalink
Fix for Localization Bug and Retaining the Installer Log
Browse files Browse the repository at this point in the history
  • Loading branch information
niteskum committed May 28, 2018
1 parent 37793e7 commit 7326f0b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/extensions/default/AutoUpdate/UpdateStatus.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ define(function (require, exports, module) {
var UpdateStatusHtml = require("text!htmlContent/updateStatus.html"),
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
Mustache = brackets.getModule("thirdparty/mustache/mustache"),
Strings = brackets.getModule("strings");
Strings = brackets.getModule("strings"),
StringUtils = brackets.getModule("utils/StringUtils");

ExtensionUtils.loadStyleSheet(module, "styles/styles.css");

Expand All @@ -47,6 +48,8 @@ define(function (require, exports, module) {

var $updateStatus = $(Mustache.render(UpdateStatusHtml, {"Strings": Strings}));
$updateStatus.appendTo('#status-bar');
var valStr = StringUtils.format(Strings.NUMBER_WITH_PERCENTAGE, 0);
$('#update-status #' + id + ' #' + 'percent').text(valStr);
$('#update-status #' + id).show();
}

Expand All @@ -61,7 +64,8 @@ define(function (require, exports, module) {
*/
function modifyUpdateStatus(statusObj) {
statusObj.spans.forEach(function (span) {
$('#update-status #' + statusObj.target + ' #' + span.id).text(span.val);
var valStr = StringUtils.format(Strings.NUMBER_WITH_PERCENTAGE, span.val.split('%')[0]);
$('#update-status #' + statusObj.target + ' #' + span.id).text(valStr);
});
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div id="update-status">
<p id="initial-download">{{Strings.INITIAL_DOWNLOAD}}<span id="percent">0%</span></p>
<p id="initial-download">{{Strings.INITIAL_DOWNLOAD}}<span id="percent"></span></p>
<p id="retry-download">{{Strings.RETRY_DOWNLOAD}}<span id="attempt">1/5</span></p>
<p id="validating-installer">{{Strings.VALIDATING_INSTALLER}}</p>
</div>
3 changes: 1 addition & 2 deletions src/extensions/default/AutoUpdate/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ define(function (require, exports, module) {
* Checks and handles the update success and failure scenarios
*/
function checkUpdateStatus() {
var filesToCache = null,
var filesToCache = ['.logs'],
downloadCompleted = updateJsonHandler.get("downloadCompleted"),
updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession");

Expand All @@ -204,7 +204,6 @@ define(function (require, exports, module) {
} else {
// We get here if the update started but failed
checkInstallationStatus();
filesToCache = ['.logs']; //AUTOUPDATE_PRERELEASE
UpdateInfoBar.showUpdateBar({
type: "error",
title: Strings.UPDATE_FAILED,
Expand Down
1 change: 1 addition & 0 deletions src/nls/root/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ define({
"LATER_BUTTON" : "Later",
"DESCRIPTION_AUTO_UPDATE" : "Enable/disable Brackets Auto-update",

"NUMBER_WITH_PERCENTAGE" : "{0}%",
// Strings for Related Files
"CMD_FIND_RELATED_FILES" : "Find Related Files"
});

0 comments on commit 7326f0b

Please sign in to comment.