Skip to content

Update translations#66

Merged
ericbsd merged 3 commits intoghostbsd:masterfrom
alexax66:master
Jun 23, 2025
Merged

Update translations#66
ericbsd merged 3 commits intoghostbsd:masterfrom
alexax66:master

Conversation

@alexax66
Copy link
Contributor

@alexax66 alexax66 commented Jun 22, 2025

Summary by Sourcery

Refactor the translation update workflow to use the root update-station script and new directory layout, generate the POT file under pot/, and batch-merge multiple language PO files

Enhancements:

  • Adjust update_translations.sh to copy and process update-station in the project root instead of src
  • Change POT file output path to pot/update-station.pot
  • Expand msgmerge steps to update Chinese, French, Portuguese (Brazil), and Russian PO files

@alexax66 alexax66 requested review from a team as code owners June 22, 2025 18:46
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jun 22, 2025

Reviewer's Guide

This PR refactors the translation update script to use a new top-level directory structure for POT and PO files, extends message merging to additional languages, and adds an initial Chinese translation template.

Class diagram for translation files directory structure changes

classDiagram
    class po {
        zh_CN.po
        fr.po
        pt_br.po
        ru.po
    }
    class pot {
        update-station.pot
    }
    class update-station.py
    po <|-- update-station.py : msgmerge
    pot <|-- update-station.py : xgettext
Loading

Flow diagram for the updated translation update script

flowchart TD
    A[Copy update-station to update-station.py] --> B[Extract translatable strings with xgettext]
    B --> C[Merge messages into zh_CN.po]
    B --> D[Merge messages into fr.po]
    B --> E[Merge messages into pt_br.po]
    B --> F[Merge messages into ru.po]
    C --> G[Remove update-station.py]
    D --> G
    E --> G
    F --> G
Loading

File-Level Changes

Change Details Files
Refactor translation update script to align with new directory layout
  • Updated cp command to use root update-station script
  • Changed xgettext output path to pot/update-station.pot
  • Removed old src directory cleanup and updated rm command
update_translations.sh
Extend msgmerge calls to cover multiple languages
  • Replaced single Russian merge with merges for zh_CN, fr, pt_br, and ru
  • Pointed msgmerge targets to po/.po and po/update-station.pot
update_translations.sh
Add initial Chinese translation file
  • Created new po/zh_CN.po template
po/zh_CN.po

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 @alexax66 - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments

### Comment 1
<location> `update_translations.sh:7` </location>
<code_context>
+xgettext update-station.py -o pot/update-station.pot

-rm src/update-station.py
+msgmerge -U po/zh_CN.po po/update-station.pot
+msgmerge -U po/fr.po po/update-station.pot
+msgmerge -U po/pt_br.po po/update-station.pot
+msgmerge -U po/ru.po po/update-station.pot
+
+rm update-station.py
</code_context>

<issue_to_address>
The script now updates multiple language .po files, but the naming convention for 'pt_br.po' may be inconsistent.

Consider renaming 'pt_br.po' to 'pt_BR.po' for consistency and better compatibility with gettext conventions.
</issue_to_address>

<suggested_fix>
<<<<<<< SEARCH
msgmerge -U po/pt_br.po po/update-station.pot
=======
msgmerge -U po/pt_BR.po po/update-station.pot
>>>>>>> REPLACE

</suggested_fix>

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.

Copy link
Member

@ericbsd ericbsd left a comment

Choose a reason for hiding this comment

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

By the way, update_translations.sh will be removed. There is a new way to create and update see the README.md.

@github-project-automation github-project-automation bot moved this from In Review to In Progress in Development Tracker Jun 23, 2025
@ericbsd ericbsd merged commit d7128d0 into ghostbsd:master Jun 23, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Development Tracker Jun 23, 2025
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