The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – RSS feed

Remove incomplete translations

These changes was commited to the Birdfont repository Sat, 20 Jun 2015 18:02:38 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
[Sat, 20 Jun 2015 18:02:38 +0000]

Updated Files

scripts/complete_translations.py
--- a/scripts/complete_translations.py +++ b/scripts/complete_translations.py @@ -53,12 +53,24 @@ 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)