From 6a2276f5950fa414f3f2a8e365338f0eedf60be8 Mon Sep 17 00:00:00 2001 From: jingrow Date: Mon, 29 Dec 2025 21:46:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96vite=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dashboard/vite-plugin-translate.mjs | 25 ++++++++++--- jcloud/translations/zh.csv | 54 +++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 5 deletions(-) diff --git a/dashboard/vite-plugin-translate.mjs b/dashboard/vite-plugin-translate.mjs index bd89a18..e13f913 100644 --- a/dashboard/vite-plugin-translate.mjs +++ b/dashboard/vite-plugin-translate.mjs @@ -419,23 +419,38 @@ function parseCSV(csvPath) { if (!trimmed || trimmed.startsWith('#')) continue; // 标准 CSV 解析(支持引号) + // 只有当字段以引号开始时,引号才作为 CSV 格式的引号处理 const parts = []; let current = ''; let inQuotes = false; + let fieldStartedWithQuote = false; for (let i = 0; i < trimmed.length; i++) { const char = trimmed[i]; if (char === '"') { - // 处理转义的引号 "" - if (i + 1 < trimmed.length && trimmed[i + 1] === '"') { - current += '"'; - i++; + // 如果当前字段还没开始(current 为空),且这是字段的第一个字符,标记为引号包裹的字段 + if (current === '' && !inQuotes) { + fieldStartedWithQuote = true; + inQuotes = true; + // 不将开始的引号添加到 current + } else if (inQuotes && fieldStartedWithQuote) { + // 在引号包裹的字段中,处理转义的引号 "" 或结束引号 + if (i + 1 < trimmed.length && trimmed[i + 1] === '"') { + current += '"'; + i++; + } else { + // 结束引号,不添加到 current + inQuotes = false; + fieldStartedWithQuote = false; + } } else { - inQuotes = !inQuotes; + // 不在引号包裹的字段中,引号是内容的一部分 + current += char; } } else if (char === ',' && !inQuotes) { parts.push(current); current = ''; + fieldStartedWithQuote = false; } else { current += char; } diff --git a/jcloud/translations/zh.csv b/jcloud/translations/zh.csv index 3a3d493..c1a65ff 100644 --- a/jcloud/translations/zh.csv +++ b/jcloud/translations/zh.csv @@ -1134,3 +1134,57 @@ Weak,弱, Fair,一般, Strong,强, Very Strong,非常强, +Server,服务器, +Configuration,配置, +Public IP,公网IP, +Please select server configuration and payment method. Click "Create" to automatically provision the server.,请选择服务器配置和支付方式。点击"创建"以自动配置服务器。, +Region Selection,区域选择, +Please select a region,请选择一个区域, +Image Selection (Jsite servers recommend Ubuntu-22.04),镜像选择(Jsite服务器推荐 Ubuntu-22.04), +Please select an image,请选择一个镜像, +Plan Selection,计划选择, +Purchase Duration,购买时长, +Monthly Fee,月费, +months,个月, +Select Payment Method,选择支付方式, +Balance Payment,余额支付, +Processing...,处理中..., +Processing payment, please wait...,正在处理支付,请稍候..., +Payment Successful!,支付成功!, +Your order has been paid successfully and the server record has been created. The server is being created in the background. Creation and startup will take 3-5 minutes, please be patient.,您的订单已成功支付,服务器记录已创建。服务器正在后台创建中。创建和启动需要3-5分钟,请耐心等待。, +You can check the server status in the server list. After creation is complete, the status will be updated to "Running".,您可以在服务器列表中查看服务器状态。创建完成后,状态将更新为"运行中"。, +Back to Server List,返回服务器列表, +1 month,1个月, +3 months,3个月, +6 months,6个月, +1 year,1年, +2 years,2年, +3 years,3年, +cores,核, +public IPs,个公网IP, +month,月, +General Type - ,通用型 - , +Multi Public IP Type - ,多公网IP型 - , +International Type - ,国际型 - , +Capacity Type - ,容量型 - , +Unknown image,未知镜像, +Unknown method,未知方法, +Region data format is incorrect or empty,区域数据格式不正确或为空, +Failed to get regions,获取区域失败, +Failed to get plans,获取计划失败, +Image data format is incorrect or empty,镜像数据格式不正确或为空, +Failed to get images,获取镜像失败, +Please select complete configuration,请选择完整配置, +Please select payment method,请选择支付方式, +Failed to create server order,创建服务器订单失败, +Missing order information,缺少订单信息, +Payment failed, please ensure sufficient balance,支付失败,请确保余额充足, +Insufficient balance,余额不足, +Balance payment processing failed,余额支付处理失败, +Alipay payment processing failed,支付宝支付处理失败, +WeChat Pay payment processing failed,微信支付处理失败, +Order information is incomplete, please try again,订单信息不完整,请重试, +Please complete Alipay payment in the new page,请在新页面完成支付宝支付, +If it does not automatically redirect, please click the button below to open the payment page,如果未自动跳转,请点击下方按钮打开支付页面, +Open Payment Page,打开支付页面, +After payment is completed, please wait a moment, the system will automatically refresh the page,支付完成后,请稍等片刻,系统将自动刷新页面,