[Utils] Add humanize_number() function to chat formatting (#2836)

This adds babel as a dependency, and also includes `redbot.core.i18n.get_babel_locale()`
This commit is contained in:
Draper
2019-08-27 23:44:52 +01:00
committed by Toby Harradine
parent 6c3a3fea66
commit 3c1b6ae4cf
15 changed files with 238 additions and 80 deletions

View File

@@ -7,7 +7,7 @@ from typing import cast, Optional, Union
import discord
from redbot.core import commands, i18n, checks, modlog
from redbot.core.utils.chat_formatting import pagify
from redbot.core.utils.chat_formatting import pagify, humanize_number
from redbot.core.utils.mod import is_allowed_by_hierarchy, get_audit_reason
from .abc import MixinMeta
from .converters import RawUserIds
@@ -244,7 +244,9 @@ class KickBanMixin(MixinMeta):
errors = {}
async def show_results():
text = _("Banned {num} users from the server.").format(num=len(banned))
text = _("Banned {num} users from the server.").format(
num=humanize_number(len(banned))
)
if errors:
text += _("\nErrors:\n")
text += "\n".join(errors.values())