完整汉化:将所有用户可见文本翻译为简体中文
- index.html: 页面标题、meta 标签、按钮文字/提示、状态栏 - docs.html: 完整文档页面 9 个章节 - js/main.js: 模式名称、分区标题、滑块标签、toast 消息、按钮文字 - js/ui.js: 新种子按钮、随机化提示 - js/modals.js: 导出对话框标题/选项/标签、套装生成器文本 - js/exporter.js: 渲染进度文本、完成/错误 toast 消息 - js/palettes.js: 16 种调色板名称 - README.md: 项目说明全文
This commit is contained in:
+14
-14
@@ -9,7 +9,7 @@ var Exporter = (function () {
|
||||
function showOverlay(title) {
|
||||
cancelled = false;
|
||||
$("overlay-title").textContent = title;
|
||||
$("overlay-detail").textContent = "preparing";
|
||||
$("overlay-detail").textContent = "准备中";
|
||||
$("overlay-bar").style.width = "0%";
|
||||
$("overlay").hidden = false;
|
||||
}
|
||||
@@ -49,7 +49,7 @@ var Exporter = (function () {
|
||||
busy = false;
|
||||
if (blob) {
|
||||
download(blob, stamp(P, "png"));
|
||||
FX.celebrate("Saved " + w + "\u00d7" + h + " PNG");
|
||||
FX.celebrate("已保存 " + w + "\u00d7" + h + " PNG");
|
||||
}
|
||||
}, "image/png");
|
||||
}
|
||||
@@ -91,7 +91,7 @@ var Exporter = (function () {
|
||||
async function exportVideo(P, aspect) {
|
||||
if (busy) return;
|
||||
if (typeof VideoEncoder === "undefined" || typeof VideoFrame === "undefined") {
|
||||
UI.toast("This browser has no WebCodecs support, use a current Chrome, Edge or Firefox");
|
||||
UI.toast("此浏览器不支持 WebCodecs,请使用最新版 Chrome、Edge 或 Firefox");
|
||||
return;
|
||||
}
|
||||
busy = true;
|
||||
@@ -104,7 +104,7 @@ var Exporter = (function () {
|
||||
var totalSec = videoDurationSec(P);
|
||||
var nFrames = Math.max(2, Math.round(totalSec * fps));
|
||||
|
||||
showOverlay("Rendering video");
|
||||
showOverlay("渲染视频中");
|
||||
Engine.suspend();
|
||||
Engine.setPlaying(false);
|
||||
Engine.setSize(w, h);
|
||||
@@ -112,7 +112,7 @@ var Exporter = (function () {
|
||||
var picked = await pickEncoderConfig(w, h, fps);
|
||||
if (!picked) {
|
||||
restore();
|
||||
UI.toast("No supported video codec (VP9/VP8) found");
|
||||
UI.toast("未找到支持的视频编码器 (VP9/VP8)");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ var Exporter = (function () {
|
||||
vf.close();
|
||||
|
||||
setProgress(0.9 * (f + 1) / nFrames,
|
||||
"frame " + (f + 1) + "/" + nFrames + " \u00b7 " + w + "\u00d7" + h + " @ " + fps + "fps");
|
||||
"帧 " + (f + 1) + "/" + nFrames + " \u00b7 " + w + "\u00d7" + h + " @ " + fps + "帧/秒");
|
||||
|
||||
/* backpressure: never let the encoder queue grow unbounded */
|
||||
while (encoder.encodeQueueSize > 2) await wait(2);
|
||||
@@ -160,7 +160,7 @@ var Exporter = (function () {
|
||||
}
|
||||
|
||||
if (!cancelled && !encError) {
|
||||
setProgress(0.93, "finalizing encode");
|
||||
setProgress(0.93, "完成编码");
|
||||
await encoder.flush();
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -177,11 +177,11 @@ var Exporter = (function () {
|
||||
if (cancelled) { hideOverlay(); busy = false; return; }
|
||||
if (encError || !encFrames.length) {
|
||||
hideOverlay(); busy = false;
|
||||
UI.toast("Video encode failed" + (encError && encError.message ? ": " + encError.message : ""));
|
||||
UI.toast("视频编码失败" + (encError && encError.message ? ":" + encError.message : ""));
|
||||
return;
|
||||
}
|
||||
|
||||
setProgress(0.97, "writing webm container");
|
||||
setProgress(0.97, "写入 WebM 容器");
|
||||
await wait(0);
|
||||
var webm = WebMMux.mux({
|
||||
codecId: picked.codecId,
|
||||
@@ -193,7 +193,7 @@ var Exporter = (function () {
|
||||
hideOverlay();
|
||||
busy = false;
|
||||
download(new Blob([webm], { type: "video/webm" }), stamp(P, "webm"));
|
||||
FX.celebrate("Saved " + totalSec.toFixed(1) + "s video \u00b7 " + w + "\u00d7" + h + " @ " + fps + "fps");
|
||||
FX.celebrate("已保存 " + totalSec.toFixed(1) + "s 视频 \u00b7 " + w + "\u00d7" + h + " @ " + fps + "帧/秒");
|
||||
|
||||
function restore() {
|
||||
Engine.setSize(prev[0], prev[1]);
|
||||
@@ -218,7 +218,7 @@ var Exporter = (function () {
|
||||
var fps = parseInt(P.gifFps, 10);
|
||||
var nFrames = Math.max(2, Math.round(P.loop * fps));
|
||||
|
||||
showOverlay("Rendering GIF");
|
||||
showOverlay("渲染 GIF 中");
|
||||
Engine.setSize(w, h);
|
||||
|
||||
var frames = [];
|
||||
@@ -226,7 +226,7 @@ var Exporter = (function () {
|
||||
if (cancelled) break;
|
||||
Engine.renderAt(f / nFrames);
|
||||
frames.push(Engine.readPixels());
|
||||
setProgress(0.4 * (f + 1) / nFrames, "capturing " + (f + 1) + "/" + nFrames);
|
||||
setProgress(0.4 * (f + 1) / nFrames, "捕获 " + (f + 1) + "/" + nFrames);
|
||||
if (f % 4 === 3) await wait(0);
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ var Exporter = (function () {
|
||||
var data = await GIFEnc.encode({
|
||||
frames: frames, width: w, height: h, fps: fps,
|
||||
dither: P.gifDither, loop: P.gifLoop,
|
||||
onProgress: function (frac, detail) { setProgress(0.4 + 0.6 * frac, "encoding \u00b7 " + detail); },
|
||||
onProgress: function (frac, detail) { setProgress(0.4 + 0.6 * frac, "编码中 \u00b7 " + detail); },
|
||||
isCancelled: function () { return cancelled; }
|
||||
});
|
||||
|
||||
@@ -246,7 +246,7 @@ var Exporter = (function () {
|
||||
busy = false;
|
||||
if (data && !cancelled) {
|
||||
download(new Blob([data], { type: "image/gif" }), stamp(P, "gif"));
|
||||
FX.celebrate("Saved " + nFrames + "-frame looping GIF (" + w + "\u00d7" + h + ")");
|
||||
FX.celebrate("已保存 " + nFrames + " 帧循环 GIF (" + w + "\u00d7" + h + ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user