Skip to content

Conversation

@ericbsd
Copy link
Member

@ericbsd ericbsd commented Aug 2, 2025

Summary by Sourcery

Remove legacy translation files and scripts, integrate DistUtilsExtra for internationalization, update translation workflow and configuration, and bump project version to 6.7.

New Features:

  • Add DistUtilsExtra-based build, build_i18n, and clean_i18n commands in setup.py to streamline translation handling

Enhancements:

  • Bump project version from 6.6 to 6.7
  • Switch msginit calls to use UTF-8 locale suffix
  • Include compiled MO files from build/mo in data_files
  • Always install networkmgr.conf to /etc/devd by default

Documentation:

  • Update README to replace legacy translation scripts with the new update_translations command

Chores:

  • Remove legacy PO, POT, and shell scripts for compiling and updating translations
  • Remove temporary file creation in setup-nic.py

@ericbsd ericbsd requested review from a team as code owners August 2, 2025 00:40
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Aug 2, 2025

Reviewer's Guide

This PR upgrades the project’s i18n workflow by removing legacy translation files and scripts, integrating DistUtilsExtra translation build/clean commands, bumping the version, simplifying data file packaging, and updating documentation and helper scripts accordingly.

Entity relationship diagram for translation files and packaging changes

erDiagram
    SETUP {
        string name
        string version
        list data_files
        dict cmdclass
    }
    LOCALE {
        string locale_code
        string po_file
        string mo_file
    }
    BUILD_MO {
        string path
    }
    SETUP ||--o{ LOCALE : includes
    SETUP ||--o{ BUILD_MO : packages
    LOCALE ||--o{ BUILD_MO : generates
Loading

Class diagram for updated setup.py translation commands integration

classDiagram
    class setup {
        +__VERSION__ : str
        +PROGRAM_VERSION : str
        +datafilelist(installbase, sourcebase)
    }
    class CreateTranslationCommand {
        +run()
    }
    class UpdateTranslationsCommand {
        +run()
    }
    class build_extra
    class build_i18n
    class clean_i18n
    setup <|-- CreateTranslationCommand
    setup <|-- UpdateTranslationsCommand
    setup ..> build_extra : uses
    setup ..> build_i18n : uses
    setup ..> clean_i18n : uses
Loading

File-Level Changes

Change Details Files
Integrate new DistUtilsExtra i18n commands and bump version
  • Imported build_extra, build_i18n, clean_i18n from DistUtilsExtra
  • Bumped project version from 6.6 to 6.7
  • Added cmdclass entries for build, build_i18n, and clean
setup.py
Overhaul translation infrastructure by removing legacy files and scripts
  • Deleted compile_translations.sh and update_translations.sh
  • Removed old POT and PO files under src/locale
  • Added POTFILES.in manifest for PO sources
  • Updated msginit invocation to enforce .UTF-8 locale
  • Redirected datafilelist to collect built .mo files from build/mo
setup.py
compile_translations.sh
update_translations.sh
src/locale/networkmgr.pot
src/locale/zh_CN/networkmgr.po
po/pt_Br.po
po/POTFILES.in
Simplify data_files packaging for locales and configs
  • Removed hard-coded .mo entries for zh_CN and ru
  • Dropped conditional etc/devd-openrc logic
  • Unconditionally include networkmgr.conf under etc/devd
  • Extended icon and locale packaging via datafilelist
setup.py
Update README to reflect new translation commands
  • Removed legacy development discussion and IRC link
  • Added instructions to run create_translation and update_translations via setup.py
README.md
Cleanup setup-nic helper by removing temporary file write
  • Dropped writing of /tmp/network- marker file
src/setup-nic.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 @ericbsd - I've reviewed your changes and they look great!

Blocking issues:

  • Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability. (link)
Prompt for AI Agents
Please address the comments from this code review:
## Security Issues

### Issue 1
<location> `setup.py:81` </location>

<issue_to_address>
**security (python.lang.security.audit.dangerous-system-call-audit):** Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability.

*Source: opengrep*
</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.

print(f"Creating new {po_file} for locale '{self.locale}'...")
os.makedirs(po_dir, exist_ok=True)
os.system(f'msginit --locale={self.locale} --input={pot_file} --output-file={po_file}')
os.system(f'msginit --locale={self.locale}.UTF-8 --input={pot_file} --output-file={po_file}')
Copy link
Contributor

Choose a reason for hiding this comment

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

security (python.lang.security.audit.dangerous-system-call-audit): Found dynamic content used in a system call. This is dangerous if external data can reach this function call because it allows a malicious actor to execute commands. Use the 'subprocess' module instead, which is easier to use without accidentally exposing a command injection vulnerability.

Source: opengrep

@github-project-automation github-project-automation bot moved this from In Review to In Progress in Development Tracker Aug 2, 2025
@ericbsd ericbsd merged commit bdbb110 into master Aug 2, 2025
1 check passed
@ericbsd ericbsd deleted the fix-il8n branch August 2, 2025 00:42
@github-project-automation github-project-automation bot moved this from In Progress to Done in Development Tracker Aug 2, 2025
@ericbsd
Copy link
Member Author

ericbsd commented Aug 16, 2025

Related to ghostbsd/issues#199

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants