Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use pybabel to extract the POT file

  • Loading branch information...
commit 6c98611116a95615f4b544d5aadb33bb617edf35 1 parent d9b1ca6
@lalinsky lalinsky authored
Showing with 1 addition and 79 deletions.
  1. +1 −1  HACKING.txt
  2. +0 −8 po/rename.py
  3. +0 −31 po/update-pot.py
  4. +0 −39 po/update.py
View
2  HACKING.txt
@@ -10,7 +10,7 @@ or fetch translations.
Updating the translation template after adding/removing some strings:
- $ python po/update-pot.py
+ $ pybabel extract picard -o po/picard.pot
$ tx push -s
Fetching latest translations from Transifex:
View
8 po/rename.py
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-import os, shutil
-
-for name in os.listdir('.'):
- if name.startswith('picard-') and name.endswith('.po'):
- newname = name[7:]
- shutil.move(name, newname)
View
31 po/update-pot.py
@@ -1,31 +0,0 @@
-#!/usr/bin/env python
-
-import glob
-import os.path
-import shutil
-
-sources = []
-for root, dirs, files in os.walk(os.path.join('..', 'picard')):
- for name in files:
- if name.endswith('.py'):
- sources.append(os.path.join(root, name))
-
-cmd = "xgettext --copyright-holder=MusicBrainz " \
- "--msgid-bugs-address=http://tickets.musicbrainz.org/ " \
- "--add-comments=TR -L Python -d picard -o picard.pot --keyword=N_ " + \
- " ".join(sources)
-
-print cmd
-os.system(cmd)
-print
-
-f = file('picard.pot', 'rt')
-lines = f.readlines()
-f.close()
-f = file('picard.pot', 'wt')
-for line in lines:
- if line.startswith('#. TR: '):
- line = '#. ' + line[7:]
- f.write(line)
-f.close()
-
View
39 po/update.py
@@ -1,39 +0,0 @@
-#!/usr/bin/env python
-
-import glob
-import os.path
-import shutil
-
-sources = []
-for root, dirs, files in os.walk(os.path.join('..', 'picard')):
- for name in files:
- if name.endswith('.py'):
- sources.append(os.path.join(root, name))
-
-cmd = "xgettext --copyright-holder=MusicBrainz " \
- "--msgid-bugs-address=http://tickets.musicbrainz.org/ " \
- "--add-comments=TR -L Python -d picard -o picard.pot --keyword=N_ " + \
- " ".join(sources)
-
-print cmd
-os.system(cmd)
-print
-
-f = file('picard.pot', 'rt')
-lines = f.readlines()
-f.close()
-f = file('picard.pot', 'wt')
-for line in lines:
- if line.startswith('#. TR: '):
- line = '#. ' + line[7:]
- f.write(line)
-f.close()
-
-for po in glob.glob("*.po"):
- cmd = "msgmerge %s picard.pot -o new.%s" % (po, po)
- print cmd
- if os.system(cmd) == 0:
- print "new.%s.po --> %s" % (po, po)
- shutil.move("new.%s" % po, po)
- os.system("msgfmt --statistics -c -v -o %s %s" % (os.devnull, po))
- print
Please sign in to comment.
Something went wrong with that request. Please try again.