No description
Find a file
2024-05-06 00:57:18 +03:00
tests Switch from beautifulsoup to lxml 2024-04-29 23:25:49 +03:00
.gitignore Add tests 2024-03-01 22:34:12 +03:00
CHANGES.rst Skip unmodified pages 2024-05-03 14:33:30 +03:00
lektor_fixedlang.py Move logging to plugin environment setup 2024-05-06 00:57:18 +03:00
LICENSE.txt Use wrapper tags as section names in config file 2024-02-21 17:24:16 +03:00
pyproject.toml Skip unmodified pages 2024-05-03 14:33:30 +03:00
README.rst Switch from beautifulsoup to lxml 2024-04-29 23:25:49 +03:00
requirements-dev.txt Add test coverage checks 2024-04-29 11:48:30 +03:00
requirements.txt Switch from beautifulsoup to lxml 2024-04-29 23:25:49 +03:00

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

lektor-fixedlang
================

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

.. _Lektor: https://www.getlektor.com/