called it volta because depending on the context in italian its "turn" and it turns the languages into others i guess?
Find a file
WhatDidYouExpect 184685fdd8 Initial Commit
2025-07-06 21:14:47 +02:00
locales Initial Commit 2025-07-06 21:14:47 +02:00
volta Initial Commit 2025-07-06 21:14:47 +02:00
.gitignore Initial Commit 2025-07-06 21:14:47 +02:00
example.py Initial Commit 2025-07-06 21:14:47 +02:00
README.md Initial Commit 2025-07-06 21:14:47 +02:00

How To Use

Put your translation JSON files inside locales directories anywhere under your project or working directory.

Each JSON file must be named as the language code, e.g., en.json, es.json.

Make sure you have a .env file with a locale variable defining your default language code (eg locale=en).

Start the loader

Just import or run this script — it immediately:

Loads all translation files it finds.

Starts a background thread watching those files for any edits.

Set language

Call set_language("fr") to switch the active locale dynamically.

Fetch translations

Use _('some.key') anywhere to get the localized string.