fastkit-org/fastkit-i18n — explained in plain English
Analysis updated 2026-05-18
Add multi-language JSON translation files to a FastAPI app without writing custom locale-handling code.
Automatically detect a user's preferred language from headers, query parameters, or cookies.
Store and read translated versions of a database field like a title directly on a SQLAlchemy or SQLModel model.
Feed translated messages into Pydantic validation errors via the companion fastkit-core package.
| fastkit-org/fastkit-i18n | 0marildo/imago | 100/geotwitter | |
|---|---|---|---|
| Stars | 3 | 3 | 3 |
| Language | Python | Python | Python |
| Last pushed | — | — | 2015-09-10 |
| Maintenance | — | — | Dormant |
| Setup difficulty | easy | easy | moderate |
| Complexity | 2/5 | 2/5 | 3/5 |
| Audience | developer | general | general |
Figures from each repo's GitHub metadata at analysis time.
The database-translation feature requires installing the optional sqlalchemy extra.
fastkit-i18n adds translation and multi-language support to FastAPI, a popular Python web framework that has no built-in way to handle different languages. Normally, developers writing FastAPI apps have to manually detect a user's language, look up translated text, and handle fallback text by hand in every part of their code. This package packages all of that into one small library, inspired by how the PHP framework Laravel handles translations. At its core is a simple function that looks up translated text by a dotted key name, like "messages.welcome", pulling from JSON files organized by language code, with support for inserting variable values like a person's name directly into the translated sentence. A middleware component automatically figures out which language to use for each incoming web request, checking the browser's language header, a URL parameter, a cookie, and finally a default setting, in that order, so route handlers rarely need to think about locale at all. One of its more distinctive features lets database models built with SQLAlchemy or SQLModel, two common Python database tools, store translated versions of a field like a title or description directly, and read and write them like ordinary text. Behind the scenes it stores all languages for that field together and returns whichever one matches the current request's language, falling back to a default language if a translation is missing. The library intentionally does not try to translate technical validation error messages itself, that job is left to a companion package called fastkit-core, which builds on top of this one's translation function. This keeps fastkit-i18n small and free of extra dependencies for people who only need the translation pieces. Installation is a single pip command, and it needs Python 3.10 or newer. The database-model feature needs SQLAlchemy installed separately. It is released under the MIT license, meaning it can be freely used and modified, including in commercial projects, as long as the copyright notice is kept.
A Laravel-style i18n library for FastAPI that adds translation lookups, automatic locale detection, and translatable database model fields.
Mainly Python. The stack also includes Python, FastAPI, SQLAlchemy.
MIT license: use, modify, and share freely, including commercially, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 30min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
double-check against the repo, no cap.