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

Commit 28466bd

Browse files
committed
Merge pull request #7797 from adobe/bchin/fix-update-notifications-for-en-US
Fix update notification .json filename generated for 'en-US' locale
2 parents e65b81b + c8bd6f4 commit 28466bd

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

src/utils/UpdateNotification.js

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,16 @@ define(function (require, exports, module) {
147147

148148
if (fetchData) {
149149
var lookupPromise = new $.Deferred(),
150-
localVersionInfoUrl = _versionInfoUrl || _getVersionInfoUrl();
150+
localVersionInfoUrl;
151151

152-
// If the current locale isn't en, check whether we actually have a locale-specific update notification, and fall back to en if not.
153-
if (brackets.getLocale() !== "en") {
152+
// If the current locale isn't "en" or "en-US", check whether we actually have a
153+
// locale-specific update notification, and fall back to "en" if not.
154+
// Note: we check for both "en" and "en-US" to watch for the general case or
155+
// country-specific English locale. The former appears default on Mac, while
156+
// the latter appears default on Windows.
157+
var locale = brackets.getLocale().toLowerCase();
158+
if (locale !== "en" && locale !== "en-us") {
159+
localVersionInfoUrl = _versionInfoUrl || _getVersionInfoUrl();
154160
$.ajax({
155161
url: localVersionInfoUrl,
156162
cache: false,
@@ -175,6 +181,7 @@ define(function (require, exports, module) {
175181
lookupPromise.resolve();
176182
});
177183
} else {
184+
localVersionInfoUrl = _versionInfoUrl || _getVersionInfoUrl("en");
178185
lookupPromise.resolve();
179186
}
180187

@@ -321,7 +328,7 @@ define(function (require, exports, module) {
321328
var oldValues;
322329
var usingOverrides = false; // true if any of the values are overridden.
323330
var result = new $.Deferred();
324-
var versionInfoUrl = _getVersionInfoUrl();
331+
var versionInfoUrl;
325332

326333
if (_testValues) {
327334
oldValues = {};

0 commit comments

Comments
 (0)