File: SConscript

package info (click to toggle)
skim 1.4.4-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,876 kB
  • ctags: 1,247
  • sloc: cpp: 9,421; python: 1,608; sh: 260; makefile: 68
file content (27 lines) | stat: -rw-r--r-- 879 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#! /usr/bin/env python

Import( 'env' )

def FormatPoFiles(env, target, source):
	comp='$MSGFMT --statistics $source -o $target'
	return env.Execute(comp)
	
env['BUILDERS']['FormatPoFiles']=Builder(action=env.Action(FormatPoFiles),suffix='.gmo',src_suffix='.po')

import glob
import SCons
import string
def SKIMlang(lenv, folder, appname):
		""" Process translations (.po files) in a po/ dir """
		transfiles = glob.glob(folder+'/*.po')
		for lang in transfiles:
			result = lenv.Transfiles(lang)
			country = SCons.Util.splitext(result[0].name)[0]
			if string.find(lang, 'desktop') == -1:
				dir=env.getInstDirForResType('KDELOCALE')
                                lenv.bksys_install(dir+'/'+country+'/LC_MESSAGES/', result, destfile=appname+'.mo')

from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.SKIMlang = SKIMlang

env.SKIMlang('./',env['PACKAGE'])