def fetch(resources=None, languages=None):
    locale_dirs = _get_locale_dirs()

    for name, dir_ in locale_dirs:
        if resources and not name in resources:
            continue

        # Transifex pull
        if languages is None:
            call('tx pull -r %(res)s -a -f' % {'res': _tx_resource_for_name(name)}, shell=True)
            languages = sorted([d for d in os.listdir(dir_) if not d.startswith('_')])
        else:
            for lang in languages:
                call('tx pull -r %(res)s -f -l %(lang)s' % {
                    'res': _tx_resource_for_name(name), 'lang': lang}, shell=True)

        # msgcat to wrap lines and msgfmt for compilation of .mo file
        for lang in languages:
            po_path = '%(path)s/%(lang)s/LC_MESSAGES/django%(ext)s.po' % {
                'path': dir_, 'lang': lang, 'ext': 'js' if name.endswith('-js') else ''}
            call('msgcat -o %s %s' % (po_path, po_path), shell=True)
            mo_path = '%s.mo' % po_path[:-3]
            call('msgfmt -o %s %s' % (mo_path, po_path), shell=True)
Fetch translations from Transifex, wrap long lines, generate mo files.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-1.5/scripts/manage_translations.py/fetch