Skip to main content

Light localizing tool.

Project description

PyPI Package License: MIT

pylocals

Light localization tool.

Installation

pip install pylocals

How to use

Create locals file, e.g. locals.json. It should contain localizations like this:

{
    "default": "en",
    "en": {
        "hello": "Hello"
    },
    "ru": {
        "hello": "Привет"
    }
}

Then, write in python:

from pylocals import load

local = load('local.json')

lang = local['ru']
print(lang.hello)
# Привет

Features

Several localizations support.
locals.json:

{
    "en": {
        "hello": ["Hi", "Hello"],
        "bye": "Bye bye"
    }
}

And if we write in python:

lang.hello

Then it will return a random one.

Project details


Release history Release notifications | RSS feed

This version

1.0

Download files

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

Source Distribution

pylocals-1.0.tar.gz (2.1 kB view details)

Uploaded Source

Built Distribution

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

pylocals-1.0-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file pylocals-1.0.tar.gz.

File metadata

  • Download URL: pylocals-1.0.tar.gz
  • Upload date:
  • Size: 2.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pylocals-1.0.tar.gz
Algorithm Hash digest
SHA256 d45f29ba8775921219e203a9913fd941dbabfac68dc9aeaad387f7129951b764
MD5 b7e4eff103717028096b92de0389a1e5
BLAKE2b-256 666399f81add48479da2ad0586c55e442860c7e2177fa052e724b365301f5a00

See more details on using hashes here.

File details

Details for the file pylocals-1.0-py3-none-any.whl.

File metadata

  • Download URL: pylocals-1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pylocals-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 09dd1d202a1a2d7a197ea6afb3d246d476dda24f7b455a7aab9096ed89ab6fa5
MD5 e05c13a7a0cfa3d9b4d87b9cce459f70
BLAKE2b-256 b368531066af4f4542f474dd3749bf8962012f7e7adf091f0ce582d8250e3034

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