[bot] replace boolian with yes/no #537

This commit is contained in:
Alireza Ahmadi
2023-09-09 14:48:19 +02:00
parent de4affb913
commit 16113ce7aa
5 changed files with 48 additions and 5 deletions

View File

@@ -466,8 +466,15 @@ func (t *Tgbot) getClientUsage(chatId int64, tgUserName 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=="+strconv.FormatBool(traffic.Enable))
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email)
output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up))
output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down))
@@ -509,8 +516,15 @@ func (t *Tgbot) searchClient(chatId int64, email 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=="+strconv.FormatBool(traffic.Enable))
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email)
output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up))
output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down))
@@ -565,8 +579,15 @@ 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=="+strconv.FormatBool(traffic.Enable))
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email)
output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up))
output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down))
@@ -608,8 +629,15 @@ 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=="+strconv.FormatBool(traffic.Enable))
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
output += t.I18nBot("tgbot.messages.email", "Email=="+traffic.Email)
output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up))
output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down))
@@ -713,7 +741,14 @@ func (t *Tgbot) getExhausted() string {
total = common.FormatTraffic((traffic.Total))
}
output += t.I18nBot("tgbot.messages.active", "Enable=="+strconv.FormatBool(traffic.Enable))
active := ""
if traffic.Enable {
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)
output += t.I18nBot("tgbot.messages.upload", "Upload=="+common.FormatTraffic(traffic.Up))
output += t.I18nBot("tgbot.messages.download", "Download=="+common.FormatTraffic(traffic.Down))

View File

@@ -405,6 +405,8 @@
"disabled" = "🛑 Disabled: {{ .Disabled }}\r\n"
"depleteSoon" = "🔜 Deplete soon: {{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 Backup Time: {{ .Time }}\r\n"
"yes" = "✅ Yes"
"no" = "❌ No"
[tgbot.buttons]
"dbBackup" = "Get DB Backup"

View File

@@ -404,6 +404,8 @@
"disabled" = "🛑 غیرفعال: {{ .Disabled }}\r\n"
"depleteSoon" = "🔜 به زودی به پایان خواهد رسید: {{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 زمان پشتیبان‌گیری: {{ .Time }}\r\n"
"yes" = "✅ بله"
"no" = "❌ خیر"
[tgbot.buttons]
"dbBackup" = "دریافت پشتیبان پایگاه داده"

View File

@@ -405,6 +405,8 @@
"disabled" = "🛑 Отключено: {{ .Disabled }}\r\n"
"depleteSoon" = "🔜 Скоро отключатся: {{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 Время резервного копирования: {{ .Time }}\r\n"
"yes" = "✅ Да"
"no" = "❌ Нет"
[tgbot.buttons]
"dbBackup" = "Получить резервную копию базы данных"

View File

@@ -405,6 +405,8 @@
"disabled" = "🛑 禁用:{{ .Disabled }}\r\n"
"depleteSoon" = "🔜 即将耗尽:{{ .Deplete }}\r\n \r\n"
"backupTime" = "🗄 备份时间:{{ .Time }}\r\n"
"yes" = "✅ 是"
"no" = "❌ 不"
[tgbot.buttons]
"dbBackup" = "获取数据库备份"