Metadata-Version: 2.4
Name: langrinder
Version: 3.2.1
Summary: Flexible internationalization engine based on Mako templates
Author-email: ventuero <amerfoe@gmail.com>
Requires-Python: <4.0,>=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: babel>=2.17.0
Requires-Dist: mako>=1.3.10
Requires-Dist: pytz>=2025.2
Requires-Dist: ujson>=5.10.0
Provides-Extra: dev
Requires-Dist: loguru>=0.7.3; extra == "dev"
Requires-Dist: ruff>=0.11.12; extra == "dev"
Provides-Extra: telegrinder
Requires-Dist: telegrinder; extra == "telegrinder"
Provides-Extra: cli
Requires-Dist: typer>=0.16.0; extra == "cli"
Dynamic: license-file

<div align="center">
    <h1>Langrinder</h1>
    <i>Flexible internationalization (i18n) engine based on <a href="https://github.com/sqlalchemy/mako">Mako</a> templates</i>
    <br><br>
    <p>
      <a href="#License"><img alt="GitHub License" src="https://img.shields.io/github/license/ventuero/langrinder.svg?color=lightGreen&labelColor=black&style=flat-square"></img></a>
      <a href="https://docs.astral.sh/ruff/"><img alt="Code Style" src="https://img.shields.io/badge/code_style-Ruff-D7FF64?logo=ruff&logoColor=fff&style=flat-square&labelColor=black"></img></a>
      <a href="https://github.com/ventuero/langrinder/blob/master/pyproject.toml"><img alt="Python versions" src="https://img.shields.io/python/required-version-toml?tomlFilePath=https%3A%2F%2Fraw.githubusercontent.com%2Fventuero%2Flangrinder%2Frefs%2Fheads%2Fmaster%2Fpyproject.toml&style=flat-square&logo=python&logoColor=fff&labelColor=black"></img></a>
      <a href="https://github.com/ventuero/langrinder/blob/master/pyproject.toml">
      <img alt="Project version" src="https://img.shields.io/badge/version-v3.2.0-black?style=flat-square&logo=python&logoColor=fff"></img></a>
    </p>
</div>

## Why Langrinder?
- Based on mako templates. Maximum flexibility and comfort
- Flexible compilers & parsers (default: JSON compiler)
- Variety of built-in functions and integrations
- Telegrinder integration

## Installation
```shell
pip install langrinder
pip install langrinder[telegrinder] # Just install latest telegrinder
pip install langrinder[cli] # Recommended
```

## Usage
- Create locales files (`locales/<locale>/<smth>.mako`)
    - `locales/en/main.mako`:
        ```mako
        @start: Hello from ${html.bold('Langrinder')}!
        ```
    - `locales/ru/main.mako`:
        ```mako
        @start: Привет от ${html.bold('Langrinder')}!
        ```
- Compile locales
    ```shell
    langrinder locales/ locales/compiled.json
    ```
- Enjoy! See our [main example](./examples/main.py) and [bot example](./examples/bot.py)!

---

## License
Langrinder licensed under [MIT license](LICENSE). Free and open-source!
