A utility automating performing language transformations
Project description
Lingora
Lingora is an open source utility to automate language transformation tasks via plugins;
Overview
Transformations currently supported:
- Translation: a few basic AI access plugins, and you can write your own plugins.
- Transliteration: transliterate between Cyrillic and Latin scripts; depends on the cyrtranslit library.
Formats currently supported:
- JSON: for UI string files based on i18next standard.
- LaTeX: content files [excluding all the preamble and the rest of additional data].
Features
- Translate JSON UI string files to any supported language
- Plugin-based architecture for different AI translation services
- Currently supports OpenAI's GPT models and includes a simulator plugin for testing
- Preserves JSON structure and folder hierarchy
- Progress tracking during translation
- Web-based reviewer interface for comparing and editing translations
- Supports recursive directory scanning for JSON files
- LaTeX file transliteration between Latin and Cyrillic scripts
Installation
- Clone this repository
- Install with pipx:
pipx install .
Or install directly from PyPI (once published):
pipx install lingora
Configuration
For the OpenAI plugin, create a .env
file in the project root with:
OPENAI_API_KEY=your_api_key_here
OPENAI_MODEL=gpt-3.5-turbo # Optional, defaults to gpt-3.5-turbo
Usage
UI String Translation
# Translate UI strings from English to German
lingora ui translate en de --input-dir ./locales/en --plugin-name simulator
This will:
- Read all JSON files from the input directory
- Generate an intermediate XML representation
- Translate the content to German
- Save the translated files in the target language directory maintaining the original structure
LaTeX Transliteration
# Transliterate a LaTeX file from Latin to Cyrillic script
lingora latex transliterate -l sr-Latn input.tex output.tex
This will:
- Read the input LaTeX file
- Transliterate the content between Latin and Cyrillic scripts
- Save the transliterated content to the output file
Launch Translation Reviewer
lingora reviewer ./locales/en ./output/de
This launches a web-based interface for:
- Comparing source and translated strings
- Editing translations
- Saving changes directly to the target files
List Available Plugins
lingora list-plugins
Plugin System
The tool uses a plugin architecture to support different AI translation services. Each plugin must implement the TranslationPlugin
interface defined in plugins/base.py
.
Creating a New Plugin
- Create a new file in the
plugins
directory - Implement the
TranslationPlugin
interface - Register your plugin in
plugins/__init__.py
Example plugin structure:
from .base import TranslationPlugin
class MyTranslationPlugin(TranslationPlugin):
def translate(self, text: str, target_lang: str) -> str:
# Implement translation logic
pass
def get_name(self) -> str:
return "my_plugin"
def get_description(self) -> str:
return "Description of my plugin"
def is_configured(self) -> bool:
return True # Check if plugin is properly configured
Contributing
Contributions are welcome!
Future Plans
- #Feature: logic for handling language codes
- #Housekeeping: extensive documentation and usecase scenarios
- #Architecture: improvements regarding modularity and extensibility of the code base
- #Features: adding support for specific file types
- CSV
- TOML
- XML (HTML)
- Markdown
- #Ideas: Suggestion for additional language transformation services?!
Declarations
Credits
Artificial Intelligence
- Python code for translation motor regarding i811 JavaScript library was almost entirely done by Cursor via extremely descriptive prompts [as an experiment].
- The name was chosen among recommendations in a brainstorming session by DeepSeek [as an experiment].
- The merger between the version zero of this code base and the project LaTexTranslit was carried out by heavily relying on Windsurf Editor, a project by Codeium, as an experiment to compare Cursor with Codium.
License
Lingora, an open source utility automating performing language
transformations on documents though artificial intellegience
Copyright (C) 2025 Isaak Engineer
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file lingora-1.1.1.tar.gz
.
File metadata
- Download URL: lingora-1.1.1.tar.gz
- Upload date:
- Size: 80.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d3a90f58053f2cf83d1175db335ce1862fc9871a7f7f8b49a8d0dbad7cc24d |
|
MD5 | c027a5ce2b806490f8416d4ebc3b6703 |
|
BLAKE2b-256 | 106c8010394442940062d4c70c0272925617ecc6cdf23d778b8a8b691048f93a |
File details
Details for the file lingora-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: lingora-1.1.1-py3-none-any.whl
- Upload date:
- Size: 89.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d9eaeb1dbc2149946cfc60e602e42b9c36d9fc9e393230573989e0e8199d097a |
|
MD5 | 78ea44c3a72d00bbc25728c193c3e136 |
|
BLAKE2b-256 | 4e623d10e04a270c73f1510e60586d0a6fc2f3557e508e19d5821f06289d4603 |