🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

internationalization-py

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

internationalization-py

Internationalization library for comfortable usage

0.1.4
PyPI
Maintainers
1

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)

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts