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

Commit a7c8238

Browse files
committed
add top-level key to package.json to avoid collisions
1 parent cb01a98 commit a7c8238

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/extensibility/ExtensionManagerView.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,11 +241,12 @@ define(function (require, exports, module) {
241241
var lang = brackets.getLocale(),
242242
shortLang = lang.split("-")[0];
243243
[shortLang, lang].forEach(function (locale) {
244-
if (info.metadata.hasOwnProperty(locale)) {
244+
if (info.metadata["package-i18n"] !== undefined &&
245+
info.metadata["package-i18n"].hasOwnProperty(locale)) {
245246
// only overlay specific properties with the localized values
246247
['title', 'description', 'homepage', 'keywords'].forEach(function (prop) {
247-
if (info.metadata[locale].hasOwnProperty(prop)) {
248-
info.metadata[prop] = info.metadata[locale][prop];
248+
if (info.metadata["package-i18n"][locale].hasOwnProperty(prop)) {
249+
info.metadata[prop] = info.metadata["package-i18n"][locale][prop];
249250
}
250251
});
251252
}

src/extensions/samples/LocalizationExample/package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@
1313
"en",
1414
"fr"
1515
],
16-
"fr": {
17-
"title": "fr title to replace the root title",
18-
"description": "fr description to replace the root description"
16+
"package-i18n": {
17+
"fr": {
18+
"title": "Localisation Exemple",
19+
"description": "Un guide sur la façon de localiser votre poste."
20+
}
1921
}
2022
}

0 commit comments

Comments
 (0)