Skip to main content

quick-i18n

quick-i18n is a simple and efficient internationalization (i18n) library for Python applications. It allows you to manage translations using JSON files, supports dynamic language switching, and provides formatting for translation strings.

Features

  • Simple setup and integration
  • Supports multiple languages with dynamic switching
  • Uses JSON files for storing translations
  • Automatic handling of missing translations in development mode
  • Supports positional and keyword arguments for string formatting
  • Domain separation for organizing translations
  • Customizable translation directories

Installation

Install the package via pip:

pip install quick-i18n

Usage

from quicki18n import i18n

# Initialize the i18n class
t = i18n(
    languages=['en', 'es'],
    current_language='en',
    dev_mode=True  # Set to False in production
)

# Set the current language
t.set_language('es')

# Get translations
print(t('Welcome to quick-i18n sample.'))  # Translates based on the current language

# Use formatting in translations
print(t('greeting', name='Alice'))

Development Mode

When dev_mode is set to True, missing translation keys are automatically added to all language files, making it easier to manage translations during development.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for any improvements or bug fixes.

Download files

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

Source Distribution

quick_i18n-0.1.0.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

quick_i18n-0.1.0-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: quick_i18n-0.1.0.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for quick_i18n-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4f3d58427ef81bfc7e61a05fc0f5553d4fb1fd38e2c2b902d6033822c41ac97e
MD5 15fc41b995d67cdeaf6cdcefd8d93401
BLAKE2b-256 acea26e0d9344526e019c167468b7aad2a2be071c457976ec4013cd4ef9b8bcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: quick_i18n-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for quick_i18n-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ac8c6969c237718d68ac2fc49701c1a415ff72f61d249fa680705f2f7879ee6
MD5 563215d7270e372c78206b3527e339a2
BLAKE2b-256 114e865b3edff1159a1a9b74158d98b48c9ea46d3f3c2b3dffd0d365ec1fcebd

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.2

2 files

0.1.1

2 files

This release

0.1.0 This release

2 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