- 다국어 추가 및 보조선 validation 수정

This commit is contained in:
김민식 2025-02-11 13:08:53 +09:00
parent c253cfe07e
commit 54b69b1377
5 changed files with 24 additions and 15 deletions

View File

@ -21,23 +21,34 @@ export default function AuxiliaryEdit(props) {
const currentObject = useRecoilValue(currentObjectState)
const { swalFire } = useSwal()
const handleSave = () => {
if (!horizonSize || !verticalSize || !arrow1 || !arrow2) {
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
if ((!arrow1 && !arrow2) || (+verticalSize === 0 && +horizonSize === 0)) {
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
return
}
if ((verticalSize && +verticalSize === 0) || !arrow1) {
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
return
}
if ((horizonSize && +horizonSize === 0) || !arrow2) {
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
return
}
if (type === 'copy') {
if (currentObject) {
copy(
currentObject,
arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize),
arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize),
arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0,
arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0,
)
}
} else {
move(
currentObject,
arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize),
arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize),
arrow2 ? (arrow2 === '←' ? Number(horizonSize) * -1 : Number(horizonSize)) : 0,
arrow1 ? (arrow1 === '↑' ? Number(verticalSize) * -1 : Number(verticalSize)) : 0,
)
}

View File

@ -38,12 +38,12 @@ export default function GridMove(props) {
const handleApply = () => {
if (currentObject?.direction === 'vertical') {
if (!horizonSize || !arrow2) {
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
return
}
} else {
if (!verticalSize || !arrow1) {
swalFire({ title: '길이와 방향을 입력하세요.', type: 'alert' })
swalFire({ title: getMessage('length.direction.is.required'), type: 'alert' })
}
}

View File

@ -130,11 +130,7 @@ export function useContextMenu() {
name: getMessage('contextmenu.roof.material.placement'),
component: <RoofAllocationSetting id={popupId} />,
},
{
id: 'roofMaterialRemove',
name: getMessage('contextmenu.roof.material.remove'),
fn: () => removeRoofMaterial(),
},
{
id: 'roofMaterialRemoveAll',
name: getMessage('contextmenu.roof.material.remove.all'),

View File

@ -1014,5 +1014,6 @@
"max.select": "최대 {0}개까지 선택할 수 있습니다.(JA)",
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)",
"roof.is.not.selected": "지붕을 선택해주세요.(JA)",
"module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはいを選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。"
"module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはいを選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。",
"length.direction.is.required": "길이와 방향을 입력하세요.(JA)"
}

View File

@ -1015,5 +1015,6 @@
"max.select": "최대 {0}개까지 선택할 수 있습니다.",
"module.delete.confirm": "패널을 삭제하고 면입력으로 돌아갑니다. 맞습니까?\n[예]를 선택하면 삭제하고, 면 입력으로 돌아갑니다.\n[아니오]를 선택하면 삭제하지 않고 현재 상태를 유지합니다.",
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.",
"roof.is.not.selected": "지붕을 선택해주세요."
"roof.is.not.selected": "지붕을 선택해주세요.",
"length.direction.is.required": "길이와 방향을 입력하세요."
}