diff --git a/dist/manifold.bundle.d.ts b/dist/manifold.bundle.d.ts index d6311ff..992a9dd 100644 --- a/dist/manifold.bundle.d.ts +++ b/dist/manifold.bundle.d.ts @@ -1,4 +1,4 @@ -// manifesto.js v1.0.0 https://github.com/viewdir/manifesto +// manifesto.js v2.0.0 https://github.com/viewdir/manifesto declare module exjs { var version: string; } diff --git a/dist/manifold.bundle.js b/dist/manifold.bundle.js index 5dbd0e4..0ac2748 100644 --- a/dist/manifold.bundle.js +++ b/dist/manifold.bundle.js @@ -2270,7 +2270,12 @@ var Manifesto; }; MetadataItem.prototype.getValue = function () { if (this.value) { - return Manifesto.TranslationCollection.getValue(this.value, this.defaultLocale); + var locale = this.defaultLocale; + // if the label has a locale, prefer that to the default locale + if (this.label.length && this.label[0].locale) { + locale = this.label[0].locale; + } + return Manifesto.TranslationCollection.getValue(this.value, locale); } return null; }; diff --git a/examples/js/manifold.bundle.js b/examples/js/manifold.bundle.js index 5dbd0e4..0ac2748 100644 --- a/examples/js/manifold.bundle.js +++ b/examples/js/manifold.bundle.js @@ -2270,7 +2270,12 @@ var Manifesto; }; MetadataItem.prototype.getValue = function () { if (this.value) { - return Manifesto.TranslationCollection.getValue(this.value, this.defaultLocale); + var locale = this.defaultLocale; + // if the label has a locale, prefer that to the default locale + if (this.label.length && this.label[0].locale) { + locale = this.label[0].locale; + } + return Manifesto.TranslationCollection.getValue(this.value, locale); } return null; }; diff --git a/package.json b/package.json index 1b02ea7..27cf347 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,7 @@ "gulp-rename": "^1.2.2", "gulp-typescript": "^2.13.4", "gulp-utils": "viewdir/gulp-utils", - "manifesto": "viewdir/manifesto#v2.0.0", + "manifesto": "viewdir/manifesto#labellocale", "merge2": "^1.0.2", "path": "^0.12.7", "require-dir": "^0.3.0", diff --git a/typings/manifesto.bundle.d.ts b/typings/manifesto.bundle.d.ts index 215895f..cca6ed5 100644 --- a/typings/manifesto.bundle.d.ts +++ b/typings/manifesto.bundle.d.ts @@ -1,4 +1,4 @@ -// manifesto.js v1.0.0 https://github.com/viewdir/manifesto +// manifesto.js v2.0.0 https://github.com/viewdir/manifesto declare module exjs { var version: string; }