setup.py: fix locales compilation
This commit is contained in:
parent
df5327ff02
commit
e2edb57a99
23
setup.py
23
setup.py
|
@ -25,15 +25,20 @@ class compile_translations(Command):
|
|||
pass
|
||||
|
||||
def run(self):
|
||||
from django.core.management.commands.compilemessages import \
|
||||
compile_messages
|
||||
for path in ['src']:
|
||||
if not os.path.exists(os.path.join(path, 'locale')):
|
||||
continue
|
||||
curdir = os.getcwd()
|
||||
os.chdir(os.path.realpath(path))
|
||||
compile_messages(sys.stderr)
|
||||
os.chdir(curdir)
|
||||
try:
|
||||
from django.core.management import call_command
|
||||
for path in ['src']:
|
||||
if not os.path.exists(os.path.join(path, 'locale')):
|
||||
continue
|
||||
curdir = os.getcwd()
|
||||
os.chdir(os.path.realpath(path))
|
||||
call_command('compilemessages')
|
||||
os.chdir(curdir)
|
||||
except ImportError:
|
||||
print
|
||||
sys.stderr.write('!!! Please install Django >= 1.4 to build translations')
|
||||
print
|
||||
print
|
||||
|
||||
|
||||
class build(_build):
|
||||
|
|
Reference in New Issue