Skip to content
A simple Django app to automatically translate the pot (.po) files generated by django's makemessages command using google translate.
Python
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
autotranslate fix: remove python 2 style print statement Mar 13, 2017
tests Improved the %(placeholder)s keeping strategy Dec 29, 2015
.gitignore initial commit Mar 8, 2015
.travis.yml chore: include more python versions May 6, 2018
LICENSE Update license year range Jan 16, 2016
MANIFEST.in package the requirements file, pip install fails Nov 9, 2015
README.md
requirements.txt added plural forms support Jan 22, 2016
setup.py
tox.ini chore: drop support for older django versions May 6, 2018

README.md

django-autotranslate

A simple Django app to automatically translate the pot (.po) files generated by django's makemessages command using google translate.

Installation:

    pip install django-autotranslate

Add 'autotranslate' to your INSTALLED_APPS setting.

    INSTALLED_APPS = (
        ...
        'autotranslate',
    )

Quickstart:

    python manage.py translate_messages

The command finds all the generated pot (.po) files under the locale paths (LOCALE_PATHS) specified in django project settings, and translates them automatically.

Options:

  • -f, --set-fuzzy: Set the 'fuzzy' flag on autotranslated entries
  • -l, --locale 'locale': Only translate the specified locales
  • -u, --untranslated: Only translate the untranslated messages
    python manage.py translate_messages -l 'de' -l 'es'

Settings:

  • Use a different Translation Service:
    # default: 'autotranslate.services.GoSlateTranslatorService'
    # pip install google-api-python-client
    AUTOTRANSLATE_TRANSLATOR_SERVICE = 'autotranslate.services.GoogleAPITranslatorService'
    GOOGLE_TRANSLATE_KEY = '<google-api-key>'

Compatibility Matrix:

autotranslate django
v1.0.x Django 1.5+
v1.1.x Django 1.8+

Tests:

    # run test against all environments
    tox
    # run test against a specific environment defined in tox.ini
    # eg. django>1.9 & python3.4
    tox -e dj19-py34
You can’t perform that action at this time.