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

Commit cb01a98

Browse files
committed
whitelisting properties to overlay; remove keyword concatenation with root language
1 parent 6aa3cea commit cb01a98

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/extensibility/ExtensionManagerView.js

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -237,20 +237,15 @@ define(function (require, exports, module) {
237237
context.isCompatible = context.isCompatibleLatest = true;
238238
}
239239

240-
// Extension metadata might have localized content. If so, overlay (or concatenate) those strings, first
241-
// using any shortlang-specified values, and then the long language form.
240+
// Check if extension metadata contains localized content.
242241
var lang = brackets.getLocale(),
243242
shortLang = lang.split("-")[0];
244243
[shortLang, lang].forEach(function (locale) {
245244
if (info.metadata.hasOwnProperty(locale)) {
246-
_.forEach(info.metadata[locale], function (value, prop) {
247-
if (prop !== "keywords") {
248-
// overlay existing string w/ localized string
249-
info.metadata[prop] = value;
250-
} else {
251-
// for keywords, add the localized keywords to the root language keywords
252-
var keywords = info.metadata[prop].concat(value);
253-
info.metadata[prop] = _.uniq(keywords);
245+
// only overlay specific properties with the localized values
246+
['title', 'description', 'homepage', 'keywords'].forEach(function (prop) {
247+
if (info.metadata[locale].hasOwnProperty(prop)) {
248+
info.metadata[prop] = info.metadata[locale][prop];
254249
}
255250
});
256251
}

0 commit comments

Comments
 (0)