Skip to main content

Internationalization library for comfortable usage

Project description

Internationalization.py

Provides simple and powerful i18n realization

Installation

With pip

pip install internationalization.py

Via Git

git clone https://github.com/cortelf/internationalization.py
cd internationalization.py
python setup.py install

Usage

Create directory for yaml files

mkdir yourdirectory

Write your yaml files

You can use .yml or .yaml file extensions

en.yml
hello_world: Hello World!
it.yml
hello_world: Ciao mondo!

In root of your app initialize singleton

from internationalization import Internationalization
from internationalization.loaders import YAMLLoader

i18n = Internationalization()
i18n.initialize(YAMLLoader("yourdirectory"))

It's ready to use in any place

from internationalization import Internationalization

i18n = Internationalization()
english = i18n.get_language("en")
italian = i18n.get_language("it")

print("English:", english.hello_world)
print("Italian:", italian.hello_world)

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

internationalization.py-0.1.1.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

internationalization.py-0.1.1-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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