Skip to content

alirezasalehfar/translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Translator icon

Translator

A sleek macOS menu bar translator — powered by Google Gemini & Apple's on-device translation.

Lives quietly in your menu bar. No dock icon, no window clutter. Just type and translate.

Platform Swift License Download


✨ Features

🧭 Menu bar app Always a click away — no dock icon, no separate window.
🔀 Two engines Gemini (free tier, very natural output) or Apple (fully offline, no key).
Auto-translate Translates ~0.6 s after you stop typing (debounced to save quota).
📸 Screenshot translate Drag a box over any text on screen — it's recognized and translated (Gemini only).
↔️ Swap languages Flip source and target with one tap.
⚙️ Settings window Set app language & Gemini API key in one place — stored permanently.
📋 One-click copy Send the result straight to your clipboard.

Supported languages: German · English · French · Spanish · Italian


📦 Requirements

  • 🖥️ macOS 15 or newer (required for Apple's on-device translation)
  • 🔑 Optional: a free Gemini API key for the Gemini engine
  • 🛠️ Xcode 16 or newer — only if you build from source

🚀 Installation

⬇️ Download (easiest)

  1. Go to the latest release and download Translator.zip.
  2. Unzip it and drag Translator.app into your Applications folder.
  3. On first launch, right-click the app → "Open" and confirm. (This step is required because the app is not notarized by Apple. You only need to do it once.)

🔨 Build from source (for developers)

git clone [email protected]:alirezasalehfar/translator.git
cd translator
  1. Open Translator.xcodeproj in Xcode.
  2. Under Signing & Capabilities, select your Team (a free Apple account is enough for local use).
  3. Set the scheme to Release (optional), then Product → Build (⌘B).
  4. In the navigator, expand Products, right-click Translator.appShow in Finder, and drag it into Applications.

🔁 Launch at login

System Settings → General → Login Items → "Open at Login" → add Translator.app with +.


🔧 Setup

🔑 Gemini API key (for the Gemini engine)

  1. Sign in at aistudio.google.com/apikey.
  2. Create API key → new project → copy the key.
  3. In the app, click the gear ⚙️ (top-right) or press ⌘,.
  4. Paste it into Gemini API keySave & Close.

Note

The key is stored locally in the app's settings and is never part of the source code — safe to push to a public repo.

Warning

On the free tier, Google may use your input text to improve its models — don't paste sensitive content. Usage stays free as long as no billing is enabled.

📸 Screen recording permission

The first time you use screenshot translation, macOS asks for Screen Recording access:

System Settings → Privacy & Security → Screen & System Audio Recording → enable the app and restart it once.


📖 Usage

  1. Click the speech-bubble icon in the menu bar.
  2. Pick an engine: Gemini or Apple (offline).
  3. Choose source & target languages (↔ swaps direction).
  4. Type your text — it translates automatically, or hit Translate.
  5. For text inside an image, click the scan icon and drag over the area.
  6. Copy puts the result on your clipboard.

🧱 Tech overview

  • 🎨 SwiftUI with MenuBarExtra (window style) for menu bar integration
  • 🍎 Apple Translation framework (import Translation) for offline translation
  • 🤖 Google Gemini API (gemini-2.5-flash) for text & image translation
  • 💾 Settings persisted via @AppStorage (UserDefaults)
  • 🖼️ Screenshots via the system screencapture -i tool

📝 Notes

  • The app is locally self-signed. On first launch, right-click → Open if Gatekeeper complains.
  • In Gemini mode without a key, the app shows a friendly reminder to add one in Settings.

Made with SwiftUI · Runs on your Mac 🖥️

About

A sleek macOS menu bar translator powered by Google Gemini and Apple's on-device translation.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages