https://github.com/elchemista/auto_gettext
A library for automatically translating Gettext `.po` files using LLM services.
https://github.com/elchemista/auto_gettext
elixir gettext llm translation
Last synced: 10 months ago
JSON representation
A library for automatically translating Gettext `.po` files using LLM services.
- Host: GitHub
- URL: https://github.com/elchemista/auto_gettext
- Owner: elchemista
- License: apache-2.0
- Created: 2025-03-28T04:31:55.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-04-25T22:24:21.000Z (about 1 year ago)
- Last Synced: 2025-04-25T22:25:05.500Z (about 1 year ago)
- Topics: elixir, gettext, llm, translation
- Language: Elixir
- Homepage:
- Size: 24.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AutoGettext
Batteries-included Mix task that scans your `priv/gettext/**/*.po`, detects
empty `msgstr ""`, asks an LLM for translations, and writes the results back.
```bash
# translate everything using the default Gemini adapter
$ mix auto_gettext.translate
# or point it somewhere else
$ mix auto_gettext.translate custom/path
```
## Installation
Add `auto_gettext` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:auto_gettext, "~> 0.1.0",
github: "elchemista/auto_gettext", branch: "master", only: :dev, runtime: false},
]
end
```
## Configuration
**Required**: `GOOGLE_API_KEY` env var.
```elixir
config :auto_gettext,
api_module: AutoGettext.API.Gemini,
translator_module: AutoGettext.GeminiTranslator,
gemini_model: "gemini-2.0-flash",
prompt_template_po: "...override prompt…"
```