https://github.com/planetis-m/fix_fuzzy
https://github.com/planetis-m/fix_fuzzy
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/planetis-m/fix_fuzzy
- Owner: planetis-m
- Created: 2024-09-15T07:19:48.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-01-08T13:16:44.000Z (5 months ago)
- Last Synced: 2025-04-05T07:31:56.080Z (2 months ago)
- Language: Python
- Size: 303 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Translation Assistance Tools
### Fuzzy Message Repair ToolThis Python script helps improve the quality of translated content
by addressing messages marked as "fuzzy" in translation files.
It offers several automated fixes:1. Intelligent ampersand insertion:
Adds ampersand characters for keyboard shortcuts, using the target
language's letter frequencies as a guide.2. Case adjustment:
Modifies capitalization to match the source text more closely.
3. Punctuation refinement:
Performs simple substitutions, such as replacing "..." with "…"
for improved typography.By automating these common adjustments, this tool streamlines the
translation review process and enhances overall text consistency.
### Fuzzy Editor Tool
An editor tool that allows for interactive processing of the .po files.
## Installation
### Prerequisites- Python 3.x
- pip (Python's package installer)### Steps
1. **Clone the repository:**
```sh
git clone https://github.com/planetis/fix_fuzzy.git
cd fix_fuzzy
```2. **Create and activate a virtual environment:**
```sh
python -m venv venv
```- On Windows:
```sh
venv\Scripts\activate
```
- On macOS and Linux:
```sh
source venv/bin/activate
```3. **Install the dependencies:**
```sh
pip install -r requirements.txt
```## Usage
### Repair ToolThe Repair Tool automatically fixes fuzzy entries and saves the results.
```sh
python fuzzy_repair_tool.py /path/to/directory
```### Editor
The Editor allows you to manually review and edit fuzzy entries.
```sh
python fuzzy_editor.py /path/to/directory [options]
```#### Options:
- `--filter-type`: Choose the filtering method
- `whitespace_punctuation`: Filter based on whitespace and punctuation
- `character_difference`: Filter based on character differences
- `--no-filter`: Disable filtering
- `--max-char-diff N`: Set maximum character difference (default: 2)#### Editor Interface:
When using the Editor, you'll see the currently selected fuzzy entry and the following options:
- `[E]dit`: Edit the current entry
- `[W]rite`: Save changes and move to the next entry
- `[S]kip`: Skip the current entry without changes#### Editing Notes:
- Press Enter to add a newline
- Press Esc and then Enter to save the current change and continue to the next entry
- Press Ctrl+E to open the system's default editor ($EDITOR)
- Press Ctrl+C at any time to exit the program, saving current progress