Skip to main content

No project description provided

Project description

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"})

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fastapi_l10n-0.1.2.tar.gz (4.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fastapi_l10n-0.1.2-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file fastapi_l10n-0.1.2.tar.gz.

File metadata

  • Download URL: fastapi_l10n-0.1.2.tar.gz
  • Upload date:
  • Size: 4.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/24.1.0

File hashes

Hashes for fastapi_l10n-0.1.2.tar.gz
Algorithm Hash digest
SHA256 b718b6feec96826b3b92f38972fea0a9250adc7d3e93df3c33eb05192dcd1a5d
MD5 e8440012a9cdadadb89d40fc0d54f399
BLAKE2b-256 e81b4f2d652cbabcefa714540af54c7c175126c2dbdfd78dd86d237b276bb1e0

See more details on using hashes here.

File details

Details for the file fastapi_l10n-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: fastapi_l10n-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.12.4 Darwin/24.1.0

File hashes

Hashes for fastapi_l10n-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b839e23f558188b307909c2f6ea9bbbf2bf8d0c10dbd1807ed101b60a44e85fd
MD5 7dae408fe4cea4cf89b659a4cd644dbf
BLAKE2b-256 82db1f8b9610537fd809794a7dd6a1a1d8fd78fa8b992028eb10c9d175a2ac6e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page