How to Localize your Discord Bot in 2026
Discord bots reach users across the globe. If your bot replies in English-only (or whatever language you choose), you're leaving a huge portion of your audience with a worse experience. Discord eve...

Source: DEV Community
Discord bots reach users across the globe. If your bot replies in English-only (or whatever language you choose), you're leaving a huge portion of your audience with a worse experience. Discord even provides a locale field on every interaction, so you already know what language each user prefers - you just need to use it. This guide walks through building a localized Discord bot using li18n, a compile-time i18n library for TypeScript that turns your JSON message files into fully type-safe functions with zero runtime overhead. I've already wrote a guide on this some months ago, but that was with a different package - which is not designed for such stuff and also had some bugs. Why li18n? Most i18n libraries follow the same pattern: load a big JSON file at runtime, look up a string by key, interpolate variables. This works, but it has downsides: No type safety - mistyped keys and missing variables are silent bugs Runtime parsing cost on every message lookup Locale switching requires extr