From ce124821d07c80dd89dfe6035a166936c76ed7c0 Mon Sep 17 00:00:00 2001 From: wed150 Date: Sat, 23 May 2026 04:10:00 +0800 Subject: [PATCH] fix: typo --- index.html | 1167 ++++++++++++++++++++-------------------------------- 1 file changed, 448 insertions(+), 719 deletions(-) diff --git a/index.html b/index.html index e3cef3e..4705059 100644 --- a/index.html +++ b/index.html @@ -1,730 +1,459 @@ -/** - * 工具函数集合 - 文件压缩工具 - * @author wed15 - * @version 1.1.0 - */ - -// 国际化文本配置 -const i18n = { - zh: { - // 页面标题 - PAGE_TITLE: '投影拓展包生成器--自动,本地', - - // 状态消息 - STATUS_READY: '准备就绪', - STATUS_PROCESSING: '正在处理文件...', - STATUS_GENERATING: '正在生成压缩包...', - STATUS_COMPLETE: '压缩包已生成,可以下载了!', - STATUS_DOWNLOAD_START: '下载已开始!', - STATUS_FILE_ADDED: '文件 {name} 已添加!', - STATUS_FILE_EXISTS: '文件 {name} 已存在!', - STATUS_FILE_ERROR: '处理文件 {name} 时出错: {error}', - STATUS_FILE_DELETED: '文件已删除', - STATUS_NO_FILES: '请先添加文件!', - STATUS_GENERATING_ZIP: '正在生成压缩包...', - STATUS_COMPLETE_DONE: '处理完成!', - STATUS_NO_DOWNLOAD: '没有可下载的文件', - STATUS_DOWNLOAD_STARTED: '下载已开始', - STATUS_DOWNLOAD_FAILED: '下载失败: {error}', - STATUS_BROWSER_HINT: '建议在浏览器中打开该网站(右上角三个点哦!)', - - // 错误消息 - ERROR_NO_FILES: '没有上传任何文件', - ERROR_FILE_READ: '读取文件时出错', - ERROR_ZIP_GENERATE: '生成压缩包时出错', - ERROR_DOWNLOAD_FAIL: '下载失败', - ERROR_NO_DOWNLOAD_FILE: '没有可下载的文件,请先生成压缩包', - ERROR_INVALID_FILE_TYPE: '只支持 .mcstructure、.nbt 和 .litematic 文件', - ERROR_IMAGE_FETCH: '获取图像时出错', - ERROR_ZIP_ERROR: '生成压缩包时出错: {error}', - - // UI文本 - PROGRESS_TEXT: '处理中...', - PROGRESS_COMPLETE: '完成!', - DROP_ZONE_TEXT: '拖放文件到此处,或点击', - SELECT_FILES_BTN: '选择文件', - DOWNLOAD_BTN: '下载压缩包', - - // 页面标题和副标题 - MAIN_TITLE: '投影包生成工具', - SUB_TITLE: '无需上传 本地生成 大文件秒传 支持多文件', - NAV_DOWNLOAD: '下载汉化投影主包', - - // 上传区域 - SECTION_UPLOAD: '上传文件', - FORMAT_HINT: '支持格式:.mcstructure | .nbt | .litematic', - - // 配置区域 - SECTION_CONFIG: '配置选项', - LABEL_PROJECT_NAME: '拓展包名称:', - DEFAULT_PROJECT_NAME: '我的投影包', - BTN_PROCESS: '处理并生成投影拓展包', - - // 进度区域 - SECTION_PROGRESS: '处理进度', - - // 下载区域 - SECTION_DOWNLOAD: '下载投影拓展包', - DOWNLOAD_READY: '您的文件已准备就绪', - - // 删除按钮 - BTN_DELETE: '删除', - - // 底部 - FOOTER_SPONSOR: '赞助我们', - FOOTER_ICP: '赣ICP备2026005549号-1', - FOOTER_CDN: 'Esa分站', - - // 下载页面 - DL_PAGE_TITLE: '投影汉化主包下载中心', - DL_MAIN_TITLE: '汉化投影主包下载中心', - DL_SUB_TITLE: '选择版本下载 持续更新中', - DL_NAV_BACK: '返回投影包生成工具', - DL_SECTION_AVAILABLE: '可用版本', - DL_BTN_DOWNLOAD: '下载', - DL_STATUS_START: '开始下载: {name}', - DL_STATUS_FAILED: '下载失败: {error}', - - // 海外版专用 - OV_PAGE_TITLE: 'Construct Expansion Pack Generator', - OV_MAIN_TITLE: 'Construct Pack Generator', - OV_SUB_TITLE: '100% Offline · No Upload · Instant Convert', - OV_FOOTER_POWERED: 'Powered by Sea-of-Stars-Studio', - OV_STATUS_HINT: 'Open in browser for best experience' - }, - en: { - // Page title - PAGE_TITLE: 'Construct Expansion Pack Generator - Offline & Local', - - // Status messages - STATUS_READY: 'Ready', - STATUS_PROCESSING: 'Processing files...', - STATUS_GENERATING: 'Generating archive...', - STATUS_COMPLETE: 'Archive generated, ready to download!', - STATUS_DOWNLOAD_START: 'Download started!', - STATUS_FILE_ADDED: 'File {name} added!', - STATUS_FILE_EXISTS: 'File {name} already exists!', - STATUS_FILE_ERROR: 'Error processing {name}: {error}', - STATUS_FILE_DELETED: 'File deleted', - STATUS_NO_FILES: 'Please add files first!', - STATUS_GENERATING_ZIP: 'Generating archive...', - STATUS_COMPLETE_DONE: 'Processing complete!', - STATUS_NO_DOWNLOAD: 'No file to download', - STATUS_DOWNLOAD_STARTED: 'Download started', - STATUS_DOWNLOAD_FAILED: 'Download failed: {error}', - STATUS_BROWSER_HINT: 'Please open this site in a browser (tap the 3 dots in the top right!)', - - // Error messages - ERROR_NO_FILES: 'No files uploaded', - ERROR_FILE_READ: 'Error reading file', - ERROR_ZIP_GENERATE: 'Error generating archive', - ERROR_DOWNLOAD_FAIL: 'Download failed', - ERROR_NO_DOWNLOAD_FILE: 'No file to download, please generate archive first', - ERROR_INVALID_FILE_TYPE: 'Only .mcstructure, .nbt and .litematic files are supported', - ERROR_IMAGE_FETCH: 'Error fetching image', - ERROR_ZIP_ERROR: 'Error generating archive: {error}', - - // UI text - PROGRESS_TEXT: 'Processing...', - PROGRESS_COMPLETE: 'Complete!', - DROP_ZONE_TEXT: 'Drag files here or click to select', - SELECT_FILES_BTN: 'Select Files', - DOWNLOAD_BTN: 'Download Archive', - - // Page title and subtitle - MAIN_TITLE: 'Construct Pack Generator', - SUB_TITLE: 'No Upload · Local Processing · Fast Transfer · Multi-File', - NAV_DOWNLOAD: 'Download Chinese Projection Pack', - - // Upload section - SECTION_UPLOAD: 'Upload Files', - FORMAT_HINT: '.mcstructure|nbt|litematic', - - // Config section - SECTION_CONFIG: 'Configuration', - LABEL_PROJECT_NAME: 'Pack Name:', - DEFAULT_PROJECT_NAME: 'My Construct Pack', - BTN_PROCESS: 'Process & Generate Pack', - - // Progress section - SECTION_PROGRESS: 'Processing Progress', - - // Download section - SECTION_DOWNLOAD: 'Download Your Pack', - DOWNLOAD_READY: 'Your file is ready', - - // Delete button - BTN_DELETE: 'Delete', - - // Footer - FOOTER_SPONSOR: 'Sponsor Us', - FOOTER_ICP: '赣ICP备2026005549号-1', - FOOTER_CDN: 'ESA', - - // Download page - DL_PAGE_TITLE: 'Download Construct Addon', - DL_MAIN_TITLE: 'Projection Pack Download Center', - DL_SUB_TITLE: 'Select a version to download · Updated regularly', - DL_NAV_BACK: 'Back to Pack Generator', - DL_SECTION_AVAILABLE: 'Available Versions', - DL_BTN_DOWNLOAD: 'Download', - DL_STATUS_START: 'Downloading: {name}', - DL_STATUS_FAILED: 'Download failed: {error}', - - // Overseas version - OV_PAGE_TITLE: 'Construct Expansion Pack Generator', - OV_MAIN_TITLE: 'Construct Pack Generator', - OV_SUB_TITLE: '100% Offline · No Upload · Instant Convert', - OV_FOOTER_POWERED: 'Powered by Sea-of-Stars-Studio', - OV_STATUS_HINT: 'Open in browser for best experience' - } -}; - -// 当前语言设置(可通过 switchLang 切换) -let currentLang = 'zh'; - -/** - * 带变量替换的翻译函数 - * @param {string} key - i18n 键名 - * @param {Object} vars - 替换变量,如 {name: 'test.txt'} - * @returns {string} 翻译后的文本 - */ -function t(key, vars) { - let text = i18n[currentLang][key] || key; - if (vars) { - for (const [k, v] of Object.entries(vars)) { - text = text.replace('{' + k + '}', v); + + + + + + Construct Expansion Pack Generator + + + + + + + + + + + - // 延迟转换:在生成 ZIP 时再处理 nbt / litematic 文件,避免添加阶段阻塞 - return true; - } - - /** - * 转换 nbt 或 litematic 文件为 mcstructure - * @param {File} file - 要转换的文件 - * @param {string} hash - 文件哈希值 - */ - async convertFile(file, hash) { +
+ +
+

Construct Pack Generator

+

100% Offline · No Upload · Instant Convert

+
+ + +
+

+ Upload Files + Supported: .mcstructure | .nbt | .litematic +

+
+ Drag files here or click to select + + +
+
+
+ + +
Open in browser for best experience
+ + +
+

Configuration

+
+ + +
+ +
+ + + + + + + + + +
+ + + + + +