Skip to content

Commit 6ad2738

Browse files
committed
init
1 parent ed03307 commit 6ad2738

25 files changed

Lines changed: 3567 additions & 0 deletions

.electron-vue/electron-preload.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const { app } = require('electron');
2+
3+
// Force set the app name to replace "Electron" in the menu bar
4+
if (app) {
5+
app.setName('Pro Translator');
6+
app.name = 'Pro Translator';
7+
}
8+
9+
// Replace document title if it contains "Electron"
10+
if (typeof document !== 'undefined') {
11+
const originalTitle = document.title;
12+
if (originalTitle && originalTitle.includes('Electron')) {
13+
document.title = originalTitle.replace('Electron', 'Pro Translator');
14+
}
15+
}

.gitignore

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
lerna-debug.log*
8+
.pnpm-debug.log*
9+
10+
# Node.js dependencies
11+
node_modules/
12+
package-lock.json
13+
yarn.lock
14+
.npm
15+
16+
# Distribution / build files
17+
dist/
18+
build/
19+
out/
20+
release/
21+
.next/
22+
.nuxt/
23+
.cache/
24+
.parcel-cache
25+
.vite/
26+
27+
# Electron build files
28+
*.dmg
29+
*.exe
30+
*.deb
31+
*.AppImage
32+
*.msi
33+
*.pkg
34+
*.zip
35+
*.tar.gz
36+
*.tgz
37+
38+
# Environment variables and secrets
39+
.env
40+
.env.local
41+
.env.development
42+
.env.test
43+
.env.production
44+
*.env.*
45+
46+
# OS generated files
47+
.DS_Store
48+
.DS_Store?
49+
._*
50+
.Spotlight-V100
51+
.Trashes
52+
ehthumbs.db
53+
Thumbs.db
54+
Icon?
55+
56+
# Editor directories and files
57+
.idea/
58+
.vscode/
59+
*.swp
60+
*.swo
61+
.vs/
62+
.project
63+
.classpath
64+
.settings/
65+
*.sublime-workspace
66+
*.sublime-project
67+
68+
# Testing and coverage
69+
coverage/
70+
.nyc_output/
71+
jest-coverage/
72+
jest.config.js
73+
74+
# Typescript artifacts
75+
*.tsbuildinfo
76+
next-env.d.ts
77+
78+
# Temp files
79+
temp/
80+
tmp/
81+
.temp/
82+
.tmp/
83+
84+
# Mac installer
85+
.dmgCanvas
86+
87+
# Windows installer
88+
installer/win/Output/
89+
installer/win/*.exe
90+
91+
# Saved user data
92+
userData/
93+
94+
# Debug symbols
95+
*.pdb
96+
*.dSYM/
97+
98+
# Personal configuration
99+
config.json
100+
settings.json
101+
credentials.json

README.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Pro Translator
2+
3+
A powerful menu bar application for macOS and Windows and Linux that allows you to instantly translate selected text using AI language models. Built with Electron.
4+
5+
![Pro Translator](./assets/screenshot.png)
6+
7+
## Features
8+
9+
- **Quick Translation**: Translate selected text from any application with a customizable keyboard shortcut
10+
- **Support for Multiple Languages**: Translate to Persian, English, and more languages
11+
- **AI-Powered Translation**: Uses advanced AI models through OpenRouter API
12+
- **Menu Bar Integration**: Stays in your menu/system tray for easy access
13+
- **Text Selection Tools**: Select, copy, and save specific portions of translations
14+
- **Dark Mode Support**: Seamlessly integrates with your system theme
15+
- **Multiple Translation Methods**:
16+
- Keyboard shortcut (Control+Shift+Q on macOS, Control+Q on Windows)
17+
- Direct input through the "Translate Now" window
18+
- Menu bar/tray context menu
19+
20+
## Installation
21+
22+
### macOS
23+
1. Download the latest `.dmg` file from the [Releases](https://github.com/yourusername/pro-translator/releases) page
24+
2. Open the `.dmg` file and drag Pro Translator to your Applications folder
25+
3. Open Pro Translator from your Applications folder
26+
4. On first launch, you may need to allow accessibility permissions
27+
28+
### Windows
29+
1. Download the latest `Pro Translator Setup x.x.x.exe` from the [Releases](https://github.com/yourusername/pro-translator/releases) page
30+
2. Run the installer and follow the on-screen instructions
31+
3. Launch Pro Translator from the Start menu
32+
33+
## Usage
34+
35+
### Setting up the API Key
36+
1. Click on the "PT" icon in the menu bar/system tray
37+
2. Select "Settings"
38+
3. Enter your OpenRouter API key
39+
4. Choose your preferred target language
40+
5. Click "Save Settings"
41+
42+
You can get an API key from [OpenRouter](https://openrouter.ai/).
43+
44+
### Translating Text
45+
1. Select text in any application
46+
2. Press the keyboard shortcut (default: Control+Shift+Q on macOS, Control+Q on Windows)
47+
3. A translation window will appear with the original and translated text
48+
4. Use the "Copy Translation" button to copy the result to your clipboard
49+
50+
### Direct Translation
51+
1. Click on the "PT" icon in the menu bar/system tray
52+
2. Select "Translate Now"
53+
3. Enter or paste text in the input field
54+
4. Choose the target language
55+
5. Click "Translate"
56+
57+
### Text Selection Features
58+
- Select specific portions of the translated or original text
59+
- Use the selection status bar to see character count
60+
- Copy selected portions with one click
61+
- Context menu support for additional options
62+
63+
## Development
64+
65+
### Prerequisites
66+
- Node.js (v16 or later)
67+
- npm
68+
69+
### Setup
70+
1. Clone the repository
71+
```bash
72+
git clone https://github.com/yourusername/pro-translator.git
73+
cd pro-translator
74+
```
75+
76+
2. Install dependencies
77+
```bash
78+
npm install
79+
```
80+
81+
3. Run the application in development mode
82+
```bash
83+
npm start
84+
```
85+
86+
### Building
87+
- Build for all platforms: `npm run build:all`
88+
- Build for macOS: `npm run build:mac`
89+
- Build for Windows: `npm run build:win`
90+
- Build for Linux: `npm run build:linux`
91+
92+
## Technical Details
93+
94+
Pro Translator is built with:
95+
- Electron
96+
- Node.js
97+
- Electron Store (for settings persistence)
98+
- OpenRouter API for AI translation
99+
100+
The application interfaces with the clipboard to capture selected text and uses platform-specific methods to ensure proper text selection across different operating systems.
101+
102+
## License
103+
104+
This project is licensed under the MIT License - see the LICENSE file for details.
105+
106+
## Acknowledgements
107+
108+
- [OpenRouter](https://openrouter.ai/) for providing the AI translation API
109+
- [Electron](https://www.electronjs.org/) for the cross-platform framework
110+
- [Vazirmatn](https://github.com/rastikerdar/vazirmatn) font for Persian text rendering

assets/app-icon.png

5.34 KB
Loading

assets/icon.icns

59.9 KB
Binary file not shown.

assets/pt-icon-bw-16.svg

Lines changed: 7 additions & 0 deletions
Loading

assets/pt-icon.ico

6 Bytes
Binary file not shown.

assets/pt-icon.png

5.34 KB
Loading

assets/screenshot.png

115 KB
Loading

assets/tray-icon.png

5.34 KB
Loading

0 commit comments

Comments
 (0)