Skip to content

Commit

Permalink
Truncate service names if their too long
Browse files Browse the repository at this point in the history
  • Loading branch information
Kowlin committed Jan 6, 2025
1 parent cd0e875 commit 789f695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions redbot/core/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,9 @@ def __init__(
self.title = _("Set API Keys")
self.keys_label = _("Keys and tokens")
if self.default_service is not None:
self.title = _("Set API Keys for {service}").format(service=self.default_service)
truncated_service_name = (self.default_service[:20] + '…') if len(self.default_service) > 20 else self.default_service
self.keys_label = _("Keys and tokens for {service}").format(
service=self.default_service
service=truncated_service_name
)
self.default_service = self.default_service.lower()
# Lower here to prevent someone from capitalizing a service name for the sake of UX.
Expand Down

0 comments on commit 789f695

Please sign in to comment.