[codex] EasyCord v4.1 release#5
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Reviewer's GuideIntroduces a lightweight localization system (LocalizationManager) wired through Bot, Context, and Composer, and leverages it to localize built‑in guard/permission error messages while updating docs, exports, tests, and version metadata for the 3.1.3 release. Sequence diagram for localized guard error responses via ctx.t and LocalizationManagersequenceDiagram
actor User
participant Discord
participant Bot
participant Ctx as Context
participant LM as LocalizationManager
User->>Discord: Invoke slash command
Discord->>Bot: Send interaction
Bot->>Ctx: Wrap interaction as ctx
Ctx->>Ctx: Guard checks (guild_only / permissions / cooldown)
Ctx-->>Bot: Guard fails
Ctx->>Ctx: t("errors.guild_only", default)
Ctx->>LM: format(key, locale, guild_locale, default, kwargs)
LM-->>Ctx: Localized error message
Ctx->>Discord: respond(ephemeral, content)
Discord-->>User: Show localized error text
Class diagram for LocalizationManager integration with Bot, Composer, and ContextclassDiagram
class LocalizationManager {
- str default_locale
- dict~str, dict~str~ _catalogs
+ __init__(default_locale, translations)
+ register(locale, translations) void
+ locales() list~str~
+ resolve_chain(locale, guild_locale) list~str~
+ get(key, locale, guild_locale, default) str
+ format(key, locale, guild_locale, default, **kwargs) str
}
class Bot {
+ LocalizationManager localization
+ LocalizationManager i18n
+ __init__(intents, auto_sync, localization, default_locale, translations)
}
class Composer {
- LocalizationManager _localization
- str _default_locale
- dict~str, dict~str~ _translations
+ localization(localization) Composer
+ i18n(localization) Composer
+ default_locale(locale) Composer
+ translations(translations) Composer
+ build() Bot
}
class BaseContext {
+ interaction
+ locale
+ guild_locale
+ t(key, default, locale, guild_locale, **kwargs) str
}
Bot *-- LocalizationManager : owns
Composer ..> LocalizationManager : configures
Composer --> Bot : build()
BaseContext ..> LocalizationManager : uses via interaction.client
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
These three built-in guards were emitting hardcoded English strings instead of going through the localization system introduced in v3.1.3. They now use ctx.t() with English defaults matching the prior behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Triage note: this draft release PR is obsolete/conflicting now that |
This PR carries the EasyCord v4.1 release work into the main branch.
What changed:
Validation:
GitHub release v4.1 has already been published from this branch.