Skip to main content

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

Release files for arvin-django-autotranslate 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for arvin-django-autotranslate 1.4.0
File Size Uploaded
arvin-django-autotranslate-1.4.0.tar.gz 9.3 kB Details

Release files / arvin-django-autotranslate-1.4.0.tar.gz

Download URL arvin-django-autotranslate-1.4.0.tar.gz
Size 9.3 kB
Tags Source
SHA-256 checksum
How to use checksums
41e05854cd4453ba6c26706036c5dcb4b315f8d82ff27cfc382f64b5d4f4f9cf
BLAKE2b-256 checksum
How to use checksums
feb888fdf19fa852c2249f2a4d11a44a647abe6111f70c739dbc6511b46eaf1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.4

Release history Release notifications | RSS feed

This release

1.4.0 This release

1 release file

1.3.0

1 release file

1.2.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page