handle singular vs plural names for more counts

Use the singular form when the count is 1 for fun reply cooldowns,
channel slow mode and user limits, age in days, planned manga chapters,
film length and social credits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
leanderandClaude Opus 5.5 committed 2026-11-01 19:53:57 +01:00
1 parent 8ec2483918
commit 14c3caedf5
5 files changed
+25 -7

No files matched your search

+4 -2
View File
@@ -656,7 +656,7 @@ class Anime(commands.Cog):
embed.add_field(name="Leser nå", value=misc_utils.format_number(reading))
embed.add_field(
name="Planlegger å lese",
value=f"{misc_utils.format_number(planning)}\n({misc_utils.format_number(planning_chapters)} kapitler)",
value=f"{misc_utils.format_number(planning)}\n({misc_utils.format_number(planning_chapters)} {'kapittel' if planning_chapters == 1 else 'kapitler'})",
)
embed.add_field(name="Droppet", value=misc_utils.format_number(dropped))
if most_read_genres:
@@ -809,7 +809,9 @@ class Anime(commands.Cog):
embed.add_field(name="Regissør", value=director_string)
embed.add_field(name="Utgivelsesdato", value=date)
if media_format == "Film":
embed.add_field(name="Lengde", value=f"{self.format_count(duration)} minutter")
embed.add_field(
name="Lengde", value=f"{self.format_count(duration)} {'minutt' if duration == 1 else 'minutter'}"
)
elif duration is None:
embed.add_field(name="Episoder", value=self.format_count(episodes))
else:
+3 -1
View File
@@ -367,7 +367,9 @@ class Birthday(commands.Cog):
name="Bursdag", value=discord.utils.format_dt(misc_utils.localize(birthday, self.bot.timezone), style="D")
)
embed.add_field(
name="Hvor gammel?", value=f"{years_old} år\n({misc_utils.format_number(days_old)} dager)", inline=False
name="Hvor gammel?",
value=f"{years_old} år\n({misc_utils.format_number(days_old)} {'dag' if days_old == 1 else 'dager'})",
inline=False,
)
embed.add_field(name="Weeb age", value=japanese_era, inline=False)
embed.add_field(
+3 -1
View File
@@ -278,7 +278,9 @@ class FunReplies(commands.Cog):
cooldown = self.get_cooldown(FUN_REPLIES_BY_NAME[name])
await interaction.response.send_message(
embed=embed_templates.success(f"`{name}` har nå {cooldown} sekunder nedkjøling")
embed=embed_templates.success(
f"`{name}` har nå {cooldown} {'sekund' if cooldown == 1 else 'sekunder'} nedkjøling"
)
)
@app_commands.checks.bot_has_permissions(embed_links=True)
+13 -2
View File
@@ -411,7 +411,13 @@ class Info(commands.Cog):
embed.add_field(name="Opprettet", value=discord.utils.format_dt(channel.created_at, style="F"))
embed.add_field(name="NSFW", value="Ja" if channel.is_nsfw() else "Nei")
embed.add_field(
name="Saktemodus", value=f"Ja ({channel.slowmode_delay} sekunder)" if channel.slowmode_delay else "Nei"
name="Saktemodus",
value=(
f"Ja ({misc_utils.format_number(channel.slowmode_delay)} "
+ f"{'sekund' if channel.slowmode_delay == 1 else 'sekunder'})"
if channel.slowmode_delay
else "Nei"
),
)
if channel.category:
embed.add_field(name="Kategori", value=channel.category.name)
@@ -438,7 +444,12 @@ class Info(commands.Cog):
embed.add_field(name="Opprettet", value=discord.utils.format_dt(channel.created_at, style="F"))
embed.add_field(name="Bitrate", value=f"{int(channel.bitrate / 1000)}kbps")
embed.add_field(
name="Maksgrense", value=f"{channel.user_limit} personer" if channel.user_limit != 0 else "∞ personer"
name="Maksgrense",
value=(
f"{channel.user_limit} {'person' if channel.user_limit == 1 else 'personer'}"
if channel.user_limit != 0
else "∞ personer"
),
)
if channel.category:
embed.add_field(name="Kategori", value=channel.category.name)
+2 -1
View File
@@ -280,8 +280,9 @@ class SocialCredit(commands.Cog):
db_user = CreditUser(*result)
credits = "credit" if db_user.credit_score == 1 else "credits"
embed = discord.Embed(
description=(f"{user.mention} har `{misc_utils.format_number(db_user.credit_score)}` social credits")
description=f"{user.mention} har `{misc_utils.format_number(db_user.credit_score)}` social {credits}"
)
await interaction.response.send_message(embed=embed)