GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - codingjoe/msgcheck: Gettext file checker.

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

103 Commits
103 Commits

Folders and files

NameName
Last commit message
Last commit date
msgcheck
msgcheck
 
 
tests
tests
 
 
.gitignore
.gitignore
 
 
.travis.yml
.travis.yml
 
 
ChangeLog.adoc
ChangeLog.adoc
 
 
LICENSE.txt
LICENSE.txt
 
 
README.adoc
README.adoc
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 

Repository files navigation

msgcheck

Build Status

msgcheck performs various checks on gettext files (with extension ".po"):

  • compilation (with command msgfmt -c)

  • for each translation:

    • number of lines in translated strings

    • whitespace at beginning/end of strings

    • trailing whitespace at end of lines inside strings

    • punctuation at end of strings

    • spelling (messages and translations).

The script requires:

  • Python >= 2.7

  • the module pyenchant if spelling is checked (with option -s).

Install

Install a released version from the Python package index with pip:

$ pip install msgcheck

Or you can install via source distribution:

$ python setup.py install

Usage

Syntax:

$ msgcheck [options] file.po [file.po...]

Options:

  • -h, --help: display help message and exit

  • -c, --no-compile: do not check compilation of file (with msgfmt -c)

  • -f, --fuzzy: check fuzzy strings

  • -l, --no-lines: do not check number of lines

  • -p, --no-punct: do not check punctuation at end of strings

  • -s id|str, --spelling id|str: check spelling (id = source messages, str = translations)

  • -d <dicts>, --dicts <dicts>: comma-separated list of extra dictionaries to use (in addition to file language)

  • -P <file>, --pwl <file>: file with personal list of words used when checking spelling

  • -m, --only-misspelled: display only misspelled words (no error, line number and translation)

  • -w, --no-whitespace: do not check whitespace at beginning/end of strings

  • -W, --no-whitespace-eol: do not check whitespace at end of lines inside strings

  • -e, --extract: display all translations and exit (all checks except compilation are disabled in this mode)

  • -q, --quiet: quiet mode: only display number of errors

  • -v, --version: display version and exit

The environment variable MSGCHECK_OPTIONS can be set with some default options.

The script returns exit code 0 if all files checked are OK (0 errors or option --extract given) or it returns N: number of files with errors (N >= 1).

Example

$ msgcheck fr.po
======================================================================
/path/to/fr.po:242: [punct] end punctuation: ":" in translation, ":" not in string:
---
error
---
erreur:
======================================================================
/path/to/fr.po:262: [lines] number of lines: 1 in string, 2 in translation:
---
Message filters:
---
Filtres de
messages:
======================================================================
/path/to/fr.po:336: [whitespace] spaces at beginning: 0 in string, 1 in translation:
---
current value
---
 valeur courante
======================================================================
/path/to/fr.po: 3 errors (almost good!)

Copyright

Copyright © 2009-2017 Sébastien Helleu <[email protected]>

This file is part of msgcheck.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

About

Gettext file checker.

Resources

Readme
GPL-3.0 license

Code of conduct

Code of conduct

Security policy

Security policy
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.