|
|
@ -29,6 +29,7 @@ import distutils.command.install
|
|
|
|
import distutils.command.install_egg_info
|
|
|
|
import distutils.command.install_egg_info
|
|
|
|
|
|
|
|
|
|
|
|
locales = ("ru","bg","fr")
|
|
|
|
locales = ("ru","bg","fr")
|
|
|
|
|
|
|
|
msg_params = "--check-format --check-domain -o"
|
|
|
|
|
|
|
|
|
|
|
|
def cout(string):
|
|
|
|
def cout(string):
|
|
|
|
sys.stdout.write(string)
|
|
|
|
sys.stdout.write(string)
|
|
|
@ -52,8 +53,17 @@ class build_po( distutils.core.Command ) :
|
|
|
|
self.mkpath(localepath)
|
|
|
|
self.mkpath(localepath)
|
|
|
|
self.mkpath(locale)
|
|
|
|
self.mkpath(locale)
|
|
|
|
for po in glob.glob("%s/*.po"%locale) :
|
|
|
|
for po in glob.glob("%s/*.po"%locale) :
|
|
|
|
cmd = "msgfmt -c -o %s/%s %s" % \
|
|
|
|
if "packages.po" in po or "new.po" in po:
|
|
|
|
(localepath,path.basename(po)[:-2]+'mo',po)
|
|
|
|
continue
|
|
|
|
|
|
|
|
addon = "%s/packages.po"%locale
|
|
|
|
|
|
|
|
if "cl_update" in po and path.exists(addon):
|
|
|
|
|
|
|
|
cmd = "msgfmt %s %s/%s %s %s" % \
|
|
|
|
|
|
|
|
(msg_params,localepath,
|
|
|
|
|
|
|
|
path.basename(po)[:-2]+'mo',po, addon)
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
cmd = "msgfmt %s %s/%s %s" % \
|
|
|
|
|
|
|
|
(msg_params,localepath,
|
|
|
|
|
|
|
|
path.basename(po)[:-2]+'mo',po)
|
|
|
|
cout( cmd + "\n" )
|
|
|
|
cout( cmd + "\n" )
|
|
|
|
os.system(cmd)
|
|
|
|
os.system(cmd)
|
|
|
|
|
|
|
|
|
|
|
|