fix(react): PDF cover page improvements (#360)
Exported PDF cover page improvements: 1. Translates flags, instead of just printing the bare keys 2. Omit layout info, when the parts are moved around in pattern layout Fixes #274 Fixes #350 Co-authored-by: Benjamin Fan <ben-git@swinglonga.com> Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/360 Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org> Co-authored-by: Benjamin Fan <benjamesben@noreply.codeberg.org> Co-committed-by: Benjamin Fan <benjamesben@noreply.codeberg.org>
This commit is contained in:
parent
a3fe0cd477
commit
3799e039ae
1 changed files with 5 additions and 3 deletions
|
@ -158,7 +158,9 @@ export const handleExport = async ({
|
|||
workerArgs.strings.setName = settings?.metadata?.setName
|
||||
? settings.metadata.setName
|
||||
: 'ephemeral'
|
||||
workerArgs.strings.yaml = yaml.dump(settings)
|
||||
const settingsWithoutLayout = structuredClone(settings)
|
||||
delete settingsWithoutLayout.layout
|
||||
workerArgs.strings.yaml = yaml.dump(settingsWithoutLayout)
|
||||
workerArgs.strings.version = store?.data?.version ? store.data.version : ''
|
||||
const notes = store?.plugins?.['plugin-annotations']?.flags?.note
|
||||
? store?.plugins?.['plugin-annotations']?.flags?.note
|
||||
|
@ -190,9 +192,9 @@ const flagsToString = (flags, mustache, t) => {
|
|||
let first = true
|
||||
let string = ''
|
||||
for (const flag of Object.values(flags)) {
|
||||
let title = flag.replace ? mustache.render(flag.title, flag.replace) : flag.title
|
||||
let title = flag.replace ? mustache.render(t(flag.title), flag.replace) : t(flag.title)
|
||||
title = he.decode(title)
|
||||
let desc = flag.replace ? mustache.render(flag.desc, flag.replace) : flag.desc
|
||||
let desc = flag.replace ? mustache.render(t(flag.desc), flag.replace) : t(flag.desc)
|
||||
desc = desc.replaceAll('\n\n', '\n')
|
||||
desc = desc.replaceAll('\n', ' ')
|
||||
desc = he.decode(desc)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue