Language

You can modify the default language files and even create your own language files.

Note

The following languages are available by default:

  • English (en)

  • German (de)

Modify language files

  1. Create a JSON file with the prefix ez_ somewhere in your project.

    • If you want to modify the English language file: ez_en.json.

    • If you want to create a new language file: ez_[language].json.

    If you want to create a French language file, the file name could be ez_fr.json.

  2. Search the language files and find keys you want to override.

    • Include any keys that you want to override in your JSON file.

  3. Pass the language string into Bot() to set your language.

bot = ezcord.Bot(language="fr")  # French (loaded from ez_fr.json)

If your bot supports multiple languages, set language to auto to automatically detect the language. You can set a fallback language with default_language.

The fallback language is used when no language file is found for the detected language.

bot = ezcord.Bot(language="auto", default_language="en")

Language files

The default language file for English.
{
  "times": {
    "min": "minute",
    "sec": "second",
    "hour": "hour",
    "day": "day"
  },
  "bot": {
    "error_title": "⛔ ⨯ Error",
    "error": "An **unexpected error** has occurred. {}\nI have informed my developer about this issue.",
    "cooldown_title": "⌛ ⨯ Cooldown",
    "cooldown": "Try again {}.",
    "no_perms_title": "\uD83D\uDEA8 ⨯ Missing permissions",
    "no_perms": "I'm missing the following permissions to execute this command.",
    "no_user_perms": "You do not have permission to run this command."
  },
  "help": {
    "cmd_name": "help",
    "cmd_description": "Show all commands",
    "wrong_user": "This help command does not belong to you!",
    "placeholder": "\uD83D\uDD30 › Choose a category",
    "embed_title": "My commands",
    "default_description": "All commands of category **{}**.",
    "no_commands": "Oops, I couldn't find any commands that you have access to."
  },
  "blacklist": {
    "admin_group": "admin",
    "no_perms": "You have been banned from using this bot. If you think this is a mistake, please contact my owner.",
    "guild_error": "I left your server **{}** because you don't have permissions to use me. If you think this is a mistake, please contact my owner."
  }
}
The default language file for German.
{
  "times": {
    "min": "Minute",
    "sec": "Sekunde",
    "hour": "Stunde",
    "day": "Tag"
  },
  "bot": {
    "error_title": "⛔ ⨯ Error",
    "error": "Ein **unbekannter Fehler** ist aufgetreten. {}\nIch habe meinen Entwickler über dieses Problem informiert.",
    "cooldown_title": "⌛ ⨯ Cooldown",
    "cooldown": "Versuche es {} erneut.",
    "no_perms_title": "\uD83D\uDEA8 ⨯ Fehlende Rechte",
    "no_perms": "Mir fehlen die folgenden Berechtigungen, um diesen Befehl auszuführen.",
    "no_user_perms": "Du hast keine Rechte, um diesen Befehl auszuführen."
  },
  "help": {
    "cmd_name": "help",
    "cmd_description": "Zeigt alle Befehle an.",
    "wrong_user": "Dieser Help Command gehört dir nicht!",
    "placeholder": "\uD83D\uDD30 › Wähle eine Kategorie",
    "embed_title": "Meine Befehle",
    "default_description": "Alle Befehle der Kategorie **{}**.",
    "no_commands": "Ups, ich konnte keine Befehle finden, auf die du Zugriff hast."
  },
  "blacklist": {
    "admin_group": "admin",
    "no_perms": "Du wurdest von der Nutzung dieses Bots ausgeschlossen. Wenn du denkst, dass dies ein Fehler ist, kontaktiere meinen Owner.",
    "guild_error": "Ich habe deinen Server **{}** verlassen, da du keine Rechte hast, um mich zu nutzen. Wenn du denkst, dass dies ein Fehler ist, kontaktiere meinen Owner."
  }
}