Clone in a terminal:
Commit c9be432
Johan Mattsson - 2015-06-20T18:02:38+00:00
c9be432ef03239aced8213dc214560b3f33f28b4johan.mattsson.m@gmail.com

Remove incomplete translations

Changed files (1)

Diff

diff --git a/scripts/complete_translations.py b/scripts/complete_translations.pyindex 93b3e18..ea1b41a 100755--- a/scripts/complete_translations.py+++ b/scripts/complete_translations.py@@ -53,12 +53,24 @@ def completeness (pofile): parser = OptionParser() parser.add_option("-t", "--threshold", dest="threshold", help="completeness threshold in percens", metavar="THRESHOLD") parser.add_option("-i", "--incomplete", dest="incomplete", action="store_true", default=False, help="move incomplete translations to the folder for incomplete translations", metavar="MOVE_INCOMPLETE")+parser.add_option("-r", "--remove-compiled", dest="compiled", action="store_true", default=False, help="remove compiled incomplete translations", metavar="MOVE_COMPILED_INCOMPLETE") (options, args) = parser.parse_args()  if not options.threshold:     for pofile in glob.glob('po/*.po'):         completed = completeness (pofile)         print (pofile + " " + str (completed) + "%")+elif options.compiled:+    for pofile in glob.glob('po/*.po'):+        completed = completeness (pofile)+        podir = pofile.replace ("po/", "")+        podir = podir.replace (".po", "")+        if completed >= float (options.threshold):+            print ("Releasing " + podir)+        else:+            print ("Removing incomplete translation " + podir)+            run ("mkdir -p build/incomplete")+            run ("mv build/locale/" + podir + " build/incomplete/")  elif options.incomplete:     for pofile in glob.glob('po/*.po'):         completed = completeness (pofile)

Contact

Email: johan.mattsson.m@gmail.com
Mastodon: typo.social/@birdfont
GitHub: johanmattssonm
LinkedIn: johan-mattsson-2ab324112