docs: expand README localization section, add v1.0.0 to CHANGELOG#7
docs: expand README localization section, add v1.0.0 to CHANGELOG#7rolling-codes merged 1 commit intomainfrom
Conversation
…date release notes
Reviewer's GuideDocuments the new localization system and marks the 1.0.0 stable release in the changelog, including high-level stability and feature notes. Sequence diagram for localized command response using ctx.tsequenceDiagram
actor User
participant DiscordGateway as Discord
participant Bot
participant CommandContext as CommandContext_ctx
participant LocalizationManager
User->>DiscordGateway: Invoke slash command ping
DiscordGateway->>Bot: Slash command interaction
Bot->>CommandContext: Create context for ping
CommandContext->>LocalizationManager: t("commands.ping.response", user_locale, guild_locale)
LocalizationManager->>LocalizationManager: Try user locale
alt Translation found for user locale
LocalizationManager-->>CommandContext: Localized string
else No user-locale translation
LocalizationManager->>LocalizationManager: Try guild locale
alt Translation found for guild locale
LocalizationManager-->>CommandContext: Localized string
else No guild-locale translation
LocalizationManager->>LocalizationManager: Try default locale
alt Translation found for default locale
LocalizationManager-->>CommandContext: Localized string
else No default-locale translation
LocalizationManager-->>CommandContext: English fallback string
end
end
end
CommandContext->>DiscordGateway: Respond Pong in resolved locale
DiscordGateway-->>User: Localized Pong response
Class diagram for Bot localization and LocalizationManagerclassDiagram
class Bot {
+LocalizationManager localization
+str default_locale
+__init__(localization, default_locale)
+run(token)
}
class LocalizationManager {
+dict locales
+register(locale_code, path)
+resolve(key, user_locale, guild_locale, default_locale)
}
class CommandContext {
+LocalizationManager localization
+str user_locale
+str guild_locale
+t(key)
+respond(message)
}
Bot o-- LocalizationManager : uses
CommandContext o-- LocalizationManager : resolves_with
Bot o-- CommandContext : creates_context_for_commands
CommandContext ..> Bot : belongs_to_bot
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
📝 WalkthroughSummary by CodeRabbit
v1.0.0 - Stable release with 452 passing tests and no breaking changes from prior versions. WalkthroughTwo documentation files are updated to introduce version 1.0.0 release notes and localization feature documentation. The CHANGELOG records a stable release with a new Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@CHANGELOG.md`:
- Around line 7-16: Add a blank line after each top-level subsection heading to
satisfy markdownlint MD022: insert an empty line immediately after the headings
"### Added", "### Merged", and "### Stability" so that the content beneath each
heading is separated by one blank line; ensure you only add a single newline
after each of those headings and do not alter the heading text or the following
list items.
- Line 10: Update the CHANGELOG line that currently reads "Locale fallback
chains: user locale → guild locale → default locale → English" to accurately
reflect runtime behavior: describe the fallback as user locale → guild locale →
default_locale → language-only fallback (e.g., pt-BR → pt) instead of a
hardcoded final "English"; mention the language-only fallback step and give an
example like "pt-BR → pt" to match how resolution is implemented.
- Around line 3-17: The changelog entry uses version "1.0.0" but other entries
are 2.x and the text references "pre-1.0 versions", creating contradictory
history; either update the release header (replace "## [1.0.0] — 2026-04-24"
with the correct next semantic version such as "## [2.9.0] — 2026-04-24" to
preserve progression) or add an explicit migration/reset note under this entry
clarifying that the project performed a versioning reset (explain why and map
old versions to new ones) so readers understand the discontinuity—make the
change where the header and the release notes for this release are defined.
In `@README.md`:
- Line 61: Update the README sentence that currently reads "Translations
fallback gracefully: user locale → guild locale → default locale → English." to
accurately reflect the actual resolution: state that the fallback chain is user
locale → guild locale → default locale → language-only fallback derived from
those candidates (not necessarily English). Replace the explicit "English"
terminal node with wording like "language-only fallback from the candidate
locales" or similar so it no longer promises English as the universal last
fallback.
- Around line 54-59: The README example misuses LocalizationManager.register and
Bot(default_locale): LocalizationManager.register expects a translation mapping
(dict) not a file path, and Bot's default_locale parameter is ignored when you
pass a prepared localization via the localization= argument. Fix the example by
either (A) constructing a LocalizationManager with the desired default
(LocalizationManager(default_locale="en")), then load/parse the JSON files into
mappings and call LocalizationManager.register("en", en_mapping) and
register("es", es_mapping) before passing localization=locales to Bot, or (B) if
you want to demonstrate Bot(default_locale=...), remove the localization=
argument and let Bot create its own LocalizationManager; reference the
LocalizationManager.register method and Bot(localization=...,
default_locale=...) usage to locate the code to change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 229ebaa3-ec0f-44fa-aa45-c35c5c3de3d1
📒 Files selected for processing (2)
CHANGELOG.mdREADME.md
| ## [1.0.0] — 2026-04-24 | ||
|
|
||
| **Stable release.** | ||
|
|
||
| ### Added | ||
| - Localization system with `ctx.t()` for multi-language support | ||
| - `LocalizationManager` for registering and resolving translations | ||
| - Locale fallback chains: user locale → guild locale → default locale → English | ||
|
|
||
| ### Merged | ||
| - PR #6: Complete localization implementation | ||
|
|
||
| ### Stability | ||
| - 452 tests passing | ||
| - No breaking changes from pre-1.0 versions |
There was a problem hiding this comment.
Version history semantics are internally inconsistent.
Line 3 introduces 1.0.0, but prior entries are already 2.x (Lines 21+), and Line 17 says “pre-1.0 versions.” This makes the release narrative contradictory for users reading upgrade history.
Please either (a) keep semantic progression consistent (e.g., next release after 2.8), or (b) explicitly document a versioning reset/migration note in this entry.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 7-7: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 12-12: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 15-15: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` around lines 3 - 17, The changelog entry uses version "1.0.0"
but other entries are 2.x and the text references "pre-1.0 versions", creating
contradictory history; either update the release header (replace "## [1.0.0] —
2026-04-24" with the correct next semantic version such as "## [2.9.0] —
2026-04-24" to preserve progression) or add an explicit migration/reset note
under this entry clarifying that the project performed a versioning reset
(explain why and map old versions to new ones) so readers understand the
discontinuity—make the change where the header and the release notes for this
release are defined.
| ### Added | ||
| - Localization system with `ctx.t()` for multi-language support | ||
| - `LocalizationManager` for registering and resolving translations | ||
| - Locale fallback chains: user locale → guild locale → default locale → English | ||
|
|
||
| ### Merged | ||
| - PR #6: Complete localization implementation | ||
|
|
||
| ### Stability | ||
| - 452 tests passing |
There was a problem hiding this comment.
Fix markdownlint MD022 heading spacing warnings.
Add a blank line after headings on Line 7 (### Added), Line 12 (### Merged), and Line 15 (### Stability) to satisfy the linter.
🧰 Tools
🪛 markdownlint-cli2 (0.22.1)
[warning] 7-7: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 12-12: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 15-15: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` around lines 7 - 16, Add a blank line after each top-level
subsection heading to satisfy markdownlint MD022: insert an empty line
immediately after the headings "### Added", "### Merged", and "### Stability" so
that the content beneath each heading is separated by one blank line; ensure you
only add a single newline after each of those headings and do not alter the
heading text or the following list items.
| ### Added | ||
| - Localization system with `ctx.t()` for multi-language support | ||
| - `LocalizationManager` for registering and resolving translations | ||
| - Locale fallback chains: user locale → guild locale → default locale → English |
There was a problem hiding this comment.
Fallback chain wording is inaccurate.
Line 10 says fallback ends in “English,” but the implementation resolves user → guild → default_locale → language-only fallback (e.g., pt-BR → pt), not a hardcoded English final step.
Update this line to match runtime behavior.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@CHANGELOG.md` at line 10, Update the CHANGELOG line that currently reads
"Locale fallback chains: user locale → guild locale → default locale → English"
to accurately reflect runtime behavior: describe the fallback as user locale →
guild locale → default_locale → language-only fallback (e.g., pt-BR → pt)
instead of a hardcoded final "English"; mention the language-only fallback step
and give an example like "pt-BR → pt" to match how resolution is implemented.
| bot = Bot(localization=locales, default_locale="en") | ||
| ``` | ||
|
|
||
| Translations fallback gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide. |
There was a problem hiding this comment.
Fallback description should match actual resolution behavior.
Line 61 says the chain ends with English. The implementation actually ends with language-only fallback derived from candidates (user/guild/default), which is not necessarily English.
Please reword to avoid promising English as a universal last fallback.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@README.md` at line 61, Update the README sentence that currently reads
"Translations fallback gracefully: user locale → guild locale → default locale →
English." to accurately reflect the actual resolution: state that the fallback
chain is user locale → guild locale → default locale → language-only fallback
derived from those candidates (not necessarily English). Replace the explicit
"English" terminal node with wording like "language-only fallback from the
candidate locales" or similar so it no longer promises English as the universal
last fallback.
There was a problem hiding this comment.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="README.md" line_range="61" />
<code_context>
+bot = Bot(localization=locales, default_locale="en")
+```
+
+Translations fallback gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide.
+
## Why this exists
</code_context>
<issue_to_address>
**nitpick (typo):** Consider using "fall back" (two words) when used as a verb.
Here it’s used as a verb phrase (“Translations fall back gracefully”), so it should be two words. The noun form “fallback” elsewhere (e.g., “Locale fallback chains”) is correct as written.
```suggestion
Translations fall back gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide.
```
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| bot = Bot(localization=locales, default_locale="en") | ||
| ``` | ||
|
|
||
| Translations fallback gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide. |
There was a problem hiding this comment.
nitpick (typo): Consider using "fall back" (two words) when used as a verb.
Here it’s used as a verb phrase (“Translations fall back gracefully”), so it should be two words. The noun form “fallback” elsewhere (e.g., “Locale fallback chains”) is correct as written.
| Translations fallback gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide. | |
| Translations fall back gracefully: user locale → guild locale → default locale → English. See [`docs/localization.md`](docs/localization.md) for the full guide. |
|
augment review |
🤖 Augment PR SummarySummary: This PR updates documentation for the v1.0.0 release with expanded localization guidance. Changes:
Technical Notes: The docs emphasize locale resolution via fallback behavior and point readers to 🤖 Was this summary useful? React with 👍 or 👎 |
| Build bots that speak your server's language: | ||
|
|
||
| ```python | ||
| # Define translations in a locale file (en.json) |
There was a problem hiding this comment.
README.md:34 The fenced block is marked as python but it contains raw JSON and # comments, so it isn’t valid Python or JSON and will likely fail for copy/paste users. Consider separating the translation file example into a json block and keeping the command example in a python block (or otherwise ensuring each snippet is syntactically valid).
Severity: medium
🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.
Expand documentation for v1.0.0 release:
Ready for merge after tests pass.
Summary by Sourcery
Document localization support and record the 1.0.0 stable release.
Documentation:
Chores: