https://github.com/tirch/langrinder
Flexible internationalization (i18n) engine based on Mako templates
https://github.com/tirch/langrinder
babel i18n internationalization python telegrinder telegrinder-tool
Last synced: about 1 year ago
JSON representation
Flexible internationalization (i18n) engine based on Mako templates
- Host: GitHub
- URL: https://github.com/tirch/langrinder
- Owner: tirch
- License: mit
- Created: 2025-05-31T15:30:29.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-06-15T12:58:29.000Z (about 1 year ago)
- Last Synced: 2025-06-15T14:12:02.970Z (about 1 year ago)
- Topics: babel, i18n, internationalization, python, telegrinder, telegrinder-tool
- Language: Python
- Homepage:
- Size: 408 KB
- Stars: 4
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Why Langrinder?
- Based on mako templates. Maximum flexibility and comfort
- Flexible compilers & parsers (default: JSON compiler)
- Variety of built-in functions and integrations
## Installation
```shell
pip install "langrinder @ git+https://github.com/tirch/langrinder.git"
pip install "langrinder[telegrinder] @ git+..."
pip install "langrinder[cli] @ git+..." # Recommended
```
## Usage
- Create locales files (`locales//.mako`)
- `locales/en/main.mako`:
```mako
@start: Hello from ${html.bold('Langrinder')}!
```
- `locales/ru/main.mako`:
```mako
@start: Привет от ${html.bold('Langrinder')}!
```
- Compile translations
```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!