Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/keksuccino/linguji

AI batch translator for subtitle files that also translates video files with subtitles!
https://github.com/keksuccino/linguji

ai ass-subtitles batch-translation deepl deeplx ffmpeg gemini gemini-pro generative-ai java large-language-models libre-translate llm mkv mkvtoolnix subtitle subtitle-translation subtitle-translator translator

Last synced: 4 months ago
JSON representation

AI batch translator for subtitle files that also translates video files with subtitles!

Awesome Lists containing this project

README

        

# Linguji

_**lingua** : Italian word for "language"._

_**jimaku** ( 字幕 / じまく ) : Japanese word for "subtitles"._


Linguji is a subtitle translator powered by AI!

It automatically batch-translates subtitle files and even video files with subtitles!

## Key Features

- **Batch Translation:** Automatically translate multiple files at once without manually choosing the next file!
- **GUI:** Everything in Linguji can be done in a GUI, so no need for manually editing configs or typing commands.
- **Supported Formats:**
- **Subtitles:** Currently handles ASS files.
- **Videos:** Works with MKV files containing ASS subtitles.
- **Translation Engines:** Linguji supports various translation engines, including Gemini Pro, DeepL, [DeepLX](https://github.com/OwO-Network/DeepLX), and Libre Translate. Choose the engine that best suits your needs.
- **Formatting Preservation:** One of Linguji's priorities is to preserve the original subtitle text formatting as good as possible during translation.
- **Advanced Error Handling:** Linguji strives to keep the translation process going by working around various errors. This includes adapting its translation process to avoid triggering the same error again, like adjusting Gemini's safety threshold after encountering profanity or safety-related blocks.
- **Fallback Translator:** The fallback translation engine is used when the primary engine fails to translate the given subtitles.


[](https://www.youtube.com/watch?v=JTlyWOfve20)

# Getting Started

Download the [latest release](https://github.com/Keksuccino/Linguji/releases) for your operating system, then run the `linguji` executable inside.

To start translating subtitle files, simply **set a valid Gemini API key** and put all your subtitle files and video files into the `input_subtitles` folder (by default) that should be at the same path as the `linguji` executable.

Now simply hit the **Start Translation Process** button and see the magic happen!

If you need help getting Linguji to work or have any questions, please join my [Discord](https://discord.gg/rhayah27GC).

# Add Custom Translatable Languages

Your language is missing from the languages menu? No problem!

You can add custom languages by adding them to the `custom_locales.json` file that gets created at the same path as Linguji's exectuable when running it for the first time.

For example, lets add a custom language to the file:

```
[
{
"name": "example_name_lowercase_without_spaces",
"display_name": "Example Display Name",
"iso": "ex",
"iso3": "exa"
},
{
"name": "example_name_lowercase_without_spaces_2",
"display_name": "Example Display Name 2",
"iso": "ex",
"iso3": "exa"
},
{
"name": "trigedasleng",
"display_name": "Trigedasleng",
"iso": "ts",
"iso3": "tri"
}
]
```

We added the fictional language `trigedasleng` below the existing two example entries.

Don't forget the **comma** after every `}`, except the very last one!

When adding **real languages**, make sure to use the correct **ISO** and **ISO-3** language codes!

There's a pretty good [list with language codes](https://www.loc.gov/standards/iso639-2/php/code_list.php) you can use for that.

The first code (3-letter-code) is the ISO-3 code, the second one (2-letter-code) is the ISO code.

If there are two or more ISO-3 codes for the same language, use the one with the `(T)` at the end, but don't include the `(T)`.

Keep an eye on the **debug log** when using custom languages, to see if the translation engines support it!

# Requirements

- Java 17

- Linguji needs [FFMPEG](https://www.gyan.dev/ffmpeg/builds/) (full build) and [MkvToolNix](https://mkvtoolnix.download/downloads.html) for video file support.

If you plan to translate video files, make sure to place all FFMPEG executables in the `ffmpeg` directory and all MkvToolNix executables in the `mkvtoolnix` directory. Both directories get created at the same path as the Linguji executable when running Linguji for the first time.

# Copyright & Licensing

Linguji © Copyright 2024 Keksuccino.

Linguji is licensed under Apache-2.0.

Linguji uses a modified version of [JavaFX Dark Theme](https://github.com/antoniopelusi/JavaFX-Dark-Theme) by Antonio Pelusi.