Skip to content

Conversation

@ericbsd
Copy link
Member

@ericbsd ericbsd commented Nov 29, 2025

  • Change translation domain from 'setup-station-init' to 'setup-station' for consistent localization support across the application.

Summary by Sourcery

Bug Fixes:

  • Correct the gettext translation domain in the global translation function to align with the main application domain.

- Change translation domain from 'setup-station-init' to 'setup-station' for consistent localization support across the application.
@ericbsd ericbsd requested review from a team as code owners November 29, 2025 03:19
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Nov 29, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the global translation helper to use the correct 'setup-station' gettext domain instead of the outdated 'setup-station-init' domain, ensuring translations resolve consistently with the rest of the application.

Sequence diagram for updated get_text translation lookup

sequenceDiagram
    participant Caller
    participant data_module
    participant gettext

    Caller->>data_module: get_text(text)
    activate data_module
    data_module->>gettext: bindtextdomain(setup-station, /usr/local/share/locale)
    data_module->>gettext: textdomain(setup-station)
    data_module->>gettext: gettext(text)
    gettext-->>data_module: translated_text
    data_module-->>Caller: translated_text
    deactivate data_module
Loading

Flow diagram for get_text translation process after domain fix

flowchart TD
    A[Input text to translate] --> B[Call get_text]
    B --> C[bindtextdomain setup-station /usr/local/share/locale]
    C --> D[textdomain setup-station]
    D --> E[gettext text]
    E --> F[Return translated text]
Loading

File-Level Changes

Change Details Files
Update the gettext translation domain used by the global translation helper.
  • Change bindtextdomain to use the 'setup-station' domain while keeping the locale directory unchanged
  • Change textdomain to use the 'setup-station' domain so subsequent gettext calls look up messages in the correct catalog
  • Preserve the existing behavior of forcing a reload of translations on each call
setup_station/data.py

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

Copy link
Contributor

@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 there - I've reviewed your changes - here's some feedback:

  • Since get_text is called as a global translation helper, consider moving the bindtextdomain/textdomain calls to a one-time initialization (e.g., module import or setup function) to avoid reconfiguring gettext on every call and reduce overhead.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since `get_text` is called as a global translation helper, consider moving the `bindtextdomain`/`textdomain` calls to a one-time initialization (e.g., module import or setup function) to avoid reconfiguring gettext on every call and reduce overhead.

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.

@ericbsd ericbsd merged commit 7f74c12 into master Nov 29, 2025
2 checks passed
@ericbsd ericbsd deleted the translation-domain branch November 29, 2025 03:24
@github-project-automation github-project-automation bot moved this from In Review to Done in Development Tracker Nov 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants