Skip to content

Generate clean 2D game sprites & animation atlases — component-row pipeline: state rows, alpha cleanup, frame extraction, runtime atlases. Codex/Claude skill.

2.9 KB
Raw Blame
// SPDX-License-Identifier: Apache-2.0
// composer/i18n.js — bilingual strings (en/ko). Classic script, shared globals.

const STR = {
  en: {
    title: "compose",
    mount: "Open folder",
    remount: "Change folder",
    openImage: "Open image",
    treeHead: "Library",
    emptyTitle: "Compose a sprite from a folder",
    emptySub: "Open a folder of images, then drag files onto rows to build each animation state. Originals are never copied or changed.",
    emptyMount: "Open a folder",
    addRow: "+ Add row",
    newRowName: "new-state",
    rowEmptyHint: "Drag image files here",
    frames: (n) => `${n} frame${n === 1 ? "" : "s"}`,
    deleteRow: "Delete row",
    mountPrompt: "Absolute path of the folder to open:",
    mounted: (p) => p,
    mountFail: (m) => `Open failed: ${m}`,
    browseFail: (m) => `Browse failed: ${m}`,
    ready: "Ready",
    dropAdded: (name, row) => `Added ${name} to ${row}`,
    noMount: "No folder open yet",
    build: "Build sprite",
    building: "Building...",
    buildPrompt: "Output run directory (absolute path):",
    buildDone: (states, frames) => `Built ${states} state${states === 1 ? "" : "s"}, ${frames} frame${frames === 1 ? "" : "s"}`,
    buildFail: (m) => `Build failed: ${m}`,
    needRows: "Add at least one file to a row first",
    openCuration: "Open curation view",
    opening: "Opening curation view...",
    openFail: (m) => `Open failed: ${m}`,
    langLabel: "한국어",
  },
  ko: {
    title: "조립",
    mount: "폴더 열기",
    remount: "폴더 바꾸기",
    openImage: "이미지 열기",
    treeHead: "라이브러리",
    emptyTitle: "폴더에서 스프라이트를 조립한다",
    emptySub: "이미지 폴더를 열고, 파일을 줄로 드래그해서 각 애니메이션 상태를 짠다. 원본은 복사도 변경도 되지 않는다.",
    emptyMount: "폴더 열기",
    addRow: "+ 줄 추가",
    newRowName: "새-상태",
    rowEmptyHint: "여기로 이미지 파일을 드래그",
    frames: (n) => `${n}장`,
    deleteRow: "줄 삭제",
    mountPrompt: "열 폴더의 절대 경로:",
    mounted: (p) => p,
    mountFail: (m) => `폴더 열기 실패: ${m}`,
    browseFail: (m) => `탐색 실패: ${m}`,
    ready: "준비됨",
    dropAdded: (name, row) => `${name} 을(를) ${row} 에 추가`,
    noMount: "아직 연 폴더 없음",
    build: "스프라이트 빌드",
    building: "빌드 중...",
    buildPrompt: "출력 run 디렉토리 (절대 경로):",
    buildDone: (states, frames) => `${states}개 상태, ${frames}장 빌드됨`,
    buildFail: (m) => `빌드 실패: ${m}`,
    needRows: "먼저 줄에 파일을 하나 이상 넣어라",
    openCuration: "큐레이션 뷰 열기",
    opening: "큐레이션 뷰 여는 중...",
    openFail: (m) => `열기 실패: ${m}`,
    langLabel: "English",
  },
};

let lang = "en";
function t(key, ...args) {
  const v = STR[lang][key];
  return typeof v === "function" ? v(...args) : v;
}