diff --git a/packages/freesewing.shared/components/workbench/draft/error.js b/packages/freesewing.shared/components/workbench/draft/error.js
index ff05f20ea30..43fc2e2f316 100644
--- a/packages/freesewing.shared/components/workbench/draft/error.js
+++ b/packages/freesewing.shared/components/workbench/draft/error.js
@@ -1,15 +1,21 @@
import Robot from 'shared/components/robot/index.js'
import Events from './events.js'
+import { useTranslation } from 'next-i18next'
-const Error = props => (
-
-
-
{props.app.t('errors.something')}
-
+const Error = props => {
+ const { t } = useTranslation(['errors'])
+
+ return (
+
+
+
{t('errors:something')}
+
+
+
-
-
-)
+ )
+}
+
export default Error
diff --git a/packages/freesewing.shared/components/workbench/draft/text-on-path/index.js b/packages/freesewing.shared/components/workbench/draft/text-on-path/index.js
index 29eb91d25c0..9714cfb95b5 100644
--- a/packages/freesewing.shared/components/workbench/draft/text-on-path/index.js
+++ b/packages/freesewing.shared/components/workbench/draft/text-on-path/index.js
@@ -1,9 +1,12 @@
+import { useTranslation } from 'next-i18next'
+
const TextOnPath = (props) => {
+ const { t } = useTranslation(['app'])
const text = []
// Handle translation (and spaces)
let translated = ''
for (let string of props.path.attributes.getAsArray('data-text')) {
- translated += props.app.t(string, false, props.locale).replace(/"/g, '"') + ' '
+ translated += t(string).replace(/"/g, '"') + ' '
}
const textPathProps = {
xlinkHref: '#' + props.pathId,
diff --git a/packages/freesewing.shared/components/workbench/draft/text/index.js b/packages/freesewing.shared/components/workbench/draft/text/index.js
index c75044569c1..7671e38e2b1 100644
--- a/packages/freesewing.shared/components/workbench/draft/text/index.js
+++ b/packages/freesewing.shared/components/workbench/draft/text/index.js
@@ -1,9 +1,12 @@
+import { useTranslation } from 'next-i18next'
+
const Text = (props) => {
+ const { t } = useTranslation(['app'])
let text = []
// Handle translation
let translated = ''
for (let string of props.point.attributes.getAsArray('data-text')) {
- translated += props.app.t(string.toString(), false, props.locale).replace(/"/g, '"') + ' '
+ translated += t(string.toString()).replace(/"/g, '"') + ' '
}
// Handle muti-line text
if (translated.indexOf('\n') !== -1) {
diff --git a/packages/freesewing.shared/components/workbench/inputs/design-option-count.js b/packages/freesewing.shared/components/workbench/inputs/design-option-count.js
index d69c2693307..20bb961ec3a 100644
--- a/packages/freesewing.shared/components/workbench/inputs/design-option-count.js
+++ b/packages/freesewing.shared/components/workbench/inputs/design-option-count.js
@@ -1,6 +1,7 @@
import { useState } from 'react'
import ClearIcon from 'shared/components/icons/clear.js'
import EditIcon from 'shared/components/icons/edit.js'
+import { useTranslation } from 'next-i18next'
const EditCount = props => (
@@ -25,6 +26,7 @@ const EditCount = props => (
const DesignOptionCount = props => {
+ const { t } = useTranslation(['app'])
const { count, max, min } = props.pattern.config.options[props.option]
const val = (typeof props.gist?.options?.[props.option] === 'undefined')
? count
@@ -53,7 +55,7 @@ const DesignOptionCount = props => {
min={min}
max={max}
setEditCount={setEditCount}
- t={props.app.t}
+ t={t}
/>
: (
<>
@@ -84,7 +86,7 @@ const DesignOptionCount = props => {
))}