Skip to content

feat: Add Chinese (zh_CN) language support for reports#461

Open
WinJayX wants to merge 1 commit intocnescatlab:devfrom
WinJayX:feature/chinese-language-support
Open

feat: Add Chinese (zh_CN) language support for reports#461
WinJayX wants to merge 1 commit intocnescatlab:devfrom
WinJayX:feature/chinese-language-support

Conversation

@WinJayX
Copy link
Copy Markdown

@WinJayX WinJayX commented Jan 22, 2026

  • Add messages_zh_CN.properties with complete Chinese translations
  • Add Chinese Markdown report template (code-analysis-template_zh_CN.md)
  • Update StringManager to support locale-based message loading
  • Update MarkdownExporter to use locale-specific templates
  • Add zh_CN to supported languages in plugin.properties
  • Update frontend to support language selection

This feature enables Chinese users to generate reports in their native language, improving accessibility for the Chinese SonarQube community.

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request. If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to this software?

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

Issues closed by changes

List here all issues closed by your changes. Use a list of items like - [x] Close #0

  • Close #0

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • I have read the CONTRIBUTING doc
  • I agree with the CODE OF CONDUCT
  • Lint and unit tests pass locally with my changes
  • SonarCloud and Travis CI tests pass with my changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

- Add messages_zh_CN.properties with complete Chinese translations
- Add Chinese Markdown report template (code-analysis-template_zh_CN.md)
- Update StringManager to support locale-based message loading
- Update MarkdownExporter to use locale-specific templates
- Add zh_CN to supported languages in plugin.properties
- Update frontend to support language selection

This feature enables Chinese users to generate reports in their native language,
improving accessibility for the Chinese SonarQube community.
@WinJayX
Copy link
Copy Markdown
Author

WinJayX commented Jan 22, 2026

⚠️ Important Note about Version Compatibility

Hello maintainers,
This PR was developed based on tag 4.3.0 to add Chinese language support. I noticed that the current dev branch is at version 5.x, which has significant structural changes (e.g., src/main/js/components/ has been moved to src/main/js/global_page/components/).
Due to these differences, there are merge conflicts that I cannot resolve directly.

Options for maintainers:

  1. Create a maintenance branch for 4.x - If you still maintain the 4.x line, I can rebase my changes onto a maintenance/4.x branch.
  2. Port to 5.x - If you prefer, I can study the 5.x codebase and submit a new PR adapted for the current architecture.
  3. Manual merge - You can manually cherry-pick the i18n-related changes into 5.x if that's easier.

What this PR includes:

  • Complete Chinese (zh_CN) translations (messages_zh_CN.properties)
  • Chinese Markdown report template
  • Locale-aware message loading in StringManager.java
  • Template selection logic in MarkdownExporter.java
    I'm happy to assist with whatever approach works best for the project. Please let me know how you'd like to proceed.
    Thank you for your time! 🙏

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant