Skip to content

basalam/backbone-translation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Requirements

  • Python 3.6+

Installation & Upgrade

pip install basalam.backbone-translation

Usage

from backbone_translation.translator import Translator

translator = Translator({
    "messages.greeting" : "Bonjour {name}"
})

# OR translator = Translator.from_json_file("path_to_json_file")

translator.translate("messages.greeting", name="Mojtabaa")
# Bonjour Mojtabaa

Testing

# install pytest
pip install pytest

# run tests
python -m pytest

Changelog

  • 0.0.2 added from_json_file method
  • 0.0.3 Now build and push are done using gitlab-ci
  • 0.0.4 new exists(phrase: str) -> bool method
  • 0.1.0 added utf-8 encoding thanks to [email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages