diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 69cfd7246..5baccd966 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -740,17 +740,19 @@ func (t *Tgbot) getClientUsage(chatId int64, tgUserName string, tgUserID string) total = common.FormatTraffic((traffic.Total)) } + active := "" + if traffic.Enable { + active = t.I18nBot("tgbot.messages.yes") + } else { + active = t.I18nBot("tgbot.messages.no") + } + output := "" + output += t.I18nBot("tgbot.messages.active", "Enable=="+active) output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) - if traffic.Enable { - output += t.I18nBot("tgbot.messages.active") - if flag { - output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) - } else { - output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) - } + if flag { + output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) } else { - output += t.I18nBot("tgbot.messages.inactive") output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) } output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up)) @@ -878,19 +880,23 @@ func (t *Tgbot) searchClient(chatId int64, email string, messageID ...int) { total = common.FormatTraffic((traffic.Total)) } + active := "" + if traffic.Enable { + active = t.I18nBot("tgbot.messages.yes") + } else { + active = t.I18nBot("tgbot.messages.no") + } + output := "" + output += t.I18nBot("tgbot.messages.active", "Enable=="+active) output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) - if traffic.Enable { - output += t.I18nBot("tgbot.messages.active") - if flag { - output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) - } else { - output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) - } + + if flag { + output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) } else { - output += t.I18nBot("tgbot.messages.inactive") output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) } + output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up)) output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down)) output += t.I18nBot("tgbot.messages.total", "UpDown=="+common.FormatTraffic((traffic.Up+traffic.Down)), "Total=="+total) @@ -976,19 +982,23 @@ func (t *Tgbot) searchInbound(chatId int64, remark string) { total = common.FormatTraffic((traffic.Total)) } + active := "" + if traffic.Enable { + active = t.I18nBot("tgbot.messages.yes") + } else { + active = t.I18nBot("tgbot.messages.no") + } + output := "" + output += t.I18nBot("tgbot.messages.active", "Enable=="+active) output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) - if traffic.Enable { - output += t.I18nBot("tgbot.messages.active") - if flag { - output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) - } else { - output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) - } + + if flag { + output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) } else { - output += t.I18nBot("tgbot.messages.inactive") output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) } + output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up)) output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down)) output += t.I18nBot("tgbot.messages.total", "UpDown=="+common.FormatTraffic((traffic.Up+traffic.Down)), "Total=="+total) @@ -1036,19 +1046,23 @@ func (t *Tgbot) searchForClient(chatId int64, query string) { total = common.FormatTraffic((traffic.Total)) } + active := "" + if traffic.Enable { + active = t.I18nBot("tgbot.messages.yes") + } else { + active = t.I18nBot("tgbot.messages.no") + } + output := "" + output += t.I18nBot("tgbot.messages.active", "Enable=="+active) output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) - if traffic.Enable { - output += t.I18nBot("tgbot.messages.active") - if flag { - output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) - } else { - output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) - } + + if flag { + output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) } else { - output += t.I18nBot("tgbot.messages.inactive") output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) } + output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up)) output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down)) output += t.I18nBot("tgbot.messages.total", "UpDown=="+common.FormatTraffic((traffic.Up+traffic.Down)), "Total=="+total) @@ -1157,18 +1171,22 @@ func (t *Tgbot) getExhausted() string { total = common.FormatTraffic((traffic.Total)) } - output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) + active := "" if traffic.Enable { - output += t.I18nBot("tgbot.messages.active") - if flag { - output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) - } else { - output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) - } + active = t.I18nBot("tgbot.messages.yes") + } else { + active = t.I18nBot("tgbot.messages.no") + } + + output += t.I18nBot("tgbot.messages.active", "Enable=="+active) + output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email) + + if flag { + output += t.I18nBot("tgbot.messages.expireIn", "Time=="+expiryTime) } else { - output += t.I18nBot("tgbot.messages.inactive") output += t.I18nBot("tgbot.messages.expire", "Time=="+expiryTime) } + output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up)) output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down)) output += t.I18nBot("tgbot.messages.total", "UpDown=="+common.FormatTraffic((traffic.Up+traffic.Down)), "Total=="+total) diff --git a/web/translation/translate.en_US.toml b/web/translation/translate.en_US.toml index a3379f584..0d9931578 100644 --- a/web/translation/translate.en_US.toml +++ b/web/translation/translate.en_US.toml @@ -452,6 +452,8 @@ "depleteSoon" = "🔜 Deplete soon: {{ .Deplete }}\r\n \r\n" "backupTime" = "🗄 Backup Time: {{ .Time }}\r\n" "refreshedOn" = "\r\n📋🔄 Refreshed On: {{ .Time }}\r\n \r\n" +"yes" = "✅ Yes" +"no" = "❌ No" [tgbot.buttons] "closeKeyboard" = "❌ Close Keyboard" diff --git a/web/translation/translate.fa_IR.toml b/web/translation/translate.fa_IR.toml index ab3e62dfe..f621c13f6 100644 --- a/web/translation/translate.fa_IR.toml +++ b/web/translation/translate.fa_IR.toml @@ -452,6 +452,8 @@ "depleteSoon" = "🔜 به زودی به پایان خواهد رسید: {{ .Deplete }}\r\n \r\n" "backupTime" = "🗄 زمان پشتیبان‌گیری: {{ .Time }}\r\n" "refreshedOn" = "\r\n📋🔄 تازه‌سازی شده در: {{ .Time }}\r\n \r\n" +"yes" = "✅ بله" +"no" = "❌ خیر" [tgbot.buttons] "closeKeyboard" = "❌ بستن کیبورد" diff --git a/web/translation/translate.ru_RU.toml b/web/translation/translate.ru_RU.toml index 3c4605434..646c108aa 100644 --- a/web/translation/translate.ru_RU.toml +++ b/web/translation/translate.ru_RU.toml @@ -452,6 +452,8 @@ "depleteSoon" = "🔜 Скоро исчерпание: {{ .Deplete }}\r\n \r\n" "backupTime" = "🗄 Время резервного копирования: {{ .Time }}\r\n" "refreshedOn" = "\r\n📋🔄 Обновлено: {{ .Time }}\r\n \r\n" +"yes" = "✅ Да" +"no" = "❌ Нет" [tgbot.buttons] "closeKeyboard" = "❌ Закрыть клавиатуру" diff --git a/web/translation/translate.zh_Hans.toml b/web/translation/translate.zh_Hans.toml index d056054eb..dcfc24537 100644 --- a/web/translation/translate.zh_Hans.toml +++ b/web/translation/translate.zh_Hans.toml @@ -452,6 +452,8 @@ "depleteSoon" = "🔜 即将耗尽:{{ .Deplete }}\r\n \r\n" "backupTime" = "🗄 备份时间:{{ .Time }}\r\n" "refreshedOn" = "\r\n📋🔄 刷新时间:{{ .Time }}\r\n \r\n" +"yes" = "✅ 是" +"no" = "❌ 不" [tgbot.buttons] "closeKeyboard" = "❌ 关闭键盘"