Skip to main content

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

Project description

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
  • -s, --source-language: Override the default source language (en) used for translation
    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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_autotranslate-1.3.0.tar.gz (9.8 kB view details)

Uploaded Source

Built Distribution

django_autotranslate-1.3.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file django_autotranslate-1.3.0.tar.gz.

File metadata

  • Download URL: django_autotranslate-1.3.0.tar.gz
  • Upload date:
  • Size: 9.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for django_autotranslate-1.3.0.tar.gz
Algorithm Hash digest
SHA256 e467dc1937353fbe03cff3d14b91387ef038aa8aedae036112fca198c25ea82c
MD5 df6be2ebf9a05d1e37dfc5f822f1da7e
BLAKE2b-256 146bbbb56fb2ef36e3c7f3cdeae215650f9992e126d99c2b5402afc2046709ec

See more details on using hashes here.

File details

Details for the file django_autotranslate-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_autotranslate-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f9e0d7928dc8df9ce622bf8d14166c04a33e886beb488a70bb1806aef4f2dfbd
MD5 0f31b7102d56acc102d81e6a4690264e
BLAKE2b-256 4946417ce6536d013732e5b353adfd89627b490386902fb7826e71b4f77438de

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page