Skip to content

Commit

Permalink
Truncate service names in [p]set api modal (Cog-Creators#6502)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kowlin authored Feb 1, 2025
1 parent 952a372 commit 8e0948d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions redbot/core/utils/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,13 @@ 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 8e0948d

Please sign in to comment.