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.2.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file django-autotranslate-1.2.0.tar.gz.

File metadata

  • Download URL: django-autotranslate-1.2.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for django-autotranslate-1.2.0.tar.gz
Algorithm Hash digest
SHA256 f306acd3a722936afecd7e4240e5bb1ee3e4b3f493916062b618b820006a02bd
MD5 efc498b38b5a3d84cf63ae425aaf4fb0
BLAKE2b-256 1ed2a11f13ca6dc5bb7244187134099992f30159af34b87a140cc3d2a433d0da

See more details on using hashes here.

File details

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

File metadata

  • Download URL: django_autotranslate-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for django_autotranslate-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 477c16f67ba622319fea9d80e0a8972e579f85586682b38ef344b2028d3f07c9
MD5 2c98218a614d47f11f482e185e3b8f7b
BLAKE2b-256 557e8bbdac30c0a41f7e8ba9fdc58e277d1f0c1ca0e1a3f3c8258478c5643a4b

See more details on using hashes here.

Supported by

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