8000 feat: Add support for report translation by psyray · Pull Request #20 · psyray/oasis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat: Add support for report translation #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: release/v0.5.0
Choose a base branch
from

Conversation

psyray
Copy link
Owner
@psyray psyray commented Mar 24, 2025

Fix #7

Adds support for report translation to allow users to generate reports in different languages using the configured LLM model. The dashboard UI is updated to display a language flag indicating the report's language.

New Features:

  • Introduces multilingual support for reports, allowing users to specify a target language for report generation.
  • Updates the dashboard UI to display a language flag indicating the report's language.

This change introduces multilingual support for Oasis reports. Users can now specify a target language for report generation using the --lang command-line argument. The reports are translated using the configured LLM model, preserving markdown formatting and code blocks. The dashboard UI has been updated to display a language flag indicating the report's language.
@psyray psyray added the enhancement New feature or request label Mar 24, 2025
@psyray psyray self-assigned this Mar 24, 2025
Copy link
Contributor
sourcery-ai bot commented Mar 24, 2025

Reviewer's Guide by Sourcery

This pull request introduces multilingual support for Oasis reports. It allows users to specify a target language for report generation, translates the reports using a configured LLM, and updates the dashboard UI to display a language flag indicating the report's language.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Introduces report translation functionality using a configured LLM model.
  • Added a language parameter to the Report class constructor.
  • Implemented a translate_content method to translate report content using the configured LLM.
  • Added logic to create a language.txt file in the report directory to store the language code.
  • Modified the report generation process to translate content if the language is not English.
  • Added a --lang command-line argument to specify the report language.
oasis/report.py
oasis/oasis.py
oasis/analyze.py
Updates the dashboard UI to display a language flag indicating the report's language.
  • Modified the dashboard views to include a language flag in the report display.
  • Added functions to retrieve the language name and emoji for a given language code.
  • Added CSS styling for the language flags.
oasis/static/js/dashboard/views.js
oasis/static/css/dashboard.css
oasis/web.py
oasis/static/js/dashboard/utils.js

Assessment against linked issues

Issue Objective Addressed Explanation
#7 Add support for prompt localization to allow reports to be generated in different languages.

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!
  • Generate a plan of action for an issue: Comment @sourcery-ai plan on
    an issue to generate a plan of action for it.

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

@psyray psyray changed the base branch from master to release/v0.5.0 March 24, 2025 23:07
psyray added 5 commits March 25, 2025 17:42
This change simplifies the report filtering logic in the backend and improves the handling of report dates in the frontend. Filtering parameters are now consistently applied across all API endpoints, and the frontend now uses a template for displaying dates, making the code cleaner and more maintainable. The translation of report content has been removed. The language of the report is now displayed next to the date.
This change refactors the way report languages are handled in the dashboard. Instead of hardcoding language names and emojis in the JavaScript, they are now loaded from the server-side configuration. This makes it easier to manage and update the supported languages. Additionally, the dashboard refresh logic is updated to handle potential errors more gracefully, displaying an error message to the user if the refresh fails.
This change adds model emojis to the date tags displayed on the dashboard. A default format of "md" is also used if the report format is not specified.
This change introduces several enhancements to Oasis, improving reporting, analysis, and user experience. It adds support for specifying the report language, improves the handling of model selection, refactors statistics calculation, and enhances the web dashboard with better modal and tag display. Additionally, the ASCII flowchart format in reports is standardized, and the total number of findings is now included in risk summaries.
The progress bar updates during vulnerability analysis were inaccurate and have been corrected to reflect the actual progress. Previously, the main progress bar was incrementing by 0.5 for each vulnerability scan, resulting in an incorrect total progress. This change ensures the main progress bar increments by 1 for each scan, accurately representing the overall progress.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add prompt localization
1 participant
0