Use po directory either in current or parent folder
This commit is contained in:
parent
2235a2507c
commit
f9a6a8e379
1 changed files with 7 additions and 2 deletions
9
wscript
9
wscript
|
@ -371,14 +371,19 @@ def set_options (opt):
|
||||||
# Taken from Geany's wscript, modified to support LINGUAS variable
|
# Taken from Geany's wscript, modified to support LINGUAS variable
|
||||||
def write_linguas_file (self):
|
def write_linguas_file (self):
|
||||||
linguas = ''
|
linguas = ''
|
||||||
|
# Depending on Waf version, getcwd() is different
|
||||||
|
if os.path.exists ('./po'):
|
||||||
|
podir = './po'
|
||||||
|
else:
|
||||||
|
podir = '../po'
|
||||||
if 'LINGUAS' in Build.bld.env:
|
if 'LINGUAS' in Build.bld.env:
|
||||||
linguas = Build.bld.env['LINGUAS']
|
linguas = Build.bld.env['LINGUAS']
|
||||||
else:
|
else:
|
||||||
files = os.listdir ('../po')
|
files = os.listdir (podir)
|
||||||
for f in files:
|
for f in files:
|
||||||
if f.endswith ('.po'):
|
if f.endswith ('.po'):
|
||||||
linguas += '%s ' % f[:-3]
|
linguas += '%s ' % f[:-3]
|
||||||
f = open ('../po/LINGUAS', 'w')
|
f = open (podir + '/LINGUAS', 'w')
|
||||||
f.write ('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
|
f.write ('# This file is autogenerated. Do not edit.\n%s\n' % linguas)
|
||||||
f.close ()
|
f.close ()
|
||||||
write_linguas_file = feature ('intltool_po')(write_linguas_file)
|
write_linguas_file = feature ('intltool_po')(write_linguas_file)
|
||||||
|
|
Loading…
Reference in a new issue