Metadata-Version: 2.1
Name: lektor-fixedlang
Version: 0.1
Summary: Set fixed languages for patterns in Lektor.
Author-email: "H. Turgut Uyar" <uyar@tekir.org>
License: Copyright 2024 H. Turgut Uyar <uyar@tekir.org>
        
        Redistribution and use in source and binary forms, with or without
        modification, are permitted provided that the following conditions are met:
        
        1. Redistributions of source code must retain the above copyright notice,
           this list of conditions and the following disclaimer.
        
        2. Redistributions in binary form must reproduce the above copyright notice,
           this list of conditions and the following disclaimer in the documentation
           and/or other materials provided with the distribution.
        
        3. Neither the name of the copyright holder nor the names of its contributors
           may be used to endorse or promote products derived from this software
           without specific prior written permission.
        
        THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
        ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
        WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
        DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
        FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
        DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
        SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
        CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
        OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
        OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
        
Project-URL: repository, https://github.com/uyar/lektor-fixedlang
Keywords: lektor,plugin
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Plugins
Classifier: Framework :: Lektor
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Internet :: WWW/HTTP :: Site Management
Requires-Python: ~=3.8
Description-Content-Type: text/x-rst
License-File: LICENSE.txt
Requires-Dist: lektor
Provides-Extra: style
Requires-Dist: flake8; extra == "style"
Requires-Dist: flake8-pyproject; extra == "style"
Requires-Dist: flake8-isort; extra == "style"
Requires-Dist: flake8-builtins; extra == "style"
Requires-Dist: flake8-print; extra == "style"
Provides-Extra: dev
Requires-Dist: lektor-fixedlang[style]; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Requires-Dist: tox; extra == "dev"

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

lektor-fixedlang is a plugin for the `Lektor <https://www.getlektor.com>`_
static site generator that marks some patterns in output files
with ``lang`` attributes.

Why?
----

Say you have a multilingual site where one of the languages you support
is Turkish. In Turkish, the uppercase form for ``i`` is ``İ``,
and the lowercase form for ``I`` is ``ı``. If you use an English word
containing these letters in Turkish text, a ``text-transform`` CSS rule
will cause the word to be shown incorrectly. For example, the word
"Wikipedia" transformed to uppercase will become "WİKİPEDİA".

To prevent this, you have to mark such pieces of text 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.

Although this "dotless-i / dotted-I" problem was the initial motivation
behind this plugin, it can be useful in other cases as well.

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 name of the tag that will wrap the pattern.
Every key in the section is a regular expression pattern
and the value is the language for the pattern.

Example::

  [span]
  \bWikipedia\b = en

*Note*: At the moment, regular expression matches are case insensitive.
