Giter VIP home page Giter VIP logo

potypo's Introduction

potypo

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

Running the tests -------------

pip install pytest python setup.py install

pytest

Current Work:

  • 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
  • prioritizing the best dict per language

potypo's People

Contributors

koebi avatar jieter avatar joker234 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.