Skip to content

Localize profile badge + fix badges applying while plugin disabled#1

Open
TomFront wants to merge 1 commit into
mainfrom
profile-badge-i18n-and-toggle-fix
Open

Localize profile badge + fix badges applying while plugin disabled#1
TomFront wants to merge 1 commit into
mainfrom
profile-badge-i18n-and-toggle-fix

Conversation

@TomFront

@TomFront TomFront commented Jul 8, 2026

Copy link
Copy Markdown
Owner

What changed

Two changes in ServerBadges/index.tsx:

1. Localized the "Partnered Server Owner" profile badge tooltip.
Discord localizes this string server-side for real badges, so the client doesn't ship it. Added a per-locale label map keyed on LocaleStore.locale (exact locale -> language prefix -> English fallback), re-rendering on locale change. en-US, en-GB, and fr are confirmed as Discord's exact wording; the remaining ~28 locales are best-effort translations (flagged in-code) that may differ slightly from Discord's official phrasing.

2. Fixed badges applying while the plugin is toggled off.
The settings panel runs even when the plugin is disabled, and changing a dropdown called the injection directly - so the server badge could be set/persist with the plugin off, inconsistent with the profile badge. All injection is now gated behind an enabled flag that only start()/stop() control, and stop() now fully undoes every surface (header/GuildStore, server-profile card/GuildProfileStore, invite embed/InviteStore, profile badge) via a new removeAllInjections() - previously it only cleaned the header + profile badge.

Reviewer notes

  • Everything remains client-side/cosmetic; only the local view changes.
  • Caveat: after toggling off, the currently-visible header may show the badge until it next re-renders (data is cleared, but no forced GUILD_UPDATE dispatch by design). Switching channels clears it.
  • The best-effort translations are the main thing worth a second look.

🤖 Generated with Claude Code

- Add per-locale labels for the Partnered Server Owner profile badge via LocaleStore, covering Discord's supported languages with English fallback (en-US/en-GB/fr confirmed, the rest best-effort).
- Gate all injection behind an `enabled` flag so the settings panel can no longer inject while the plugin is toggled off.
- On stop(), fully undo injections across every surface (header, server-profile card, invite embed, profile badge) via removeAllInjections().

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant