plint

French poetry validator (local mirror of https://gitlab.com/a3nm/plint)
git clone https://a3nm.net/git/plint/
Log | Files | Refs | README

commit 9dc9497fe3198f15c344d4d62f0c7d8633500832
parent dad5531d676b97e6b8f6bb4727e8aa55cf6ac57c
Author: Antoine Amarilli <a3nm@a3nm.net>
Date:   Sun, 15 Jul 2012 15:25:22 +0200

improve reporting

Diffstat:
error.py | 14+++++++-------
res/messages_fr.po | 29+++++++++++++++--------------
2 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/error.py b/error.py @@ -70,7 +70,7 @@ class ErrorBadRhyme(Error): # TODO don't indicate more than the minimal required rhyme (in length and # present of a vowel phoneme) return Error.report(self, - _("Bad rhyme %s for type %s (expected %s, inferred %s)") + _("Bad rhyme %s for type %s (expected %s, inferred \"%s\")") % (self.kind, self.get_id(), self.fmt(self.expected), self.fmt(self.inferred)), short) @@ -94,8 +94,8 @@ class ErrorBadRhymeSound(ErrorBadRhyme): ok = [] if len(pron) > 0: ok.append("") - return ('/'.join(list(set([common.to_xsampa(x[-4:]) for x in pron]))) + - _(" (ending: ") + l.eye + ")") + return ("\"" + '/'.join(list(set([common.to_xsampa(x[-4:]) for x in pron]))) + + "\"" + _(" (ending: \"") + l.eye + "\")") def get_id(self): return self.pattern.myid @@ -176,13 +176,13 @@ class ErrorBadMetric(Error): truncated = num < len(self.possible) return Error.report( self, - (_("Bad metric (expected %s, inferred %d option%s)") % + (_("Bad metric (expected %s, inferred %d illegal option%s)") % (self.pattern.metric, len(self.possible), ('s' if len(self.possible) != 1 else ''))), short, list(map(self.align, self.possible[:num])) - + ([_("... other options omitted ...")] if truncated else []) + + ([_("... worse options omitted ...")] if truncated else []) ) class ErrorMultipleWordOccurrence(Error): @@ -194,6 +194,6 @@ class ErrorMultipleWordOccurrence(Error): return self.pattern.myid def report(self, short=False): - return Error.report(self, _("%d occurrences of word %s for rhyme %s") - % (self.occurrences, self.word, self.get_id()), short) + return Error.report(self, _("Too many occurrences of word %s for rhyme %s") + % (self.word, self.get_id()), short) diff --git a/res/messages_fr.po b/res/messages_fr.po @@ -5,10 +5,11 @@ msgid "" msgstr "" "Project-Id-Version: plint\n" -"POT-Creation-Date: 2012-07-15 14:07+CEST\n" -"PO-Revision-Date: 2012-07-15 14:21+0100\n" +"POT-Creation-Date: 2012-07-15 15:24+CEST\n" +"PO-Revision-Date: 2012-07-15 15:24+0100\n" "Last-Translator: Antoine Amarilli <a3nm@a3nm.net>\n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -35,8 +36,8 @@ msgid "Illegal hiatus: %s" msgstr "Hiatus interdit : %s" #: error.py:73 -msgid "Bad rhyme %s for type %s (expected %s, inferred %s)" -msgstr "Mauvaise %s de rime pour le type %s (attendu : %s, lu : %s)" +msgid "Bad rhyme %s for type %s (expected %s, inferred \"%s\")" +msgstr "Mauvaise %s de rime pour le type %s (attendu : %s, lu : \"%s\")" #: error.py:79 msgid " or " @@ -47,8 +48,8 @@ msgid "genre" msgstr "genre" #: error.py:98 -msgid " (ending: " -msgstr " (fin : " +msgid " (ending: \"" +msgstr " (fin : \"" #: error.py:104 msgid "Bad rhyme %s for type %s (expected %s)" @@ -59,22 +60,22 @@ msgid "value" msgstr "valeur" #: error.py:179 -msgid "Bad metric (expected %s, inferred %d option%s)" -msgstr "Mauvaise métrique (attendu : %s, lu : %s option%s)" +msgid "Bad metric (expected %s, inferred %d illegal option%s)" +msgstr "Mauvaise métrique (attendu : %s, lu %d choix interdit%s)" #: error.py:185 -msgid "... other options omitted ..." -msgstr "... autres options tronquées ..." +msgid "... worse options omitted ..." +msgstr "... et d'autres choix non affichés ..." #: error.py:197 -msgid "%d occurrences of word %s for rhyme %s" -msgstr "%d occurrences du mot %s pour la rime %s" +msgid "Too many occurrences of word %s for rhyme %s" +msgstr "Trop d'occurrences du mot %s pour la rime %s" -#: plint.py:43 +#: plint.py:25 msgid "Usage: %s TEMPLATE [OCONTEXT]" msgstr "Usage : %s MODÈLE [OCONTEXTE]" -#: plint.py:44 +#: plint.py:26 msgid "Check stdin according to TEMPLATE, report errors on stdout" msgstr "Vérifie l'entrée standard suivant MODÈLE, signale les erreurs sur la sortie standard"