~nishimotz/nvdajp/releases_2011.1

« back to all changes in this revision

Viewing changes to site_scons/site_tools/gettext.py

  • Committer: James Teh
  • Date: 2010-11-22 00:13:30 UTC
  • mfrom: (3920.1.21 sconsBuild)
  • Revision ID: jamie@jantrid.net-20101122001330-ilnty0n7cuqna29m
Refactor the build process to allow anyone to prepare the source tree and create binary distributions, portable archives, installers, etc. with a simple command.
scons is used to facilitate this.
See the Building NVDA section of the source readme for details.

Notes:
        * Of course, SCons is now required for anyone running from source.
        * The nvdaHelper build process has now been incorporated into the new build process, so you do not need to run scons from source\NVDAHelper anymore.
        * nvdaHelper builds will no longer be provided on the snapshots page. This means that the Windows SDK and several other dependencies are now required, as documented in the source readme.
        * You should no longer run generate.py, setup.py or makensis directly. Instead, use scons as documented in the source readme.
        * source\include and source\NVDAHelper have been moved out of the source directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
###
 
2
#This file is a part of the NVDA project.
 
3
#URL: http://www.nvda-project.org/
 
4
#Copyright 2010 James Teh <jamie@jantrid.net>.
 
5
#This program is free software: you can redistribute it and/or modify
 
6
#it under the terms of the GNU General Public License version 2.0, as published by
 
7
#the Free Software Foundation.
 
8
#This program is distributed in the hope that it will be useful,
 
9
#but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
11
#This license can be found at:
 
12
#http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 
13
###
 
14
 
 
15
import os
 
16
import sys
 
17
 
 
18
__path__=[os.path.join(sys.exec_prefix,'tools','i18n')]
 
19
import msgfmt
 
20
del __path__
 
21
 
 
22
def gettextMoFile_actionFunc(target,source,env):
 
23
        msgfmt.make(source[0].path,target[0].path)
 
24
        msgfmt.MESSAGES={}
 
25
 
 
26
def exists(env):
 
27
        return True
 
28
 
 
29
def generate(env):
 
30
        env['BUILDERS']['gettextMoFile']=env.Builder(
 
31
                action=env.Action(gettextMoFile_actionFunc,lambda t,s,e: 'Compiling gettext template %s'%s[0].path),
 
32
                suffix='.mo',
 
33
                src_suffix='.po'
 
34
        )