Skip to content

Support AI translation for question and answer #1610

Open

Description

@hgaol

Feature request

Add AI-assisted translation for question and answer drafts.

Requirements

  • Allow users to translate question titles and content before submission.
  • Allow users to translate answer content before submission.
  • Preserve Markdown, code blocks, URLs, HTML, mentions, and placeholders.
  • Use the configured AI provider, model, and site language.
  • Provide an administrator setting to enable or disable translation.
  • Handle provider errors with actionable messages.
  • Keep translation opt-in at the editor level so users can review the generated draft before replacing their content.

Activity

  1. Adarsh-Me commented on Sep 12, 2026

    @Adarsh-Me

    /assign

  2. self-assigned this
    on Sep 12, 2026
  3. changed the title [-]Support AI translation for question and answer drafts[/-] [+]Support AI translation for question and answer[/+] on Sep 12, 2026
  4. fenbox commented on Sep 20, 2026

    @fenbox
    Member

    Hi, I have some suggestions regarding the style and interaction:

    1. Make the translation a small button placed at the end of the form.

    2. Only display it when the input text does not match the target language.

    3. After clicking, automatically replace the current form content with the translated text; there is no need for a modal to confirm, as the <input> have a built-in undo function.

    design file

    Image
  5. hgaol commented on Sep 20, 2026

    @hgaol
    MemberAuthor

    Hi @fenbox , thanks for the careful review and valuable feedback! Updated the PR to align with your suggestions.

    • Added compact, Figma-aligned translation icons to title inputs and editor
      bottom-right corners.
    • Shows “Translate into [language]” as the tooltip and accessible label.
    • Added deterministic client-side language detection using franc-min.
    • Shows the translation icon only when the input confidently differs from the site
      language.
    • Handles short cross-script text and avoids guessing ambiguous same-script text.
    • Ignores Markdown, code, URLs, HTML, mentions, and placeholders during detection.
    • Debounces detection and lazy-loads franc-min.
    • Removed the review modal.
    • Translation now immediately replaces the relevant field while preserving
      undo/edit behavior.
    • Added bottomRightAction to the editor to position the icon correctly.
    • Added six language-detection tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions