From e3014839884f60f8623092edbc519e705923aade Mon Sep 17 00:00:00 2001 From: Joost De Cock Date: Sun, 8 Mar 2020 11:10:38 +0100 Subject: [PATCH] feat(plugin-title): Added name of person to title output --- config/changelog.yaml | 2 ++ packages/i18n/src/locales/en/app.yaml | 9 ++++++++- packages/plugin-title/src/index.js | 8 ++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/config/changelog.yaml b/config/changelog.yaml index 95fe014be0d..637fe3cfe76 100644 --- a/config/changelog.yaml +++ b/config/changelog.yaml @@ -2,6 +2,8 @@ Unreleased: date: Added: Changed: + plugin-title: + Added *for* to title output Deprecated: Fixed: Removed: diff --git a/packages/i18n/src/locales/en/app.yaml b/packages/i18n/src/locales/en/app.yaml index 87789f566be..fb90090e9c1 100644 --- a/packages/i18n/src/locales/en/app.yaml +++ b/packages/i18n/src/locales/en/app.yaml @@ -294,10 +294,17 @@ cloneDescription: Recreate an exact copy, using the measurements of the original furtherReading: Further reading saveAsNewPattern: Save As New Pattern -saveAsNewPattern-txt: Copy this pattern and store it in your FreeSewing account +saveAsNewPattern-txt: Store (a copy of) this pattern in your FreeSewing account exportPattern: Export pattern printPattern: Print pattern exportPattern-txt: Export a PDF suitable for your printer, or download this pattern in a variety of formats editThing: 'Edit {thing}' editPattern-txt: Load this pattern in the pattern editor featureRequiresAccount: This feature requires a FreeSewing account +zoom: Zoom +zoom-txt: Switches between constraining the height or the width of the pattern to fit on your screen +savePattern-txt: Store this pattern in your FreeSewing account +comparePattern: Compare pattern +comparePattern-txt: Compare your pattern to a range a standard sizes to review possible fitting issues +recreatePattern: Recreate pattern +recreatePattern-txt: Choose a different person, then recreate this pattern for that person diff --git a/packages/plugin-title/src/index.js b/packages/plugin-title/src/index.js index 85963182a2d..a6cbe198ab2 100644 --- a/packages/plugin-title/src/index.js +++ b/packages/plugin-title/src/index.js @@ -49,6 +49,14 @@ export default { .attr('data-text', 'v' + this.context.config.version) .attr('data-text-class', 'title-pattern fill-note') .attr('data-text-transform', transform(so.at.shift(-90 - so.rotation, shift * so.scale))) + if (this.context.settings.metadata && this.context.settings.metadata.for) { + shift += 8 + this.points[`_${prefix}_titleFor`] = so.at + .shift(-90 - so.rotation, shift * so.scale) + .attr('data-text', '( ' + this.context.settings.metadata.for + ' )') + .attr('data-text-class', 'title-pattern') + .attr('data-text-transform', transform(so.at.shift(-90 - so.rotation, shift * so.scale))) + } } } }