From c8baaeecc4c71859256707fb51219a1e336f0fa2 Mon Sep 17 00:00:00 2001 From: joostdecock Date: Sun, 1 Oct 2023 18:38:53 +0200 Subject: [PATCH] fix(hortensia): Avoid flag/sa confusion. See #5057 fyi @woutervdub --- designs/hortensia/i18n/en.json | 10 +++++----- designs/hortensia/src/bottompanel.mjs | 6 ++++-- designs/hortensia/src/frontpanel.mjs | 6 ++++-- designs/hortensia/src/strap.mjs | 19 +++++++++---------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/designs/hortensia/i18n/en.json b/designs/hortensia/i18n/en.json index a8408612fba..154f2309166 100644 --- a/designs/hortensia/i18n/en.json +++ b/designs/hortensia/i18n/en.json @@ -13,15 +13,15 @@ }, "s": { "cutBottomPanel.t": "The bottom panel is not shown", - "cutBottomPanel.d": "The **Bottom panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). You need to cut 1 from the main fabric, and 1 from the lining fabric. \n\nThis part is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutBottomPanel.d": "The **Bottom panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long.", "cutFrontPanel.t": "The front panel is not shown", - "cutFrontPanel.d": "The **Front panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). You need to cut 2 from the main fabric, and 2 from the lining fabric. \n\nThis part is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutFrontPanel.d": "The **Front panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long.", "cutStrap.t": "The strap is not shown", - "cutStrap.d": "The **Strap** is a rectangular of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). You need to cut 2 from the main fabric. \n\nThis part is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutStrap.d": "The **Strap** is a rectangular of {{{ width }}} wide and {{{ length }}} long.", "cutStrapReducedSa.t": "The strap is not shown (and has reduced seam allowance)", - "cutStrapReducedSa.d": "The **Strap** is a rectangular of {{{ width }}} wide and {{{ length }}} long (this includes a reduced seam allowance of 80% of the strap width). You need to cut 2 from the main fabric. \n\nThis part is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutStrapReducedSa.d": "The **Strap** is a rectangular of {{{ width }}} wide and {{{ length }}} long.", "cutZipperPanel.t": "The zipper panel is not shown", - "cutZipperPanel.d": "The **Zipper panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long (this includes seam allowance). You need to cut 1 from the main fabric. \n\nThis part is not shown because the **expand** core setting is currently disabled. Enable it to show this pattern part.", + "cutZipperPanel.d": "The **Zipper panel** is a rectangular of {{{ width }}} wide and {{{ length }}} long.", "strapLength": "Length of the handles", "strapSaReduced.t": "The strap seam allowance is reduced", "strapSaReduced.d": "Because of how narrow the strap is, we have reduced the seam allowance on it to be 80% of the strap width", diff --git a/designs/hortensia/src/bottompanel.mjs b/designs/hortensia/src/bottompanel.mjs index d8b95f016b2..6a2da5323ef 100644 --- a/designs/hortensia/src/bottompanel.mjs +++ b/designs/hortensia/src/bottompanel.mjs @@ -25,11 +25,13 @@ export const bottomPanel = { store.flag.preset('expandIsOn') } else { // Expand is off, do not draw the part but flag this to the user + const extraSa = sa ? 2 * sa : 0 store.flag.note({ msg: `hortensia:cutBottomPanel`, + notes: [sa ? 'flag:saIncluded' : 'flag:saExcluded', 'flag:partHiddenByExpand'], replace: { - width: units(w + 2 * sa), - length: units(h + 2 * sa), + width: units(w + extraSa), + length: units(h + extraSa), }, suggest: { text: 'flag:show', diff --git a/designs/hortensia/src/frontpanel.mjs b/designs/hortensia/src/frontpanel.mjs index 5baa4bed5bc..c6afed4edfb 100644 --- a/designs/hortensia/src/frontpanel.mjs +++ b/designs/hortensia/src/frontpanel.mjs @@ -33,11 +33,13 @@ export const frontPanel = { store.flag.preset('expandIsOn') } else { // Expand is off, do not draw the part but flag this to the user + const extraSa = sa ? 2 * sa : 0 store.flag.note({ msg: `hortensia:cutFrontPanel`, + notes: [sa ? 'flag:saIncluded' : 'flag:saExcluded', 'flag:partHiddenByExpand'], replace: { - width: units(w + 2 * sa), - length: units(h + 2 * sa), + width: units(w + extraSa), + length: units(h + extraSa), }, suggest: { text: 'flag:show', diff --git a/designs/hortensia/src/strap.mjs b/designs/hortensia/src/strap.mjs index 5a8ca133e2d..4c13e94b62c 100644 --- a/designs/hortensia/src/strap.mjs +++ b/designs/hortensia/src/strap.mjs @@ -15,24 +15,23 @@ export const strap = { if (sa > w * 0.8) { sa = w * 0.8 reducedSa = true - - store.flag.warn({ - msg: `hortensia:strapSaReduced`, - replace: { - width: units(w + 2 * sa), - length: units(h + 2 * sa), - }, - }) + store.flag.warn({ msg: `hortensia:strapSaReduced` }) } if (expand) store.flag.preset('expandIsOn') else { // Expand is on, do not draw the part but flag this to the user + const extraSa = sa ? 2 * sa : 0 store.flag.note({ msg: reducedSa ? `hortensia:cutStrapReducedSa` : `hortensia:cutStrap`, + notes: [ + sa ? 'flag:saIncluded' : 'flag:saExcluded', + 'flag:partHiddenByExpand', + reducedSa ? `hortensia:strapSaReduced.d` : '', + ], replace: { - width: units(w + 2 * sa), - length: units(h + 2 * sa), + width: units(w + extraSa), + length: units(h + extraSa), }, suggest: { text: 'flag:show',