Skip to main content

Taal

Taal is a framework for translating your data. It plugs in to e.g. SQLAlchemy or Kaiso, providing a TranslatableString field type and a mechanism for storing and retrieving content in multiple languages.

For use-cases where the most common interaction with the translated data is for reading, an application can be set up so that language context and translations are handled centrally, after which business logic can be written almost as it would for a single-language app.

Philosophy

Taal uses a two-phase process for managing translatable data. Upon retrieval, data is marked up as “requires translation”. Subsequently (typically higher up in the stack, e.g. in some middleware), information about which particular language we are interested in may be supplied to find the actual translation string.

Example use

class MyModel(Base):
    __tablename__ = "my_model"

    id = Column(Integer, primary_key=True)
    name = Column(TranslatableString())
>>> instance = session.query(MyModel).first()
>>> instance.name
<TranslatableString: (...)>

>>> translator = get_translator('en')
>>> translator.translate(instance.name)
"Spam"

Development

To make your life easier, create a setup.cfg file with a [pytest] section to define your database and neo4j connection strings:

$ cat setup.cfg
[pytest]
addopts= --neo4j_uri=http://... --db_uri=mysql://...

(Note that pytest gets upset if you indent the addopts line)

Release files for taal 0.8.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for taal 0.8.2
File Size Uploaded
taal-0.8.2.tar.gz 13.0 kB Details

Release files / taal-0.8.2.tar.gz

Download URL taal-0.8.2.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
28078494fa2b7d05bce5614c0c36e4009cca1954da862f9d48c24f4ac15d2fbe
BLAKE2b-256 checksum
How to use checksums
f9918836591211ec4eb5430ee6015cc3abc3c840e2b7d44389044089b8da0464
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.8.2 This release

1 release file

0.8.1

1 release file

0.8.0

1 release file

0.7.0

1 release file

0.6.1

1 release file

0.6.0

1 release file

0.5.3

1 release file

0.5.2

1 release file

0.5.1

1 release file

0.5.0

1 release file

0.4.2

1 release file

0.4.1

1 release file

0.4.0

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3.0

1 release file

0.2.0

1 release file

0.1.1

1 release file

0.1.0

1 release file

0.0.2

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page