1
0
Fork 0

Fix string translations in multiple views and SVG export and theming in SVG draft view (#244)

Fixes #227
Fixes #78

Reviewed-on: https://codeberg.org/freesewing/freesewing/pulls/244
Reviewed-by: Joost De Cock <joostdecock@noreply.codeberg.org>
Co-authored-by: Jonathan Haas <haasjona@gmail.com>
Co-committed-by: Jonathan Haas <haasjona@gmail.com>
This commit is contained in:
Jonathan Haas 2025-04-13 08:59:27 +00:00 committed by Joost De Cock
parent 04a0b4b099
commit a9f5ba5392
6 changed files with 29 additions and 8 deletions

View file

@ -52,9 +52,10 @@ export const bundlePatternTranslations = (design) => {
* @param {array} plugins - Any (extra) plugins to load into the pattern
* @return {object} data - The drafted pattern, along with errors and failure data
*/
export function draft(Design, settings, plugins = []) {
export function draft(Design, settings, plugins = [], pluginsHook = false) {
const pattern = new Design(settings)
for (const plugin of plugins) pattern.use(plugin)
if (pluginsHook) pluginsHook(pattern)
const data = {
// The pattern
pattern,

View file

@ -36,7 +36,7 @@ const themedPattern = (Design, settings, overwrite, format, t) => {
// add the theme and translation to the pattern
pattern.use(themePlugin, { stripped: format !== 'svg', skipGrid: ['pages'] })
pattern.use(pluginI18n, (key) => key)
pattern.use(pluginI18n, t)
return pattern
}