translate to rus

This commit is contained in:
2026-07-09 23:49:42 +03:00
parent cb573a52d5
commit 11f03eae41
8 changed files with 89 additions and 79 deletions
+6 -6
View File
@@ -58,23 +58,23 @@ def build_marzban_note(
def bytes_to_human(value: int | None) -> str:
if value is None:
return "unlimited"
return "безлимит"
if value == 0:
return "unlimited"
return "безлимит"
return f"{value / GIB:.2f} GB"
def format_timestamp(ts: int | None) -> str:
if not ts:
return "unlimited"
return "безлимит"
return datetime.fromtimestamp(ts, tz=timezone.utc).strftime("%Y-%m-%d %H:%M UTC")
def format_remaining_days(expire: int | None, *, now: int | None = None) -> str:
if not expire:
return "unlimited"
return "безлимит"
current = now_ts() if now is None else now
if expire <= current:
return "expired"
return "истёк"
days = (expire - current) / SECONDS_PER_DAY
return f"{days:.1f} days"
return f"{days:.1f} дн."