Skip to content

Added Translation Standard and translation for Brazilian Portuguese#110

Merged
ericbsd merged 3 commits intomasterfrom
translation-pt_br
Jan 9, 2025
Merged

Added Translation Standard and translation for Brazilian Portuguese#110
ericbsd merged 3 commits intomasterfrom
translation-pt_br

Conversation

@Edu-Amorim
Copy link
Contributor

@Edu-Amorim Edu-Amorim commented Jan 5, 2025

Added translation for Brazilian Portuguese

Related to ghostbsd/issues#199

Summary by Sourcery

Add support for Brazilian Portuguese translation.

New Features:

  • Added Brazilian Portuguese translation.

Tests:

  • Added a setup command to create and update translation files.

@Edu-Amorim Edu-Amorim requested review from a team as code owners January 5, 2025 20:45
@Edu-Amorim Edu-Amorim requested a review from ericbsd January 5, 2025 20:45
@Edu-Amorim Edu-Amorim self-assigned this Jan 5, 2025
@sourcery-ai
Copy link
Contributor

sourcery-ai bot commented Jan 5, 2025

Reviewer's Guide by Sourcery

This pull request implements Brazilian Portuguese translation by adding a new translation file and incorporating translation management commands.

Sequence diagram for the new translation management process

sequenceDiagram
    participant Dev as Developer
    participant Setup as setup.py
    participant PO as .po files
    participant POT as .pot file

    alt Create New Translation
        Dev->>Setup: Run create_translation --locale=xx
        Setup->>POT: Generate/Check .pot file
        Setup->>PO: Create new .po file for locale
        PO-->>Dev: New translation file ready
    else Update Translations
        Dev->>Setup: Run update_translations
        Setup->>POT: Extract messages to .pot
        Setup->>PO: Update all .po files
        PO-->>Dev: Updated translation files
    end
Loading

Class diagram for new translation management commands

classDiagram
    class Command {
        <<interface>>
        +initialize_options()
        +finalize_options()
        +run()
    }

    class UpdateTranslationsCommand {
        +description: string
        +user_options: list
        +initialize_options()
        +finalize_options()
        +run()
    }

    class CreateTranslationCommand {
        +locale: string
        +description: string
        +user_options: list
        +initialize_options()
        +finalize_options()
        +run()
    }

    Command <|-- UpdateTranslationsCommand
    Command <|-- CreateTranslationCommand

    note for CreateTranslationCommand "New command for creating translation files"
    note for UpdateTranslationsCommand "New command for updating existing translations"
Loading

File-Level Changes

Change Details Files
Added support for translations.
  • Introduced new commands create_translation and update_translations to manage translation files.
  • Added documentation in the README on how to create translation files.
  • Created a new translation file for Brazilian Portuguese (pt_Br.po).
  • Created a template file (networkmgr.pot) for translations.
  • Removed the hardcoded translation compilation step from setup.py.
setup.py
README.md
po/networkmgr.pot
po/pt_Br.po
Updated documentation and code comments.
  • Added a section to the README about managing translations.
  • Improved a comment in net_api.py to clarify the handling of SSID strings with spaces.
  • Clarified a comment in auto-switch.py regarding the logic for stopping and restarting network interfaces.
README.md
NetworkMgr/net_api.py
src/auto-switch.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.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a 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. You can also use
    this command to specify where the summary should be inserted.

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

Overall Comments:

  • Please document the complete translation workflow in the README, including how to compile .mo files for use at runtime. The current documentation only shows how to create new translation files.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟡 Security: 1 issue found
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

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.

LGTM

@ericbsd ericbsd merged commit a09e38e into master Jan 9, 2025
1 check passed
@ericbsd ericbsd deleted the translation-pt_br branch January 9, 2025 22:52
@ericbsd ericbsd changed the title Issue 196 - Translation Add Translation Standard and translation for Brazilian Portuguese Jan 9, 2025
@ericbsd ericbsd changed the title Add Translation Standard and translation for Brazilian Portuguese Added Translation Standard and translation for Brazilian Portuguese Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants