wxPython/wxGlade-0.9.1/install/update-po.py
def makeMO(applicationDirectoryPath,targetDir='./locale',applicationDomain=None, verbose=0, forceEnglish=0) :
    """Compile the Portable Object files into the Machine Object stored in the right location.

    makeMO converts all translated language-specific PO files located inside 
    the  application directory into the binary .MO files stored inside the 
    LC_MESSAGES sub-directory for the found locale files.

    makeMO searches for all files that have a name of the form 'app_xx.po' 
    inside the application directory specified by the first argument.  The 
    'app' is the application domain name (that can be specified by the 
    applicationDomain argument or is taken from the directory name). The 'xx' 
    corresponds to one of the ISO 639 two-letter language codes.

    makeMo stores the resulting files inside a sub-directory of `targetDir`
    called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language
    code.
    """
    if targetDir is None:
        targetDir = './locale'
    if verbose:
        print "Target directory for .mo files is: %s" % targetDir

    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)

    languageDict = getlanguageDict()

    for langCode in languageDict.keys():
        if (langCode == 'en') and (forceEnglish==0):
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
                if not os.path.exists(mo_targetDir):
                    mkdir(mo_targetDir)
                cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % (mo_targetDir,applicationName,applicationName,langCode)
                if verbose: print cmd
                os.system(cmd)
    os.chdir(currentDir)
Compile the Portable Object files into the Machine Object stored in the right location.

    makeMO converts all translated language-specific PO files located inside 
    the  application directory into the binary .MO files stored inside the 
    LC_MESSAGES sub-directory for the found locale files.

    makeMO searches for all files that have a name of the form 'app_xx.po' 
    inside the application directory specified by the first argument.  The 
    'app' is the application domain name (that can be specified by the 
    applicationDomain argument or is taken from the directory name). The 'xx' 
    corresponds to one of the ISO 639 two-letter language codes.

    makeMo stores the resulting files inside a sub-directory of `targetDir`
    called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language
    code.
    
Compile the Portable Object files into the Machine Object stored in the right location.
makeMO converts all translated language-specific PO files located inside
the  application directory into the binary .MO files stored inside the
LC_MESSAGES sub-directory for the found locale files.

makeMO searches for all files that have a name of the form 'app_xx.po'
inside the application directory specified by the first argument.  The
'app' is the application domain name (that can be specified by the
applicationDomain argument or is taken from the directory name). The 'xx'
corresponds to one of the ISO 639 two-letter language codes.

makeMo stores the resulting files inside a sub-directory of `targetDir`
called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language
code.
Compile the Portable Object files into the Machine Object stored in the right location . makeMO converts all translated language - specific PO files located inside the application directory into the binary . MO files stored inside the LC_MESSAGES sub - directory for the found locale files . makeMO searches for all files that have a name of the form ' app_xx . po ' inside the application directory specified by the first argument . The ' app ' is the application domain name ( that can be specified by the applicationDomain argument or is taken from the directory name ) . The ' xx ' corresponds to one of the ISO 639 two - letter language codes . makeMo stores the resulting files inside a sub - directory of ` targetDir ` called xx / LC_MESSAGES where ' xx ' corresponds to the 2 - letter language code .
def makeMO(applicationDirectoryPath,targetDir='./locale',applicationDomain=None, verbose=0, forceEnglish=0) :
    if targetDir is None:
        targetDir = './locale'
    if verbose:
        print "Target directory for .mo files is: %s" % targetDir
    if applicationDomain is None:
        applicationName = fileBaseOf(applicationDirectoryPath,withPath=0)
    else:
        applicationName = applicationDomain
    currentDir = os.getcwd()
    os.chdir(applicationDirectoryPath)
    languageDict = getlanguageDict()
    for langCode in languageDict.keys():
        if (langCode == 'en') and (forceEnglish==0):
            pass
        else:
            langPOfileName = "%s_%s.po" % (applicationName , langCode)
            if os.path.exists(langPOfileName):
                mo_targetDir = "%s/%s/LC_MESSAGES" % (targetDir,langCode)
                if not os.path.exists(mo_targetDir):
                    mkdir(mo_targetDir)
                cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % (mo_targetDir,applicationName,applicationName,langCode)
                if verbose: print cmd
                os.system(cmd)
    os.chdir(currentDir)
def makeMO ( applicationDirectoryPath , targetDir = './locale' , applicationDomain = None , verbose = 0 , forceEnglish = 0 ) : if targetDir is None : targetDir = './locale' if verbose : print "Target directory for .mo files is: %s" % targetDir if applicationDomain is None : applicationName = fileBaseOf ( applicationDirectoryPath , withPath = 0 ) else : applicationName = applicationDomain currentDir = os . getcwd ( ) os . chdir ( applicationDirectoryPath ) languageDict = getlanguageDict ( ) for langCode in languageDict . keys ( ) : if ( langCode == 'en' ) and ( forceEnglish == 0 ) : pass else : langPOfileName = "%s_%s.po" % ( applicationName , langCode ) if os . path . exists ( langPOfileName ) : mo_targetDir = "%s/%s/LC_MESSAGES" % ( targetDir , langCode ) if not os . path . exists ( mo_targetDir ) : mkdir ( mo_targetDir ) cmd = 'msgfmt --output-file="%s/%s.mo" "%s_%s.po"' % ( mo_targetDir , applicationName , applicationName , langCode ) if verbose : print cmd os . system ( cmd ) os . chdir ( currentDir )
Compile the Portable Object files into the Machine Object stored in the right location.
Compile the Portable Object files into the Machine Object stored in the right location .
"""Compile the Portable Object files into the Machine Object stored in the right location.

    makeMO converts all translated language-specific PO files located inside 
    the  application directory into the binary .MO files stored inside the 
    LC_MESSAGES sub-directory for the found locale files.

    makeMO searches for all files that have a name of the form 'app_xx.po' 
    inside the application directory specified by the first argument.  The 
    'app' is the application domain name (that can be specified by the 
    applicationDomain argument or is taken from the directory name). The 'xx' 
    corresponds to one of the ISO 639 two-letter language codes.

    makeMo stores the resulting files inside a sub-directory of `targetDir`
    called xx/LC_MESSAGES where 'xx' corresponds to the 2-letter language
    code.
    """
applicationDirectoryPath
targetDir
applicationDomain
verbose
forceEnglish