Skip to main content

Set fixed languages for patterns in Lektor.

Project description

lektor-fixedlang is a plugin for the Lektor static site generator that marks some patterns in output files with lang attributes.

Why?

It might be the case that a document contains words or phrases that are in a language other than the current document’s language. If not marked properly, these parts will be processed using an incorrect language’s rules (such as for case conversion and hyphenation), and screen readers will pronounce them aloud incorrectly. For example, in Turkish, the uppercase form for i is İ, and the lowercase form for I is ı. If you use the word “Wikipedia” in Turkish text, a text-transform: uppercase CSS rule will cause it to be displayed as “WİKİPEDİA”.

To prevent this, such pieces of text have to be marked using a lang attribute, as in <span lang="en">Wikipedia</span>. This can of course be done manually when writing the content, but that’s going to be inconvenient for content writers, and it can also be easily overlooked.

Installation

To use the plugin, add it to your project:

lektor plugin add lektor-fixedlang

The plugin can be configured using the configs/fixedlang.ini file. Every section is the language code of the patterns in that section. Keys are insignificant except that they have to be unique in their sections.

Example:

[en]
1 = Wikipedia

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

lektor_fixedlang-0.5.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

lektor_fixedlang-0.5-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file lektor_fixedlang-0.5.tar.gz.

File metadata

  • Download URL: lektor_fixedlang-0.5.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.19

File hashes

Hashes for lektor_fixedlang-0.5.tar.gz
Algorithm Hash digest
SHA256 4669e1d8aa275c632e17f88f7aa3e3fb888d8d3e7853fcbc6d3b4541e358ec07
MD5 8d2b8a3c766717f8e6d58ef389c0049a
BLAKE2b-256 e1b3527cc82cda8893eb81dc562b0d6b90c5d93165bbd3e2a1d50e0da1b1d262

See more details on using hashes here.

File details

Details for the file lektor_fixedlang-0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for lektor_fixedlang-0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e6c0b0b49f0f15d0ad5d96cf30d84b96e993d9e70d9cae1b729f60e864dd7ed6
MD5 ba854e9e649873540487cf7fe86eadd6
BLAKE2b-256 78af7979d2231215d1dac10f579efe55629d00389f9ec6cebf7e8b3ef879bb26

See more details on using hashes here.

Supported by

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