Metadata-Version: 2.4
Name: babelfishers
Version: 0.1.1
Summary: Localization on your terms. Translate your app without breaking it.
License-Expression: Apache-2.0
License-File: LICENSE
Author: Guy Clement Kamdem
Author-email: gycks.wolf555@slmail.me
Requires-Python: >=3.11,<3.15
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: anthropic (>=1.6.0,<2.0.0)
Requires-Dist: azure-ai-translation-text (>=2.0.0,<3.0.0)
Requires-Dist: babel (>=2.18.0,<3.0.0)
Requires-Dist: beautifulsoup4 (>=4.15.0,<5.0.0)
Requires-Dist: click (>=8.4.2,<9.0.0)
Requires-Dist: deepl (>=1.30.0,<2.0.0)
Requires-Dist: google-cloud-translate (>=3.27.0,<4.0.0)
Requires-Dist: google-genai (>=2.24.0,<3.0.0)
Requires-Dist: libretranslatepy (>=2.1.4,<3.0.0)
Requires-Dist: lxml (>=6.1.0,<7.0.0)
Requires-Dist: mistralai (>=2.10.1,<3.0.0)
Requires-Dist: openai (>=3.14.1,<4.0.0)
Requires-Dist: pydantic (>=2.13.4,<3.0.0)
Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
Requires-Dist: sqlalchemy (>=2.0.51,<3.0.0)
Requires-Dist: sqlmodel (>=0.0.42,<0.0.43)
Description-Content-Type: text/markdown

<img src="https://raw.githubusercontent.com/Gycks/babelfishers/main/docs/assets/banner.svg" alt="Babel Fishers. Localization on your terms." width="640">

[![PyPI](https://img.shields.io/pypi/v/babelfishers.svg)](https://pypi.org/project/babelfishers/)
[![Python versions](https://img.shields.io/pypi/pyversions/babelfishers.svg)](https://pypi.org/project/babelfishers/)
[![License](https://img.shields.io/pypi/l/babelfishers.svg)](LICENSE)

Translate your app without breaking it.

Babel Fishers translates your localization files with the provider you choose. It protects placeholders and other parts that must never change. You pay your provider directly, and only for what you use.

Full documentation, including guides for every feature, lives at [gycks.github.io/babelfishers](https://gycks.github.io/babelfishers/).

## Install

```bash
pip install babelfishers
```

Requires Python 3.11 or newer.

## Quickstart

```bash
babelfishers init
babelfishers translate --dry-run
babelfishers translate
```

`init` asks for your source locale, your target locales and a translation provider, then writes `babelfishers.toml`. Add the files to translate under `[resources.<format>]`, set your provider's API key as an environment variable, and run `translate`.

See the [Quickstart](https://gycks.github.io/babelfishers/getting-started/quickstart/) for the full walkthrough.

```toml
[locale]
source = "en"
targets = ["fr", "de", "es"]

[engine]
provider = "deepl"

[resources.json]
paths = ["locales/[source]/*.json"]
```

## What you get

- **Ten file formats.** JSON, HTML, YAML, Java properties, Android strings, gettext, Apple strings, Flutter ARB, XLIFF, and .NET resx. Each parser follows its own format's rules.
- **Nine translation providers.** DeepL, Azure, Google Cloud Translation, LibreTranslate, OpenAI, Anthropic, Google Gemini, Mistral, and DeepSeek. Pick one as your default, or set a different provider per group of files.
- **Placeholders stay intact.** Variables such as `%s` and `{name}`, and plural rules, are protected before translation and checked afterward.
- **Glossaries.** Keep terms untranslated, fix their translation per language, or pass extra context to the provider.
- **A local translation memory.** Text that was translated once is never sent to a provider twice.
- **A dry run.** `translate --dry-run` shows what would happen without calling a provider or writing a file.
- **Continuous integration.** `babelfishers ci` runs a translation in your pipeline and opens or updates a pull request with the result, for GitHub Actions and GitLab CI/CD.

## How it works

Babel Fishers reads your project from one TOML file. It parses each source file once, protects placeholders and glossary terms, sends only the translatable text to your chosen provider, and writes the result back in the same format as the source.

You run Babel Fishers yourself, on your own files, with your own account at the provider you choose. No file has to leave your machine unless you pick a cloud provider. With a self-hosted LibreTranslate server, none does.

See [How it works](https://gycks.github.io/babelfishers/concepts/how-it-works/) for the full picture.

## Documentation

- [Getting started](https://gycks.github.io/babelfishers/getting-started/)
- [Configuration](https://gycks.github.io/babelfishers/guides/configuration/)
- [Translation providers](https://gycks.github.io/babelfishers/guides/providers/)
- [Continuous integration](https://gycks.github.io/babelfishers/guides/ci/)
- [Supported formats](https://gycks.github.io/babelfishers/formats/)
- [CLI reference](https://gycks.github.io/babelfishers/reference/cli/)

## Contributing

This project is still young and worked on when time allows. If you find a bug or have an idea, open an issue and I will take a look.

## License

Licensed under the [Apache License, Version 2.0](LICENSE).

