Skip to content
Snippets Groups Projects
Commit 9335b39b authored by nkour's avatar nkour
Browse files

translations.py now accepts check

parent c97ab67c
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ import sys ...@@ -9,6 +9,7 @@ import sys
stats = False stats = False
update = False update = False
check = False
def visit(arg, dirname, names): def visit(arg, dirname, names):
if dirname.find('.svn') != -1: if dirname.find('.svn') != -1:
...@@ -22,10 +23,12 @@ def visit(arg, dirname, names): ...@@ -22,10 +23,12 @@ def visit(arg, dirname, names):
os.system('msgmerge -q -U ../po/'+name+'/LC_MESSAGES/gajim.po ../po/gajim.pot') os.system('msgmerge -q -U ../po/'+name+'/LC_MESSAGES/gajim.po ../po/gajim.pot')
if stats: if stats:
print name, 'has now:' print name, 'has now:'
os.system('msgfmt --statistics -c --check-accelerators="_" ' + path_to_po) os.system('msgfmt --statistics ' + path_to_po)
if check:
os.system('msgfmt -c --check-accelerators="_" ' + path_to_po)
def show_help(): def show_help():
print sys.argv[0], '[help] [stats] [update]' print sys.argv[0], '[help] [stats] [update] [check]'
sys.exit(0) sys.exit(0)
def update_pot(): def update_pot():
...@@ -50,13 +53,16 @@ if __name__ == '__main__': ...@@ -50,13 +53,16 @@ if __name__ == '__main__':
if param == 'stats': # stats only if param == 'stats': # stats only
stats = True stats = True
os.path.walk(path_to_dir, visit, None) os.path.walk(path_to_dir, visit, None)
elif param == 'update': # update and no stats elif param == 'update': # update only
update_pot() update_pot()
update = True update = True
os.path.walk(path_to_dir, visit, None) # update each po & no stats os.path.walk(path_to_dir, visit, None) # update each po & no stats
print 'Done' print 'Done'
elif param == 'check':
check = True
os.path.walk(path_to_dir, visit, None)
elif len(sys.argv) == 1: # update & stats elif len(sys.argv) == 1: # update & stats & no check
update_pot() update_pot()
update = True update = True
stats = True stats = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment