Skip to main content

FastAPI Localization

Util for localization FastAPI application (powered by Fluent)

Example:

from fastapi import FastAPI
from fastapi_l10n import L10nDepends, setup_localization

setup_localization(
    allowed_locales=["en", "fr", "de"],
    default_locale="en",
    resource_ids={
        "en": ["main.ftl"],
        "fr": ["main.ftl"],
        "de": ["main.ftl"],
    }
)
app = FastAPI()

@app.get("/")
async def root(_: L10nDepends):
    return _("hello-message", args={"username": "John"})

Metadata

Release files for fastapi-l10n 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastapi-l10n 0.1.2
File Size Uploaded
fastapi_l10n-0.1.2.tar.gz 4.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-l10n 0.1.2
File Interpreter ABI Platform
fastapi_l10n-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 11.0 kB

Release files / fastapi_l10n-0.1.2.tar.gz

Download URL fastapi_l10n-0.1.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b718b6feec96826b3b92f38972fea0a9250adc7d3e93df3c33eb05192dcd1a5d
BLAKE2b-256 checksum
How to use checksums
e81b4f2d652cbabcefa714540af54c7c175126c2dbdfd78dd86d237b276bb1e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/24.1.0

Release files / fastapi_l10n-0.1.2-py3-none-any.whl

Download URL fastapi_l10n-0.1.2-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b839e23f558188b307909c2f6ea9bbbf2bf8d0c10dbd1807ed101b60a44e85fd
BLAKE2b-256 checksum
How to use checksums
82db1f8b9610537fd809794a7dd6a1a1d8fd78fa8b992028eb10c9d175a2ac6e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/24.1.0

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page