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

Commit 4300f5a

Browse files
Merge pull request #14364 from niteskum/AutoUpdateLocalizationBug
Fix for Localization Bug and Retaining the Installer Log
2 parents 288449b + 7326f0b commit 4300f5a

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/extensions/default/AutoUpdate/UpdateStatus.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ define(function (require, exports, module) {
2727
var UpdateStatusHtml = require("text!htmlContent/updateStatus.html"),
2828
ExtensionUtils = brackets.getModule("utils/ExtensionUtils"),
2929
Mustache = brackets.getModule("thirdparty/mustache/mustache"),
30-
Strings = brackets.getModule("strings");
30+
Strings = brackets.getModule("strings"),
31+
StringUtils = brackets.getModule("utils/StringUtils");
3132

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

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

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

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="update-status">
2-
<p id="initial-download">{{Strings.INITIAL_DOWNLOAD}}<span id="percent">0%</span></p>
2+
<p id="initial-download">{{Strings.INITIAL_DOWNLOAD}}<span id="percent"></span></p>
33
<p id="retry-download">{{Strings.RETRY_DOWNLOAD}}<span id="attempt">1/5</span></p>
44
<p id="validating-installer">{{Strings.VALIDATING_INSTALLER}}</p>
55
</div>

src/extensions/default/AutoUpdate/main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ define(function (require, exports, module) {
217217
* Checks and handles the update success and failure scenarios
218218
*/
219219
function checkUpdateStatus() {
220-
var filesToCache = null,
220+
var filesToCache = ['.logs'],
221221
downloadCompleted = updateJsonHandler.get("downloadCompleted"),
222222
updateInitiatedInPrevSession = updateJsonHandler.get("updateInitiatedInPrevSession");
223223

@@ -240,7 +240,6 @@ define(function (require, exports, module) {
240240
} else {
241241
// We get here if the update started but failed
242242
checkInstallationStatus();
243-
filesToCache = ['.logs']; //AUTOUPDATE_PRERELEASE
244243
UpdateInfoBar.showUpdateBar({
245244
type: "error",
246245
title: Strings.UPDATE_FAILED,

src/nls/root/strings.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,7 @@ define({
873873
"AUTOUPDATE_ERROR" : "Error!",
874874
"AUTOUPDATE_IN_PROGRESS" : "An update is already in progress.",
875875

876+
"NUMBER_WITH_PERCENTAGE" : "{0}%",
876877
// Strings for Related Files
877878
"CMD_FIND_RELATED_FILES" : "Find Related Files"
878879
});

0 commit comments

Comments
 (0)