From b725d2b08ef9349ed1e3b2440b1fe4ed46671dac Mon Sep 17 00:00:00 2001 From: sunnylqm Date: Sun, 30 Mar 2025 23:40:28 +0800 Subject: [PATCH] i18n --- src/bundle.ts | 3 ++- src/locales/en.ts | 1 + src/locales/zh.ts | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bundle.ts b/src/bundle.ts index c760f7c..ed63805 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -11,6 +11,7 @@ const g2js = require('gradle-to-js/lib/parser'); import os from 'node:os'; const properties = require('properties'); import { depVersions } from './utils/dep-versions'; +import { t } from './utils/i18n'; let bsdiff; let hdiff; @@ -512,7 +513,7 @@ async function pack(dir: string, output: string) { }); zipfile.end(); }); - console.log(`ppk热更包已生成并保存到: ${output}`); + console.log(t('ppkPackageGenerated', { output })); } export function readEntire(entry: string, zipFile: ZipFile) { diff --git a/src/locales/en.ts b/src/locales/en.ts index a4d13ae..fa338a9 100644 --- a/src/locales/en.ts +++ b/src/locales/en.ts @@ -39,4 +39,5 @@ This can reduce the risk of inconsistent dependencies and supply chain attacks. cancelled: 'Cancelled', operationSuccess: 'Operation successful', failedToParseUpdateJson: 'Failed to parse file `update.json`. Try to remove it manually.', + ppkPackageGenerated: 'ppk package generated and saved to: {{output}}', }; diff --git a/src/locales/zh.ts b/src/locales/zh.ts index e9c09da..c227df2 100644 --- a/src/locales/zh.ts +++ b/src/locales/zh.ts @@ -37,4 +37,5 @@ export default { cancelled: '已取消', operationSuccess: '操作成功', failedToParseUpdateJson: '无法解析文件 `update.json`。请手动删除它。', + ppkPackageGenerated: 'ppk 热更包已生成并保存到: {{output}}', };