use waf for generating and installing *.mo files

This commit is contained in:
Nedko Arnaudov 2010-12-19 14:30:13 +02:00
parent 7cf5b21d13
commit c4119ff60b
4 changed files with 5 additions and 13 deletions

2
.gitignore vendored
View File

@ -15,5 +15,3 @@
/build
*~
*.pyc
po/*.mo
po/*.gmo

View File

@ -44,7 +44,7 @@
#include "../daemon/conf.h"
#include "toolbar.h"
#define GETTEXT_PACKAGE "gladish"
#define GETTEXT_PACKAGE "ladish"
#define ENABLE_NLS 1

2
po/LINGUAS Normal file
View File

@ -0,0 +1,2 @@
# Set of available languages.
ru fr

12
wscript
View File

@ -90,6 +90,7 @@ def configure(conf):
conf.load('compiler_cxx')
conf.load('boost')
conf.load('python')
conf.load('intltool')
if parallel_debug:
conf.load('parallel_debug')
@ -590,16 +591,7 @@ def build(bld):
else:
pprint('CYAN', "doxygen documentation already built.")
# Translations
# TODO: Rewrite using waf functionality
po_list = os.listdir('./po')
if po_list.__len__() > 0:
for po_list_item in po_list:
item = po_list_item.rsplit('.', 1)
if item[1] == "po":
pprint('CYAN', "Preparing translation '"+item[0]+"'")
os.system("msgfmt ./po/"+po_list_item+" -o ./po/"+item[0]+".mo")
bld.install_as(('${LOCALE_DIR}/'+item[0]+'/LC_MESSAGES/gladish.mo'), ('./po/'+item[0]+".mo"))
bld(features='intltool_po', appname=APPNAME, podir='po', install_path="${LOCALE_DIR}")
def get_tags_dirs():
source_root = os.path.dirname(Utils.g_module.root_path)