refactor(861-2): 영어 글 걷기 ⓕ — currentLanguageIndex · 시험 흉내 · 설명서 찍기 도구의 언어 값 걷음
- `ui_template_locale` 의 `currentLanguageIndex`(늘 0) 지움 — 부르는 곳 0 - 시험 도우미 · 시험 18 곳의 `currentLanguageIndex` 흉내 걷음(Proxy 갈래 · 줄) - A05 설명서 찍기 도구가 심던 `localStorage.frd_lang='ko'` 걷음(읽는 곳 없음) - 머리 주석 「[한, 영] 짝 · [국문, 영문]」 다섯 곳 정리 - typecheck 0 · 관련 시험 497 통과 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* =============================================================================
|
||||
* formula_doc_text.ts
|
||||
* 수식 문서 화면 글(PLAN 802-3 · 803-2a) — [국문, 영문]
|
||||
* 수식 문서 화면 글(PLAN 802-3 · 803-2a)
|
||||
* ========================================================================== */
|
||||
|
||||
const TEXT = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/* =============================================================================
|
||||
* line_stack_text.ts
|
||||
* 줄 쌓기 화면 글(PLAN 804-2) — [국문, 영문] · 수식 탭과 같은 글은 `formula_doc_text.ts`
|
||||
* 줄 쌓기 화면 글(PLAN 804-2) — 수식 탭과 같은 글은 `formula_doc_text.ts`
|
||||
* ========================================================================== */
|
||||
|
||||
const TEXT = {
|
||||
|
||||
@@ -112,7 +112,7 @@ OPTIONAL_MS = 3000 # optional 단계 · 요소를 기다리는 시간
|
||||
SETTLE_MS = 500
|
||||
CLIP_PAD = 16
|
||||
ACCOUNTS_FILE = ROOT / "tmp" / "verify_accounts.json"
|
||||
THEME_KEY, LANG_KEY, PROJECT_KEY = "frd_theme", "frd_lang", "frd_current_project_id"
|
||||
THEME_KEY, PROJECT_KEY = "frd_theme", "frd_current_project_id"
|
||||
CALLOUT_CLASS = "__guide_callout"
|
||||
SEEDED = "__guide_seeded" # 탭 이름(window.name)에 남겨 첫 적재를 가림
|
||||
YELLOW = "#FFD400"
|
||||
@@ -341,9 +341,9 @@ def shoot_scene(
|
||||
page = context.new_page()
|
||||
try:
|
||||
page.set_viewport_size({"width": vw, "height": vh})
|
||||
seed = json.dumps([THEME_KEY, LANG_KEY, PROJECT_KEY, pid])
|
||||
seed = json.dumps([THEME_KEY, PROJECT_KEY, pid])
|
||||
page.add_init_script(
|
||||
f"(([t, l, k, pid]) => {{ localStorage.setItem(t, 'light'); localStorage.setItem(l, 'ko');"
|
||||
f"(([t, k, pid]) => {{ localStorage.setItem(t, 'light');"
|
||||
f" pid ? localStorage.setItem(k, pid) : localStorage.removeItem(k);"
|
||||
# 첫 적재만 비움 — 장면 안 새로고침 · 이동은 그 장면 조작을 지킴
|
||||
f" if (!window.name.includes('{SEEDED}')) {{ sessionStorage.clear();"
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* 일위대가 조합 다이어그램(PLAN 37) — 왼쪽 로직별 넣을 값 묶음 → 가운데 로직 카드 → 오른쪽 비용 구분 칸(노무비 · 재료비 · 경비 · 값)
|
||||
* 다이어그램은 계산하지 않음 — 일위대가 calc 답을 로직마다 · 비용 구분마다 보여 주기만(고치기 없음 · 흐름도와 다른 모양 · 색)
|
||||
* 값 = 저장된 줄 입력값 + calc 답(수량 있으면 반영 · 없으면 기준 · 카드에 표기 · `buildLaborDiagram` · 39-3) ·
|
||||
* 자재목록은 카드 하나로 재료비 칸에 이음 · 글 [한, 영] 짝은 아래 TEXT
|
||||
* 자재목록은 카드 하나로 재료비 칸에 이음 · 글은 아래 TEXT
|
||||
* ========================================================================== */
|
||||
|
||||
import { wheelZoomsIn } from "../A00_Common/touch_bridge";
|
||||
|
||||
@@ -147,7 +147,6 @@ const STUBS = {
|
||||
},
|
||||
},
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_, key) => String(key) }),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -97,7 +97,6 @@ const { loadTs } = makeLoader({
|
||||
return loadTs(path.join(UI, "ui_template_collapsible.ts"));
|
||||
if (request === "@ui/ui_template_locale")
|
||||
return {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_, key) => String(key) }),
|
||||
};
|
||||
if (request.endsWith(".css")) return {}; // 부품 CSS(552-3) — 트랜스파일 안 함
|
||||
|
||||
@@ -10,7 +10,6 @@ const ROOT = path.join(__dirname, "..", "..");
|
||||
const calls = { regenerate: [], overlay: 0 };
|
||||
const STUBS = {
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: () => "" }),
|
||||
},
|
||||
"@ui/ui_template_elements": {
|
||||
|
||||
@@ -43,7 +43,7 @@ function load(file) {
|
||||
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
||||
}).outputText;
|
||||
const req = (request) => {
|
||||
if (request === "@ui/ui_template_locale") return { ui_locales: {}, currentLanguageIndex: 0 };
|
||||
if (request === "@ui/ui_template_locale") return { ui_locales: {} };
|
||||
if (!request.startsWith(".")) return anything();
|
||||
const target = path.resolve(path.dirname(file), request);
|
||||
const full = fs.existsSync(`${target}.ts`) ? `${target}.ts` : target;
|
||||
|
||||
@@ -171,7 +171,6 @@ const STUBS = {
|
||||
},
|
||||
},
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_, key) => String(key) }),
|
||||
},
|
||||
"./B07_DesignDetail_UI_PlanManage": {
|
||||
|
||||
@@ -123,7 +123,7 @@ const common = {
|
||||
showConfirmDialog: async () => (calls.push("confirm"), confirmAnswer),
|
||||
},
|
||||
"@ui/ui_template_collapsible": { attachCollapsible() {}, createPanelCard: () => new Node() },
|
||||
"@ui/ui_template_locale": { ui_locales: any(), currentLanguageIndex: 0 },
|
||||
"@ui/ui_template_locale": { ui_locales: any() },
|
||||
"@config/config_frontend": { CURRENT_PROJECT_ID_KEY: "pid", API_BASE_URL: "/api" },
|
||||
"../A00_Common/b_page_scaffold": { workflowSteps: () => [] },
|
||||
"../A00_Common/b_workflow_nav": {
|
||||
|
||||
@@ -122,7 +122,6 @@ const STUBS = {
|
||||
"@ui/ui_template_modal": { askConfirm: async () => true },
|
||||
"@ui/ui_template_locale": {
|
||||
ui_locales: new Proxy({}, { get: (_, k) => String(k) }),
|
||||
currentLanguageIndex: 0,
|
||||
},
|
||||
"@ui/ui_template_elements": {
|
||||
...parts.elements,
|
||||
|
||||
@@ -330,7 +330,6 @@ const out = {};
|
||||
"@config/config_frontend": { PIPE_TYPES: [] },
|
||||
"../B05_Profile/B05_Profile_UI_IrregularStations": { PIPE_DISPLAY_NAME: {} },
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_t, key) => String(key) }),
|
||||
},
|
||||
},
|
||||
@@ -451,7 +450,6 @@ const out = {};
|
||||
const loadUi = makeLoader([...parts, "ui_template_elements_base"].map(UI));
|
||||
const load = makeLoader([B06("B06_Section_UI_Cross_Design")], {
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_t, key) => String(key) }),
|
||||
},
|
||||
...Object.fromEntries(parts.map((name) => [`@ui/${name}`, loadUi(UI(name))])),
|
||||
|
||||
@@ -99,7 +99,6 @@ const stubs = {
|
||||
"@config/config_frontend": { API_BASE_URL: "/api" },
|
||||
"@ui/ui_template_progress": { createProgressCircle: () => ({ root: el("progress") }) },
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_target, key) => key }),
|
||||
},
|
||||
"../A00_Common/b_page_state": {
|
||||
|
||||
@@ -15,7 +15,6 @@ const STUBS = {
|
||||
showToast: (message, kind) => calls.push(["toast", kind]),
|
||||
},
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_, key) => String(key) }),
|
||||
},
|
||||
B05_Profile_Api_Fetch: {
|
||||
|
||||
@@ -11,7 +11,6 @@ const calls = { regenerate: [], overlay: 0, asked: [] };
|
||||
let answer = false;
|
||||
const STUBS = {
|
||||
"@ui/ui_template_locale": {
|
||||
currentLanguageIndex: 0,
|
||||
ui_locales: new Proxy({}, { get: (_t, key) => `${String(key)} {width}/{sampled}` }),
|
||||
},
|
||||
"@ui/ui_template_elements": {
|
||||
|
||||
@@ -28,7 +28,7 @@ const STUBS = { "/design_leave": { designSignature: () => "", markDesignClean: (
|
||||
const { load } = makeLoader({
|
||||
root: ROOT,
|
||||
stubs: STUBS,
|
||||
ui: () => ({ ui_locales: {}, currentLanguageIndex: 0, t: (key) => key }),
|
||||
ui: () => ({ ui_locales: {}, t: (key) => key }),
|
||||
});
|
||||
|
||||
let calls = [];
|
||||
|
||||
@@ -52,7 +52,7 @@ function load(file) {
|
||||
const req = (request) => {
|
||||
const stub = STUBS[path.basename(request)];
|
||||
if (stub) return stub;
|
||||
if (request === "@ui/ui_template_locale") return { ui_locales: {}, currentLanguageIndex: 0 };
|
||||
if (request === "@ui/ui_template_locale") return { ui_locales: {} };
|
||||
if (!request.startsWith(".")) return anything();
|
||||
const target = path.resolve(path.dirname(file), request);
|
||||
const full = fs.existsSync(`${target}.ts`) ? `${target}.ts` : target;
|
||||
|
||||
@@ -111,7 +111,7 @@ const common = {
|
||||
hideLoadingOverlay() {},
|
||||
showConfirmDialog: async () => false,
|
||||
},
|
||||
"@ui/ui_template_locale": { ui_locales: any(), currentLanguageIndex: 0 },
|
||||
"@ui/ui_template_locale": { ui_locales: any() },
|
||||
"@config/config_frontend": { CURRENT_PROJECT_ID_KEY: "pid", API_BASE_URL: "/api" },
|
||||
"../A00_Common/b_page_scaffold": { workflowSteps: () => [] },
|
||||
"../A00_Common/b_workflow_nav": {
|
||||
|
||||
@@ -114,7 +114,7 @@ const ui = {
|
||||
ui_template_text: { createText: (text) => box("span", {}, text) },
|
||||
ui_template_checkbox: { createCheckbox: () => ({ root: box("label") }) },
|
||||
ui_template_card: { createCard: () => box("div") },
|
||||
ui_template_locale: { t: (k) => k, currentLanguageIndex: 0 },
|
||||
ui_template_locale: { t: (k) => k },
|
||||
ui_template_modal: {
|
||||
openModal: (o) => {
|
||||
const body = box("div", { "data-modal": o.title });
|
||||
|
||||
@@ -46,7 +46,6 @@ const UI = {
|
||||
createButton: (o) => ({ ...fakeEl(), disabled: false, click: () => o.onClick() }),
|
||||
showLoading: () => () => {},
|
||||
loadingError: () => fakeEl(),
|
||||
currentLanguageIndex: () => 0,
|
||||
askConfirm: async () => true,
|
||||
openModal: (m) => {
|
||||
modal = m;
|
||||
|
||||
@@ -125,7 +125,7 @@ const LOCALES = {
|
||||
Design_Busy: "계산 중", // 「계산 중」 점(386-2)
|
||||
};
|
||||
const STUBS = {
|
||||
"@ui/ui_template_locale": { ui_locales: LOCALES, currentLanguageIndex: 0 },
|
||||
"@ui/ui_template_locale": { ui_locales: LOCALES },
|
||||
"@ui/ui_template_collapsible": { attachCollapsible: () => undefined },
|
||||
"@ui/ui_template_elements": {
|
||||
createButton: ({ label, variant, onClick }) => {
|
||||
|
||||
@@ -8,7 +8,7 @@ const ROOT = path.join(__dirname, "..", "..");
|
||||
const el = (tag, o = {}) => ({ tag, ...o, children: o.children ?? [] });
|
||||
const STUBS = {
|
||||
"@ui/ui_template_elements": { el, createSelectField: () => ({ root: el("select") }) },
|
||||
"@ui/ui_template_locale": { currentLanguageIndex: 0 },
|
||||
"@ui/ui_template_locale": {},
|
||||
"@config/config_frontend": { API_BASE_URL: "/api" },
|
||||
};
|
||||
const { loadTs } = makeLoader({
|
||||
|
||||
@@ -8,7 +8,7 @@ const { makeLoader } = require("./helper_ts_stub_loader.cjs");
|
||||
|
||||
const ROOT = path.join(__dirname, "..", "..");
|
||||
const STUBS = { "@config/config_frontend": { API_BASE_URL: "/api" } };
|
||||
const stub = new Proxy({}, { get: (_t, k) => (k === "currentLanguageIndex" ? () => 0 : () => {}) });
|
||||
const stub = new Proxy({}, { get: () => () => {} });
|
||||
const { loadTs } = makeLoader({
|
||||
root: ROOT,
|
||||
requireFor: (full) => (request) => {
|
||||
|
||||
@@ -43,7 +43,6 @@ def _ts(sg, machines):
|
||||
]
|
||||
src = "".join(IMPORTS.sub("", (ROOT / f).read_text("utf-8")) for f in files)
|
||||
body = (
|
||||
"\nconst currentLanguageIndex = 0;"
|
||||
f"\nconst sg = {json.dumps(sg, ensure_ascii=False)};"
|
||||
f"\nconst machines = {json.dumps(machines, ensure_ascii=False)};"
|
||||
"\nconst noOf = Object.fromEntries(sg.map((b) => [b.key, b.no]));"
|
||||
|
||||
@@ -19,7 +19,7 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const [root, file] = process.argv.slice(1);
|
||||
const ts = require(path.join(root, "config", "node_modules", "typescript"));
|
||||
const stub = new Proxy({}, { get: (_t, k) => (k === "currentLanguageIndex" ? 0 : () => undefined) });
|
||||
const stub = new Proxy({}, { get: () => () => undefined });
|
||||
const cache = {};
|
||||
function load(f) {
|
||||
if (cache[f]) return cache[f].exports;
|
||||
|
||||
@@ -104,7 +104,7 @@ const fs = require("fs");
|
||||
const path = require("path");
|
||||
const root = process.argv[1];
|
||||
const ts = require(path.join(root, "config", "node_modules", "typescript"));
|
||||
const stub = new Proxy({}, { get: (_t, k) => (k === "currentLanguageIndex" ? 0 : () => undefined) });
|
||||
const stub = new Proxy({}, { get: () => () => undefined });
|
||||
const f = path.join(root, "M02_MasterTemplete", "M02_MasterTemplete_Labor_Input.ts");
|
||||
const js = ts.transpileModule(fs.readFileSync(f, "utf8"), {
|
||||
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
|
||||
|
||||
@@ -137,7 +137,7 @@ const path = require("path");
|
||||
const root = process.argv[1];
|
||||
const ts = require(path.join(root, "config", "node_modules", "typescript"));
|
||||
const stub = new Proxy({}, {
|
||||
get: (_t, k) => (k === "currentLanguageIndex" ? 0 : () => undefined),
|
||||
get: () => () => undefined,
|
||||
});
|
||||
function load(f) {
|
||||
const js = ts.transpileModule(fs.readFileSync(f, "utf8"), {
|
||||
|
||||
@@ -41,9 +41,6 @@ import { ui_locales_e05 } from "./ui_template_locale_e05";
|
||||
import { ui_locales_e06 } from "./ui_template_locale_e06";
|
||||
import { ui_locales_e07 } from "./ui_template_locale_e07";
|
||||
|
||||
/** 글 칸 번호 — 늘 0(한국어). 부르는 쪽 꼴(`[currentLanguageIndex]`)을 그대로 두려고 남김 · 타입은 number. */
|
||||
export const currentLanguageIndex: number = 0;
|
||||
|
||||
/** 한국어 문자열 반환. 키 누락 시 키 자체를 반환(개발 중 탐지용). */
|
||||
export function t(key: keyof typeof ui_locales): string {
|
||||
return ui_locales[key] ?? String(key);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* 공용 단위 고르기(856-4 — 옛 M02 `DataFlow/M02_DF_UnitPick`) — 치면 걸러진 목록 · 고르기만(손글 안 받음 · `free` = 목록에 없는 친 글도 씀) · 「-」 = 없음
|
||||
* 목록 = 단위 표준(산림품셈 1-2-2) 단위 + 표의 「더한 단위」(수식 문서 줄 단위) + 부른 쪽이 주는 마스터 결과단위 등 + 원 · 「같은 단위」(kg → ㎏) 는 하나만
|
||||
* 표준 표 읽는 길은 `setUnitSource` 로 바꿔 끼움(기본 = 서버 /standards) — 다른 판도 이것을 씀
|
||||
* 글 [한, 영] 짝은 아래 TEXT
|
||||
* 글은 아래 TEXT
|
||||
* ========================================================================== */
|
||||
|
||||
import { createButton, el } from "@ui/ui_template_elements";
|
||||
|
||||
Reference in New Issue
Block a user