Skip to content

Commit

Permalink
Add README
Browse files Browse the repository at this point in the history
  • Loading branch information
naghim committed Mar 9, 2024
1 parent 9cd978f commit 36c46ee
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 8 deletions.
59 changes: 59 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# <p align='center'>{ Sub<span style="color: #d9073f">Assistant }</span></p>

<p align='justify'>This is a specialized desktop application designed to simplify the translation process for subtitle files, specifically for the <code>.ass</code> (Advanced SubStation Alpha) format. Tailored for translators, SubAssistant facilitates seamless collaboration by allowing users to comment out the original dialogue text, write their translations alongside it, and enable proofreaders or quality checkers to review both versions within the same file. Users also have the possibilitiy to delete the commented out texts, doing so the application enhances the efficiency and accuracy of subtitle translation workflows.</p>

<p align="center">
<img width="400" src="https://i.imgur.com/vvzOFnF.png"" alt="SubAssistant screenshot"/>
</p>

## Installation

### Windows

1. Download the latest release from the [Releases](https://github.com/naghim/SubAssistant/releases) page.
2. Double-click the downloaded `.exe` file to launch the application.

### Linux and macOS

Currently, there is no standalone executable for Linux and macOS. You can still run SubAssistant using Python as described below.

### Using Python

#### Pre-requisites

- Ensure you have Python 3.12 installed on your system.
- Make sure `pip` is installed. You can check by running `pip --version` in your terminal.

#### Installation Steps

1. Clone this repository to your local machine:

```bash
git clone https://github.com/naghim/SubAssistant.git
```

2. Navigate to the project directory:

```bash
cd SubAssistant
```

3. Install the required dependencies:

```bash
pip install -r requirements.txt
```

4. Run the application:

```bash
python -m subassistant
```

## FAQ

<p align='justify'><b> 👀 How to use SubAssistant?</b> </br> Using SubAssistant is a piece of cake! Choose the action you wish to take from the side menu—whether to comment out text or delete comments. Use the "Select File" button to open the .ass file. The program will automatically propose an output filename within the same folder. If you prefer a different folder or wish to rename the output, utilize the "Browse" button or directly edit the output path. Upon clicking the button, the selected operation will be executed.</p>

<p align='justify'><b> 👀 Can SubAssistant mess up my subtitles?</b> </br> No, SubAssistant will always generate a new file with the modifications, does not do any editing in the input file, so your subtitles are safe!</p>

<p align='justify'><b> 👀 Can SubAssistant handle <code>.srt</code> files?</b></br> No, currently SubAssistant does not support <code>.srt</code> files. </p>
3 changes: 2 additions & 1 deletion subassistant/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
from PySide6.QtWidgets import QApplication
from subassistant.globals import RESOURCES_DIR
from subassistant.gui.window import SubAssistantWindow
import os

if __name__ == "__main__":
app = QApplication(sys.argv)

with open(f'{RESOURCES_DIR}/styles.css', "r") as f:
with open(os.path.join(RESOURCES_DIR, 'styles.css'), 'r') as f:
app.setStyleSheet(f.read())

window = SubAssistantWindow()
Expand Down
5 changes: 4 additions & 1 deletion subassistant/globals.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import os

BASE_DIR = os.path.dirname(__file__)
RESOURCES_DIR = f'{BASE_DIR}/resources'
RESOURCES_DIR = os.path.join(BASE_DIR, 'resources')

with open('baseres_dir.txt', 'w') as f:
f.write(BASE_DIR)
2 changes: 1 addition & 1 deletion subassistant/gui/tab.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def initUI(self):
self.text_logo = QLabel("<html><head/><body><p align='center'>Sub<span style=\"color: #d9073f\">Assistant</span></p></body></html>"
)

self.text = QLabel("<html><head/><body><p align='justify'><b> 👀 What is this?</b> This is a specialized desktop application designed to simplify the translation process for subtitle files, specifically .ass (Advanced SubStation Alpha) format. Tailored for translators, CommentOut facilitates seamless collaboration by allowing users to comment out the original English dialogue text, write their translations alongside it, and enable proofreaders or quality checkers to review both versions within the same file. By providing a unified platform for bilingual text management, this application enhances the efficiency and accuracy of subtitle translation workflows.</p></body></html>"
self.text = QLabel("<html><head/><body><p align='justify'><b> 👀 What is this?</b> SubAssistant is a specialized desktop application designed to simplify the translation process for subtitle files, specifically for the .ass (Advanced SubStation Alpha) format. Tailored for translators, SubAssistant facilitates seamless collaboration by allowing users to comment out the original dialogue text, write their translations alongside it, and enable proofreaders or quality checkers to review both versions within the same file. Users also have the possibilitiy to delete the commented out texts, doing so the application enhances the efficiency and accuracy of subtitle translation workflows.</p></body></html>"
)

self.text_how_to = QLabel("<html><head/><body><p align='justify'><b> 👀 How to use?</b> Choose the action you wish to take from the side menu—whether to comment out text or delete comments. Use the \"Select File\" button to open the .ass file. The program will automatically propose an output filename within the same folder. If you prefer a different folder or wish to rename the output, utilize the \"Browse\" button or directly edit the output path. Upon clicking the button, the selected operation will be executed.</p></body></html>"
Expand Down
10 changes: 5 additions & 5 deletions subassistant/gui/window.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import sys
from PySide6.QtGui import QIcon
from PySide6.QtWidgets import QTabWidget, QWidget, QVBoxLayout
from subassistant.globals import RESOURCES_DIR
from subassistant.gui.tab import CommentTab, RemoveCommentTab, AboutTab
import os

class SubAssistantWindow(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("SubAssistant")
self.setWindowIcon(QIcon(f'{RESOURCES_DIR}/curly_braces_icon.png'))
self.setWindowIcon(QIcon(os.path.join(RESOURCES_DIR, 'curly_braces_icon.png')))
self.setFixedSize(550, 350)
self.initUI()

Expand All @@ -18,9 +18,9 @@ def initUI(self):
self.tab_widget = QTabWidget()
self.tab_widget.setTabPosition(QTabWidget.West)

self.tab_widget.addTab(CommentTab(), QIcon(f'{RESOURCES_DIR}/curly_braces.png'), "")
self.tab_widget.addTab(RemoveCommentTab(), QIcon(f'{RESOURCES_DIR}/no_curly_braces.png'), "")
self.tab_widget.addTab(AboutTab(), QIcon(f'{RESOURCES_DIR}//about.png'), "")
self.tab_widget.addTab(CommentTab(), QIcon(os.path.join(RESOURCES_DIR, 'curly_braces.png')), "")
self.tab_widget.addTab(RemoveCommentTab(), QIcon(os.path.join(RESOURCES_DIR, 'no_curly_braces.png')), "")
self.tab_widget.addTab(AboutTab(), QIcon(os.path.join(RESOURCES_DIR, 'about.png')), "")


self.tab_widget.setStyleSheet("QTabBar::tab { height: 60px; width: 100px;}")
Expand Down

0 comments on commit 36c46ee

Please sign in to comment.