~cypheon/elfelli

ref: ae3f0b9dd27951e133cf714c889193f2f0d834a0 elfelli/tools/gettext.py -rw-r--r-- 373 bytes
ae3f0b9d — Johann Rudloff Propagate $PATH to SCons files to make gettext binaries available under macOS. 2 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
import SCons.Builder

def generate(env, **kw):
    Builder = SCons.Builder.Builder

    env['MSGFMT'] = env.Detect('msgfmt') or 'msgfmt'

    GettextMOBuilder = Builder(action=env['MSGFMT'] + ' -o $TARGET $SOURCE',
                               suffix='.mo', src_suffix='.po')
    env['BUILDERS']['MO'] = GettextMOBuilder

def exists(env):
    return env.Detect('msgfmt')