Skip to content

[FEATURE] Include Current File Context in Translation #10

@FrilLab

Description

@FrilLab

Problem

Current translations only use the selected text.

This can lead to inaccurate translations because the model has no knowledge of surrounding code, comments, imports, or file structure.

For example:

borrow

The meaning depends on the current file and programming language context.

Proposed Solution

Include surrounding file content when generating translation requests.

Possible context:

  • Current file language
  • Nearby lines
  • Imports
  • Function scope
  • Class scope

The selected text remains the primary translation target.

Alternatives

  • Translate only the selected text
  • Allow users to manually provide context

Additional Context

This is the next step after basic translation.

Goal:

Selected text + current file context → better translation quality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions