Skip to content

docs: expand README localization section, add v1.0.0 to CHANGELOG#7

Merged
rolling-codes merged 1 commit intomainfrom
docs/v1.0.0-docs
Apr 26, 2026
Merged

docs: expand README localization section, add v1.0.0 to CHANGELOG#7
rolling-codes merged 1 commit intomainfrom
docs/v1.0.0-docs

Conversation

@rolling-codes
Copy link
Copy Markdown
Owner

@rolling-codes rolling-codes commented Apr 24, 2026

Expand documentation for v1.0.0 release:

  • README: Add localization guide with ctx.t() example
  • CHANGELOG: Add v1.0.0 entry (stable, 452 tests passing)
  • GitHub release: Expand release notes with highlights and getting started

Ready for merge after tests pass.

Summary by Sourcery

Document localization support and record the 1.0.0 stable release.

Documentation:

  • Add a README section describing localization setup and usage with ctx.t() and LocalizationManager.
  • Reference the full localization guide from the README for more detailed instructions.

Chores:

  • Add a 1.0.0 stable release entry to the changelog with localization highlights and test/stability notes.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 24, 2026

Reviewer's Guide

Documents 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.t

sequenceDiagram
    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
Loading

Class diagram for Bot localization and LocalizationManager

classDiagram
    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
Loading

File-Level Changes

Change Details Files
Document localization usage with ctx.t() and LocalizationManager in the README.
  • Add a new Localization section explaining multi-language support for bots.
  • Provide a JSON locale file example showing how translations are structured.
  • Show a slash command example using ctx.t() to fetch a localized response.
  • Document how to initialize Bot with LocalizationManager, register locales, and set default_locale.
  • Describe the locale fallback order and link to the full localization guide in docs/localization.md.
README.md
Add 1.0.0 stable release entry to the changelog with localization and stability highlights.
  • Add a 1.0.0 section marking it as a stable release with the release date.
  • List localization-related additions (ctx.t(), LocalizationManager, locale fallback chain) under Added.
  • Reference the merged PR that implemented localization under Merged.
  • Record stability details: 452 tests passing and no breaking changes from pre-1.0 versions.
  • Separate the new 1.0.0 entry from existing entries with a horizontal rule.
CHANGELOG.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Multi-language localization support with automatic fallback chain (user locale → guild locale → default locale → English).
  • Documentation

    • Added localization guide with examples for setting up translations and using them in commands.

v1.0.0 - Stable release with 452 passing tests and no breaking changes from prior versions.

Walkthrough

Two 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 LocalizationManager and locale fallback chain, while the README provides setup examples and usage patterns for the multi-language support system.

Changes

Cohort / File(s) Summary
Release Documentation
CHANGELOG.md, README.md
Added version 1.0.0 release notes documenting new ctx.t() API and LocalizationManager with locale fallback chain (user → guild → default → English). README section includes JSON translation file examples, command usage patterns, and initialization instructions.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hops with glee at words translated,
In many tongues, a tale narrated,
From JSON files to users' ears,
Locales cascade without fears!
Version 1.0, stability found, 🌍✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: expanding README localization documentation and adding v1.0.0 to CHANGELOG, matching the changeset content.
Description check ✅ Passed The description is directly related to the changeset, detailing the documentation expansions for v1.0.0 release including README localization guide and CHANGELOG entry.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/v1.0.0-docs

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 5057334 and e9e274e.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • README.md

Comment thread CHANGELOG.md
Comment on lines +3 to +17
## [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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Comment thread CHANGELOG.md
Comment on lines +7 to +16
### 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

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.

Comment thread CHANGELOG.md
### 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
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Comment thread README.md
Comment thread README.md
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment thread README.md
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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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.

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 26, 2026

augment review

@augmentcode
Copy link
Copy Markdown

augmentcode Bot commented Apr 26, 2026

🤖 Augment PR Summary

Summary: This PR updates documentation for the v1.0.0 release with expanded localization guidance.

Changes:

  • Adds a new README section explaining multi-language support and showing a basic ctx.t() usage example
  • Documents how to initialize Bot with a LocalizationManager and register locale files
  • Adds a 1.0.0 entry to CHANGELOG.md highlighting localization, merged work, and stability notes

Technical Notes: The docs emphasize locale resolution via fallback behavior and point readers to docs/localization.md for the full guide.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 1 suggestion posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread README.md
Build bots that speak your server's language:

```python
# Define translations in a locale file (en.json)
Copy link
Copy Markdown

@augmentcode augmentcode Bot Apr 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@rolling-codes rolling-codes merged commit 7148d48 into main Apr 26, 2026
3 of 7 checks passed
@rolling-codes rolling-codes deleted the docs/v1.0.0-docs branch April 26, 2026 22:39
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.

2 participants