fix: missing progress stats i18n
This commit is contained in:
@@ -118,6 +118,7 @@ const (
|
|||||||
BotMsgImportErrorStorageNotReadable Key = "bot.msg.import.error_storage_not_readable"
|
BotMsgImportErrorStorageNotReadable Key = "bot.msg.import.error_storage_not_readable"
|
||||||
BotMsgImportInfoFetchingFiles Key = "bot.msg.import.info_fetching_files"
|
BotMsgImportInfoFetchingFiles Key = "bot.msg.import.info_fetching_files"
|
||||||
BotMsgImportInfoTaskAdded Key = "bot.msg.import.info_task_added"
|
BotMsgImportInfoTaskAdded Key = "bot.msg.import.info_task_added"
|
||||||
|
BotMsgImportStartStats Key = "bot.msg.import.start_stats"
|
||||||
BotMsgImportUsage Key = "bot.msg.import.usage"
|
BotMsgImportUsage Key = "bot.msg.import.usage"
|
||||||
BotMsgMediaGroupErrorBuildStorageSelectKeyboardFailed Key = "bot.msg.media_group.error_build_storage_select_keyboard_failed"
|
BotMsgMediaGroupErrorBuildStorageSelectKeyboardFailed Key = "bot.msg.media_group.error_build_storage_select_keyboard_failed"
|
||||||
BotMsgMediaGroupInfoGroupFoundFilesSelectStorage Key = "bot.msg.media_group.info_group_found_files_select_storage"
|
BotMsgMediaGroupInfoGroupFoundFilesSelectStorage Key = "bot.msg.media_group.info_group_found_files_select_storage"
|
||||||
|
|||||||
@@ -298,7 +298,12 @@ bot:
|
|||||||
info_downloading: "正在通过 yt-dlp 下载..."
|
info_downloading: "正在通过 yt-dlp 下载..."
|
||||||
error_download_failed: "yt-dlp 下载失败: {{.Error}}"
|
error_download_failed: "yt-dlp 下载失败: {{.Error}}"
|
||||||
import:
|
import:
|
||||||
usage: "用法: /import <storage_name> <dir_path> [target_chat_id] [filter]\n\n示例:\n/import 本机1 /downloads\n/import MyAlist /media/photos -1001234567890\n/import MyLocal /backup \".*\.mp4$\""
|
usage: |
|
||||||
|
用法: /import <storage_name> <dir_path> [target_chat_id] [filter]
|
||||||
|
示例:
|
||||||
|
/import 本机1 /downloads
|
||||||
|
/import MyAlist /media/photos -1001234567890
|
||||||
|
/import MyLocal /backup ".*\.mp4$"
|
||||||
error_storage_not_found: "存储端 '{{.StorageName}}' 不存在或您无权访问: {{.Error}}"
|
error_storage_not_found: "存储端 '{{.StorageName}}' 不存在或您无权访问: {{.Error}}"
|
||||||
error_storage_not_listable: "存储端 '{{.StorageName}}' 不支持列举文件功能"
|
error_storage_not_listable: "存储端 '{{.StorageName}}' 不支持列举文件功能"
|
||||||
error_storage_not_readable: "存储端 '{{.StorageName}}' 不支持读取文件功能"
|
error_storage_not_readable: "存储端 '{{.StorageName}}' 不支持读取文件功能"
|
||||||
@@ -311,6 +316,7 @@ bot:
|
|||||||
error_no_target_chat_id: "未指定目标频道 ID,且 Telegram 存储未配置默认 chat_id"
|
error_no_target_chat_id: "未指定目标频道 ID,且 Telegram 存储未配置默认 chat_id"
|
||||||
error_add_task_failed: "添加任务失败: {{.Error}}"
|
error_add_task_failed: "添加任务失败: {{.Error}}"
|
||||||
info_task_added: "已添加 {{.Count}} 个文件到导入队列\n总大小: {{.SizeMB}} MB\n任务 ID: {{.TaskID}}"
|
info_task_added: "已添加 {{.Count}} 个文件到导入队列\n总大小: {{.SizeMB}} MB\n任务 ID: {{.TaskID}}"
|
||||||
|
start_stats: "总文件数: {{.Count}}\n总大小: {{.SizeMB}} MB"
|
||||||
cancel:
|
cancel:
|
||||||
usage: "用法: /cancel <task_id>"
|
usage: "用法: /cancel <task_id>"
|
||||||
error_cancel_failed: "取消任务失败: {{.Error}}"
|
error_cancel_failed: "取消任务失败: {{.Error}}"
|
||||||
@@ -383,4 +389,4 @@ bot:
|
|||||||
info_adding_aria2_download: "正在添加 Aria2 下载任务..."
|
info_adding_aria2_download: "正在添加 Aria2 下载任务..."
|
||||||
error_adding_aria2_download: "添加 Aria2 下载任务失败: {{.Error}}"
|
error_adding_aria2_download: "添加 Aria2 下载任务失败: {{.Error}}"
|
||||||
info_aria2_download_added: "Aria2 下载任务已添加, GID: {{.GID}}"
|
info_aria2_download_added: "Aria2 下载任务已添加, GID: {{.GID}}"
|
||||||
info_select_storage: "请选择存储位置, 选择后将添加到 Aria2 下载队列"
|
info_select_storage: "请选择存储位置, 选择后将添加到 Aria2 下载队列"
|
||||||
|
|||||||
@@ -43,9 +43,9 @@ func (p *Progress) OnStart(ctx context.Context, info TaskInfo) {
|
|||||||
log.FromContext(ctx).Debugf("Batch import task progress tracking started for message %d in chat %d", p.MessageID, p.ChatID)
|
log.FromContext(ctx).Debugf("Batch import task progress tracking started for message %d in chat %d", p.MessageID, p.ChatID)
|
||||||
|
|
||||||
sizeMB := float64(info.TotalSize()) / (1024 * 1024)
|
sizeMB := float64(info.TotalSize()) / (1024 * 1024)
|
||||||
statsText := i18n.T(i18nk.BotMsgProgressImportStartStats, map[string]any{
|
statsText := i18n.T(i18nk.BotMsgImportStartStats, map[string]any{
|
||||||
"size": fmt.Sprintf("%.2f", sizeMB),
|
"SizeMB": fmt.Sprintf("%.2f", sizeMB),
|
||||||
"count": info.Count(),
|
"Count": info.Count(),
|
||||||
})
|
})
|
||||||
|
|
||||||
entityBuilder := entity.Builder{}
|
entityBuilder := entity.Builder{}
|
||||||
|
|||||||
Reference in New Issue
Block a user