AI Translation (Gemini)

The Manhwa OCR Tool integrates with the Gemini API to provide powerful, automated translation of your OCR text. This feature allows you to quickly translate large volumes of text into various languages, with options for contextual refinement.

1. API Key Setup

Before you can use AI Translation, you must configure your Gemini API key.

  1. Go to Settings (Ctrl+,) from the menu bar or click the Settings (cog icon) button.
  2. Navigate to the Gemini API tab.
  3. Gemini API Key:
    • If you don't have an API key, you can get one from Google AI Studio (a Google account is required).
    • Enter your API key into the designated field.
  4. Gemini Model: Select your preferred Gemini Model from the dropdown (e.g., gemini-1.5-flash). Different models offer varying performance, cost, and output quality.

2. Launching the Translation Window

Once your API key is configured, launch the Translation Window by clicking the AI Translation button at the bottom-right of the Main Application Window.

Translation Window Overview

The Translation Window provides a multi-column view of your text alongside a chat interface for interacting with Gemini.

Translation Window Overview *(Placeholder: Replace with actual screenshot of the Translation Window)*

Left Panel (Comparison View)

This panel displays your source text and translation columns side-by-side, allowing for easy comparison.

Right Panel (Chat Interface)

This panel is for interacting with the Gemini API. You input prompts and view the translation responses here.

Bottom Bar

3. Generating Translations

  1. Select Source: In the Left Panel, choose the Source: profile containing the text you want to translate.
  2. Select Target: Choose the target translation column. If needed, add a new one with the + button. Ensure the Target Profile Selector in the chat panel matches this column.
  3. Write Prompt: In the chat input, type your translation instructions. For example: Translate only the Korean text to formal English, keeping all other text as is.
  4. Initiate Translation:
    • For a full translation: Ensure all rows are selected in the comparison view, then click the Send button (paper plane icon).
    • For re-translation of specific rows: Select only the rows you want to re-translate, then click the Send button (refresh arrow icon). This method cleverly includes context from surrounding (unselected) text in the prompt to Gemini, significantly improving the accuracy and coherence of the refined translation.
  5. Monitor Progress: Gemini's response will stream into the chat history, and the Progress Bar will show activity. The translated text will populate the target column in the Left Panel as it's generated.

4. Applying Translations to Your Project

After you are satisfied with the generated translations, you must apply them to your project to save them.

  1. Review and Select: In the Left Panel, use the checkboxes in each row to select the translations you want to keep.
    • If a row is checked, its text from the translation column will be saved to the new profile.
    • If a row is unchecked, its text will revert to the original Source Profile text when saved. This allows you to cherry-pick the best translations.
  2. Click the Apply to Project button in the bottom bar.
  3. A new profile (e.g., "Gemini Translation (English)") will be created in your main project, containing the selected translations.
  4. The Translation Window will close, and you can now switch to this new profile in the Main Application Window using the Profile Selector.