Files
Aislo/M01_MasterData/M01_MasterData_UI_Logic_Text.ts
T
eomsangdonandClaude Opus 5.5 0541830750 fix(공용): 모달 위 고정 · 보이는 글 「더하기」 → 「추가」(30-1)
- 공용 .ui-modal: 세로 가운데 대신 최대 높이 기준 가운데 자리에 윗변 고정 · 아래로만 늘고 줆(찾기 칸이 안 움직임) · 큰 창은 --modal-max(고르기 모달 94vh · 노선 추천 92vh · M01 복사 시트 90vh) · M02 단추 아래 작은 창은 margin-top 0
- 따로 둔 모달도 같게: B01 대시보드 모달 · M01 로직 고르기(m01-logic) · M01 조달 찾기
- 가운데 그대로: 불러오는 중 가림 · 공용 확인 창 · B03 확인 창 · B05 노선 편집(고정 높이) · 스프레드시트 메모 편집
- 「더하기」 → 「추가」 25곳(스프레드시트 · M01 · M02 · 공용 표 · locale) · 안쪽 명령 이름 시트더하기 · 주석은 그대로
- 시험 test_modal_top_and_add_word 새로

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ly2oHAaTDYRjcniAmHR81z
2026-09-30 18:56:43 +09:00

183 lines
8.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/* =============================================================================
* M01_MasterData_UI_Logic_Text.ts
* 로직 화면 글자 — [한국어, 영어] · 공용 사전과 같은 모양 · 창끼리 공용 사전 줄이 겹치지 않게 따로 둠
* ========================================================================== */
import { currentLanguageIndex } from "@ui/ui_template_locale";
const TEXT = {
Title: ["단가산출 로직", "Unit-price logic"],
List_Search: ["이름 찾기", "Search name"],
List_AllBooks: ["원문 모두", "All sources"],
List_AllChapters: ["장 모두", "All chapters"],
List_BlockedOnly: ["막힘만", "Blocked only"],
List_Count: ["{n} 개", "{n} items"],
List_Blocked: ["막힘", "Blocked"],
List_Edited: ["고침", "Edited"],
List_New: ["새것", "New"],
List_Deleted: ["지움", "Deleted"],
Bar_Back: ["← 로직 목록", "← Logics"],
Bar_Delete: ["로직 지우기", "Delete logic"],
Bar_Save: ["저장", "Save"],
Bar_Discard: ["고친 것 버리기", "Discard edits"],
Bar_Pending: ["저장 안 한 로직 {n} 개", "{n} unsaved logics"],
Head_File: ["파일", "File"],
Head_Key: ["키", "Key"],
Head_Number: ["원문번호", "Source no."],
Head_Name: ["이름", "Name"],
Head_Unit: ["결과 단위", "Result unit"],
Head_Source: ["출처", "Source"],
Head_Owner: ["소유", "Owner"],
Head_Note: ["비고", "Note"],
Head_Blocked: ["막힌 까닭", "Why blocked"],
Inputs_Title: ["설계에서 받을 값", "Values from design"],
Inputs_Unit: ["단위", "Unit"],
Inputs_Choices: ["고르기(쉼표로)", "Choices (comma)"],
Inputs_Range: ["범위", "Range"],
Ho_Title: ["호표", "Unit-cost lines"],
Ho_Kind: ["종류", "Kind"],
Ho_Element: ["요소", "Element"],
Ho_Name: ["이름·규격", "Name · spec"],
Ho_Unit: ["단위", "Unit"],
Ho_Qty: ["수량", "Qty"],
Ho_Price: ["단가", "Unit price"],
Ho_Amount: ["금액", "Amount"],
Ho_Cost: ["비목", "Cost item"],
Ho_Pick: ["찾기", "Find"],
Ho_PickTable: ["표", "Table"],
Ho_QtyNumber: ["수", "Number"],
Ho_QtyTable: ["표 찾기", "Table lookup"],
Ho_QtyFormula: ["식", "Formula"],
Ho_PriceLater: ["계산 때", "At calc"],
Ho_Missing: ["없는 요소", "Missing element"],
Middle_Title: ["중간 값", "Intermediate values"],
Result_Title: ["결과 식(돈 아닌 로직)", "Result formula (non-money)"],
Extra_Title: ["덧줄", "Extra lines"],
Rounding: ["끝수", "Rounding"],
Formula: ["식", "Formula"],
AddRow: ["줄 추가", "Add line"],
DeleteRow: ["줄 지우기", "Delete line"],
Calc_Title: ["시험 계산", "Test calculation"],
Calc_Run: ["계산", "Calculate"],
Calc_NoInputs: ["받을 값 없음", "No inputs"],
Calc_Draft: ["고친 줄로 계산(저장 전)", "Using unsaved edits"],
Calc_Stopped: ["멈춤", "Stopped"],
Calc_Result: ["결과", "Result"],
Calc_Sum: ["계", "Total"],
Pick_Title: ["요소 찾기", "Find element"],
Pick_Search: ["이름·키·원문번호", "Name · key · source no."],
Pick_Total: ["{n} 개 중 앞 100 개", "first 100 of {n}"],
Pick_Item: ["품목 고르기", "Pick item"],
Pick_Machine: ["기계 고르기", "Pick machine"],
Pick_MatTitle: ["자재품목 고르기", "Pick a material item"],
Pick_Chosen: ["고름", "Picked"],
Calc_UnitWarn: ["단위 다름", "Unit differs"],
Pick_Close: ["닫기", "Close"],
Pick_All: ["(전체)", "(All)"],
Mat_Title: ["쓰이는 재료·기계", "Materials and machines"],
Mat_None: ["이 공종은 재료·기계를 따로 고르지 않습니다", "No materials or machines to pick"],
Mat_Default: ["기본 (원문 그대로)", "Default (as in source)"],
Mat_Price: ["단가", "Unit price"],
Mat_NoPrice: ["단가 없음", "No price"],
Enter_Value: ["값을 넣어 주세요", "Enter a value"],
Save_Done: ["저장했음", "Saved"],
Save_Stale: [
"그 사이 파일이 바뀜 — 고친 것을 버리고 다시 여세요: {v}",
"Files changed meanwhile — discard and reopen: {v}",
],
Save_Errors: ["검사에 걸려 저장 안 함", "Check failed — nothing saved"],
Save_Failed: ["저장 못 함", "Save failed"],
Save_Nothing: ["고친 것 없음", "Nothing to save"],
Load_Failed: ["불러오지 못함", "Load failed"],
Lab_Title: ["단가산출 로직", "Unit-price logic"],
Loading: ["불러오는 중", "Loading"],
Confirm_Delete: [
"로직 「{v}」 을 지울까요? [저장] 때 파일에서 빠짐",
"Delete logic “{v}”? Removed on save",
],
Confirm_Discard: ["고친 것을 모두 버릴까요?", "Discard all edits?"],
Confirm_Leave: [
"저장 안 한 로직이 있음 — 다른 로직을 열어도 고친 것은 남음",
"Unsaved logics stay in the draft",
],
New_Key: ["새 로직", "New logic"],
/* ── 흐름 그림(기본 보기) ── */
Flow_NoInputs: ["받을 값 없음", "No inputs"],
Flow_Other: ["그 밖", "Other"],
Flow_Sub: ["이 로직이 부르는 로직", "Logic called here"],
Flow_SubLines: ["호표", "Unit-cost lines"],
Col_입력: ["설계 값", "Design values"],
Col_중간: ["표 찾기", "Table lookup"],
Col_수량: ["수량", "Qty"],
Col_단가: ["× 단가", "× Unit price"],
Col_덧줄: ["할증·덧줄", "Extra lines"],
Col_비목: ["비목 합계", "Cost items"],
Col_계: ["계", "Total"],
/* ── 상자 속 설명 카드 ── */
Note_Plain: ["쉬운 말 풀이", "In plain words"],
Note_Table: ["원문 표 미리보기", "Source table"],
Note_TableMissing: ["{v} 표 못 찾음", "Table {v} not found"],
Note_Searching: ["찾는 중", "Looking up"],
Note_Formula: ["고급 — 식 그대로", "Advanced — raw formula"],
Note_ThisLine: ["이 줄", "This line"],
Use_Of: ["이 표의 용도", "Used for"],
/* ── 상자에서 고치기 ── */
Edit_On: ["고치기", "Edit"],
Edit_Off: ["고치기 끝", "Done"],
Edit_AddHo: ["호표 줄 추가", "Add unit-cost line"],
Edit_AddInput: ["설계 값 추가", "Add design value"],
Edit_AddMiddle: ["표 찾기 추가", "Add table lookup"],
Edit_AddExtra: ["덧줄 추가", "Add extra line"],
Edit_Qty: ["수량 식", "Qty formula"],
/* ── 멈춘 까닭을 설계자 말로 ── */
Stop_Missing: [
"「{name}」 값을 아직 안 넣었습니다 — 값을 넣으면 계산됩니다",
"「{name}」 is empty — enter it to calculate",
],
Stop_NoRow: [
"넣은 값에 맞는 표 줄이 없습니다 — 값을 바꿔 보세요",
"No table row fits these values — try other values",
],
Stop_Spec: [
"「{name}」 규격이 여럿이라 정하지 못함 — 위 「쓰이는 재료·기계」에서 하나를 골라 주세요",
"「{name}」 has several specs — pick one in the materials list above",
],
Stop_Generic: [
"이 조건으로는 셈하지 못함 — 입력값 · 표에 그 조합이 있는지 확인",
"Cannot be calculated with these inputs — check the values and the table",
],
Stop_NoPrice: [
"「{name}」 단가가 자료에 비어 있어 셈하지 못함 — 자료를 채워야 함",
"「{name}」 has no price in the data yet",
],
} as const satisfies Record<string, readonly [string, string]>;
export type TextKey = keyof typeof TEXT;
/** 엔진이 멈춘 까닭을 설계자 말로 — 모르는 글은 그대로 */
export function plainReason(reason: string): string {
const missing = /입력 「([^」]+)」 없음/.exec(reason);
if (missing) return tx("Stop_Missing", { name: missing[1] });
if (/맞는 줄 0개/.test(reason)) return tx("Stop_NoRow");
const spec = /「([^」]+)」 후보 여럿/.exec(reason);
if (spec) return tx("Stop_Spec", { name: spec[1] });
const noPrice = /「([^」]+)」 값 없음/.exec(reason);
if (noPrice) return tx("Stop_NoPrice", { name: noPrice[1] });
return reason;
}
/** 화면에 찍는 까닭의 마지막 방어 — 중괄호 · 따옴표 · Decimal( 이 섞인 날글은 사람 말 한 줄로 */
export function safeReason(reason: string): string {
const plain = plainReason(reason);
return /[{}"']|Decimal\(/.test(plain) ? tx("Stop_Generic") : plain;
}
/** 흐름 그림 머리 「이렇게 씀」 — 줄 목록 */
/** 공용 `t()` 와 같은 뜻 — `{n}`·`{v}` 는 채움 */
export function tx(key: TextKey, fill: Record<string, string | number> = {}): string {
const entry = TEXT[key];
const text: string = entry[currentLanguageIndex as 0 | 1] ?? entry[0];
return text.replace(/\{(\w+)\}/g, (m, k: string) => (k in fill ? String(fill[k]) : m));
}