'Run msgfmt for each language'

def run(self):

    if (not self.lang):
        return
    if (find_executable(u'msgfmt') is None):
        log.warn(u'GNU    gettext    msgfmt    utility    not    found!')
        log.warn(u'Skip    compiling    po    files.')
        return
    if (u'en' in self.lang):
        if (find_executable(u'msginit') is None):
            log.warn(u'GNU    gettext    msginit    utility    not    found!')
            log.warn(u'Skip    creating    English    PO    file.')
        else:
            log.info(u'Creating    English    PO    file...')
            pot = ((self.prj_name or u'messages') + u'.pot')
            if self.prj_name:
                en_po = (u'%s-en.po' % self.prj_name)
            else:
                en_po = u'en.po'
            self.spawn([u'msginit', u'--no-translator', u'-l', u'en', u'-i', os.path.join(self.source_dir, pot), u'-o', os.path.join(self.source_dir, en_po)])
    basename = self.output_base
    if (not basename.endswith(u'.mo')):
        basename += u'.mo'
    po_prefix = u''
    if self.prj_name:
        po_prefix = (self.prj_name + u'-')
    for lang in self.lang:
        po = os.path.join(self.source_dir, (lang + u'.po'))
        if (not os.path.isfile(po)):
            po = os.path.join(self.source_dir, ((po_prefix + lang) + u'.po'))
        dir_ = os.path.join(self.build_dir, lang, u'LC_MESSAGES')
        self.mkpath(dir_)
        mo = os.path.join(dir_, basename)
        if (self.force or newer(po, mo)):
            log.info((u'Compile:    %s    ->    %s' % (po, mo)))
            self.spawn([u'msgfmt', u'-o', mo, po])
