Skip to main content

A simple localization package

Project description

Simple localization package for Python

Setup:

  1. Create a localization folder wherever you want in your project.

  2. Add localization files inside. This package use .json files.

    Example:

    (localization/en_EN.json)

    {
        "GREETINGS": "Hello !",
        "GOODBYE": "Goodbye !"
    }
    

    (localization/fr_FR.json)

    {
        "GREETINGS": "Bonjour !",
        "GOODBYE": "Au revoir !"
    }
    

Usage

from simple_localization import LocalizationManager

localization = LocalizationManager('../localization', 'en_EN')

It's as simple as that !

localization['GREETINGS']
>>> Hello !

You can change the language of an already existing LocalizationManager object using change_language:

localization['GREETINGS']
>>> Hello !
localization.change_language("fr_FR")
localization['GREETINGS']
>>> Bonjour !

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

simple-localization-1.0.0.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

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

simple_localization-1.0.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file simple-localization-1.0.0.tar.gz.

File metadata

  • Download URL: simple-localization-1.0.0.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for simple-localization-1.0.0.tar.gz
Algorithm Hash digest
SHA256 a92e4a6b07791bbeeeb1264ea61dc520a1e89fdca386bec393088b016b588d7c
MD5 09849e6b42b661532170e3c18e994a93
BLAKE2b-256 2eb0a37bb0689f9a05b2640b8051bff097e9e5989412de8634c5c6b6660d4830

See more details on using hashes here.

File details

Details for the file simple_localization-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: simple_localization-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for simple_localization-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4819d4bd6ef5d10d90282d47caf3dfb6441b807f051cf9eb93193b2ee10eeb4
MD5 ef210659b7aa9655f90c4e5cae9c0d9e
BLAKE2b-256 5170021f3d4f122421baf999aab44827deb0e716ff2d52719c5391e3927c0384

See more details on using hashes here.

Supported by

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