Skip to main content

spellchecking for .po-files

Project description

Spellchecking for translation using .po-files. This is currently work-in-progress. This project is specifically tailored to be used with django-applications, but may be used in any project that uses .po-files for translation.

Installation

potypo is available via pip3 install potypo Note that this is not considered stable and might be subject to massive changes. Please do use it, and report any problems encountered :)

Configuration

Configuration is done in a configuration file called setup.cfg. It follows the configuration file format used in most of the python world, thus it can be easily used with similar files that are used for other projects, i.e. flake8, isort or others.

This is an example configuration for potypo.

[potypo]
# This is the default language of the application, and the language that is
# translated from. It follows the locale tag naming scheme.
default_language = en_US

# This is the directory that contains the .po-files.
# It follows the structure <lang>/LC_MESSAGES/django{js}.po where <lang> is the
# language that is translated into.
locales_dir = /path/to/my/projects/locales

# This is the directory containing word lists with words that are not included
# in the corresponding language dictionary, since they are application-specific,
# uncommon inflections or otherwise special.
# The wordlists only need to contain uncapitalized words.
# They should be named according to the language they belong to in the format
# <lang>.txt, i.e. for the language "en_US", the file should be named
# "en_US.txt".
# They can also be placed in the language- or .po-file-directory
wl_dir = /path/to/my/projects/wordlists

# For easy CI-Integration, potypo will issue an exit(1) if any errors have been encountered.
# If there are languages for which this is not wanted, they should be added to this list.
no_fail =
    fr
    pt_BR

# Because of how the spell-checking work, some words might be output as "wrong",
# even though they are correctly spelled. This will for example happen to
# hyphenated words where a part is not a correct word on its own, abbreviations
# containing numbers, webpages, …
# This is a list containing those words, so that they can be filtered.
edgecase_words =
    add-ons
    MT940
    pre-selected
    myblog.org
    myproject.org-Blog
    myproject.org-Server
    4th

# Similar to the above edgecase words, there might be complete phrases that are used
# in a language although not being from that language, i.e. the phrase "powered
# by" being used in a german text.
# This is a list containing these phrases, so that they can be filtered.
phrases =
    powered by

# This is a list of filters and chunkers to be used by the spell checking
# process.
chunkers = enchant.tokenize.HTMLChunker
filters = PythonFormatFilter,enchant.tokenize.URLFilter,HTMLFilter

Current Work:

  • add config option for languages that should not fail

  • enhance README

  • find .po-files recursively?

  • move this list to issues

  • finish setting up testsetup * change .po-files * set up setup.cfg * find out how to start potypo correctly

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

potypo-0.0.2.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

potypo-0.0.2-py3-none-any.whl (9.2 kB view details)

Uploaded Python 3

File details

Details for the file potypo-0.0.2.tar.gz.

File metadata

  • Download URL: potypo-0.0.2.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for potypo-0.0.2.tar.gz
Algorithm Hash digest
SHA256 51dd9592608e54de87ca2087e4090aa356148150d7c9e6db70b36bac2194e32d
MD5 49e72c41f26afd660292d696fc2ab76e
BLAKE2b-256 cf17a733904540a3ce401af1b2ad336559d87832ee9c3caef08c7d8ab4a79e3d

See more details on using hashes here.

File details

Details for the file potypo-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for potypo-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1d8efe5ebb3d584fe1a9d121d9d9536c7214edf6660a39af8ce92090e1d05eac
MD5 5c7867dd0182b73d2164a4cc84c79e73
BLAKE2b-256 943be36e09cfeab743de3ca26373d15599748c4aa9251d86f315b60f0da44d47

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