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.0.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.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: fastapi_l10n-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4d6c0f35544d93b38bc500de8487dcaffc663e4daffc3093848390f27571ae28
MD5 cadc8680bdd19de747903c32f6a4268b
BLAKE2b-256 048721d905ea9a4f5bf3a4deb40a45875d3cfca2b18299d70c5c0a2568cf2876

See more details on using hashes here.

File details

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

File metadata

  • Download URL: fastapi_l10n-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 470265e0ab617249c475f23facb709866574fe912aacd6ab6a4076529d059ded
MD5 50c1c991e1e46d361a9137db4c7a570e
BLAKE2b-256 0e7a4eb02ad1cf3c50404b001f12798f0f262d965a1df22e356f22353d50b865

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