Skip to content

feat(i18n): add Brazilian Portuguese (pt-BR) locale support#4009

Merged
xieyxclack merged 3 commits intoagentscope-ai:mainfrom
Jailtonfonseca:feat/i18n-pt-BR
May 6, 2026
Merged

feat(i18n): add Brazilian Portuguese (pt-BR) locale support#4009
xieyxclack merged 3 commits intoagentscope-ai:mainfrom
Jailtonfonseca:feat/i18n-pt-BR

Conversation

@Jailtonfonseca
Copy link
Copy Markdown
Contributor

@Jailtonfonseca Jailtonfonseca commented May 2, 2026

Description

Add Brazilian Portuguese (pt-BR) language support to QwenPaw Console and Website.

Type of Change

  • New Feature (non-breaking change which adds functionality)

Components Affected

  • Console
  • Documentation / Website

What's included

Console

  • New file: console/src/locales/pt-BR.json — ~46% of strings translated
  • Modified: console/src/i18n.ts — register pt-BR locale
  • Modified: console/src/components/LanguageSwitcher/index.tsx — added "Português (Brasil)" option

Website

  • New file: website/src/i18n/locales/pt-BR.jsonfull website translation
  • Modified: website/src/i18n/index.ts — register pt-BR locale

Translation coverage

Area Coverage
Console ~46% (rule-based + dictionary approach; higher coverage on core UI sections)
Website 100% (fully translated and reviewed)

How to test

  1. Open QwenPaw Console
  2. Click the language switcher (top right corner)
  3. Select "Português (Brasil)"
  4. The UI will display in Portuguese

Checklist

  • pre-commit run --all-files — all hooks passed on modified files
    • check-json: passed
    • trailing-whitespace: passed
    • detect-private-key: passed
  • Tests (pytest or as applicable) — limited to changes in locale/config files only
  • Documentation updated — new locale files follow existing structure

Future improvements

The console translation is an initial foundation (~46%). Strings still in English need manual refinement. Community contributions are welcome to reach full coverage!

🇧🇷 This translation was AI-assisted and reviewed for quality.

Add pt-BR locale files for both console and website:
- console/src/locales/pt-BR.json (translated console UI)
- website/src/i18n/locales/pt-BR.json (translated website)
- Update i18n.ts configs to register pt-BR locale
- Add pt-BR option to LanguageSwitcher component

The console translation covers ~46% of strings with automated
translation rules. The website translation is complete.
Both serve as a solid foundation for community refinement.
@github-project-automation github-project-automation Bot moved this to Todo in QwenPaw May 2, 2026
@github-actions github-actions Bot added the first-time-contributor PR created by a first time contributor label May 2, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

Welcome to QwenPaw! 🐾

Hi @Jailtonfonseca, thank you for your first Pull Request! 🎉

📋 About PR Template

To help maintainers review your PR faster, please make sure to include:

  • Description - What this PR does and why
  • Type of Change - Bug fix / Feature / Breaking change / Documentation / Refactoring
  • Component(s) Affected - Core / Console / Channels / Skills / CLI / Documentation / Tests / CI/CD / Scripts
  • Checklist:
    • Run and pass pre-commit run --all-files
    • Run and pass relevant tests (pytest or as applicable)
    • Update documentation if needed
  • Testing - How to test these changes
  • Local Verification Evidence:
    pre-commit run --all-files
    # paste summary result
    
    pytest
    # paste summary result

Complete PR information helps speed up the review process. You can edit the PR description to add these details.

🙌 Join Developer Community

Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:
https://qwenpaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.

@Jailtonfonseca Jailtonfonseca changed the title feat(i18n): adicionar suporte ao idioma Português (Brasil) - pt-BR feat(i18n): add Brazilian Portuguese (pt-BR) locale support May 2, 2026
@xieyxclack xieyxclack requested a review from zhaozhuang521 May 3, 2026 03:08
@xieyxclack
Copy link
Copy Markdown
Member

@Jailtonfonseca Thank you for your contribution! Please format the code, refer to https://github.com/agentscope-ai/QwenPaw/blob/main/CONTRIBUTING.md#4-code-and-quality

@Jailtonfonseca
Copy link
Copy Markdown
Contributor Author

Thanks for the review! I've run prettier formatting as requested — the pt-BR.json file was missing a trailing newline, now fixed. ✅

Note: the console's full dependencies couldn't be installed due to registry restrictions on this environment, but the affected files have been formatted correctly with prettier.

pre-commit checks also passed (check-json, trailing-whitespace, detect-private-key).

@xieyxclack
Copy link
Copy Markdown
Member

@Jailtonfonseca I tested it and found that after switching to pt-BR on the console page, the language switch button disappears and there is no way to switch to other languages. Could you double check if it's working properly on your end?

Language codes with hyphens (e.g. pt-BR) were incorrectly stripped
to their base code ("pt") via split("-")[0], causing the switch
button to disappear since no icon/key matched.

Now checks against known language codes first before splitting.
@Jailtonfonseca
Copy link
Copy Markdown
Contributor Author

Jailtonfonseca commented May 5, 2026

@xieyxclack Great observation! The bug was that currentLanguage.split("-")[0] was converting "pt-BR" to just "pt", which didn't match any icon or menu key — so the button simply disappeared.

Fixed: checking known language codes first before splitting. The button now works correctly when switching to pt-BR and vice versa.

Could you test again? 🙏

@xieyxclack xieyxclack self-requested a review May 6, 2026 10:17
Copy link
Copy Markdown
Member

@xieyxclack xieyxclack left a comment

Choose a reason for hiding this comment

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

LGTM

@xieyxclack
Copy link
Copy Markdown
Member

@Jailtonfonseca Thank you again for your contribution!

@xieyxclack xieyxclack merged commit bc5a81e into agentscope-ai:main May 6, 2026
4 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in QwenPaw May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Welcome to QwenPaw! 🎉

Thank you @Jailtonfonseca for your first contribution! Your PR has been merged. 🚀

We'd love to give you a shout-out in our release notes! If you're comfortable sharing, please reply to this comment with your social media handles using the format below:

discord: your_discord_handle
x: your_x_handle
xiaohongshu: your_xiaohongshu_id

Note: Only share what you're comfortable with — all fields are optional.

Thanks again for helping make QwenPaw better!

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

Labels

first-time-contributor PR created by a first time contributor Under Review

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants