Giter Site home page Giter Site logo

keksuccino / linguji Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 0.0 444 KB

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

License: Apache License 2.0

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

linguji's Introduction

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, 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.

Getting Started

Download the latest release 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.

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 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 (full build) and MkvToolNix 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 by Antonio Pelusi.

linguji's People

Contributors

keksuccino avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

linguji's Issues

Lots of "invalid lines count" warning messages

Translating from English to Chinese appeared a lot [Warning] The translation engine returned an invalid number of translation lines! try again..]

How to modify the tolerance of an invalid number of translation lines?

An 8-minute subtitle took 4 to 5 hours due to a large number of invalid translation lines and a lot of attempts.

Primary Translator Gemini Pro

Add Slovak lang

Hello,
thanks for your amazig works. Please can you add support for Slovak language?
Thanks.

Make setting a Gemini API key optional

Currently the Start Translation Process button is greyed-out until something is typed into the Gemini API key text field, even when Gemini is not used as translation engine.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.