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.
|travis-ci| |pypi-version| |pypi-downloads-month| |requirements|
Installation:
-------------
.. code-block:: bash
pip install django-autotranslate
Add ``'autotranslate'`` to your ``INSTALLED_APPS`` setting.
.. code-block:: python
INSTALLED_APPS = (
...
'autotranslate',
)
Quickstart:
-----------
.. code-block:: bash
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
.. code-block:: bash
python manage.py translate_messages -l 'de' -l 'es'
Settings:
---------
#. Use a different Translation Service:
.. code-block:: bash
# default: 'autotranslate.services.GoSlateTranslatorService'
# pip install google-api-python-client
AUTOTRANSLATE_TRANSLATOR_SERVICE = 'autotranslate.services.GoogleAPITranslatorService'
GOOGLE_TRANSLATE_KEY = '<google-api-key>'
Tests:
-----
.. code-block:: bash
# 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
.. |travis-ci| image:: https://travis-ci.org/ankitpopli1891/django-autotranslate.svg?branch=master
:target: https://travis-ci.org/ankitpopli1891/django-autotranslate
.. |pypi-version| image:: https://img.shields.io/pypi/v/django-autotranslate.svg
:target: https://pypi.python.org/pypi/django-autotranslate/
.. |pypi-downloads-month| image:: https://img.shields.io/pypi/dm/django-autotranslate.svg
:target: https://pypi.python.org/pypi/django-autotranslate/
.. |requirements| image:: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements.svg?branch=master
:target: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements/?branch=master
django-autotranslate
====================
A simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command
using google translate.
|travis-ci| |pypi-version| |pypi-downloads-month| |requirements|
Installation:
-------------
.. code-block:: bash
pip install django-autotranslate
Add ``'autotranslate'`` to your ``INSTALLED_APPS`` setting.
.. code-block:: python
INSTALLED_APPS = (
...
'autotranslate',
)
Quickstart:
-----------
.. code-block:: bash
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
.. code-block:: bash
python manage.py translate_messages -l 'de' -l 'es'
Settings:
---------
#. Use a different Translation Service:
.. code-block:: bash
# default: 'autotranslate.services.GoSlateTranslatorService'
# pip install google-api-python-client
AUTOTRANSLATE_TRANSLATOR_SERVICE = 'autotranslate.services.GoogleAPITranslatorService'
GOOGLE_TRANSLATE_KEY = '<google-api-key>'
Tests:
-----
.. code-block:: bash
# 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
.. |travis-ci| image:: https://travis-ci.org/ankitpopli1891/django-autotranslate.svg?branch=master
:target: https://travis-ci.org/ankitpopli1891/django-autotranslate
.. |pypi-version| image:: https://img.shields.io/pypi/v/django-autotranslate.svg
:target: https://pypi.python.org/pypi/django-autotranslate/
.. |pypi-downloads-month| image:: https://img.shields.io/pypi/dm/django-autotranslate.svg
:target: https://pypi.python.org/pypi/django-autotranslate/
.. |requirements| image:: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements.svg?branch=master
:target: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements/?branch=master
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for django-autotranslate-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3cbbc3f9c010506a536be470dcb55eba5c0c32073d388e7d0755fdfaf7c9b84c |
|
MD5 | da69e52da09800b1ee82b7762e8b4e0d |
|
BLAKE2b-256 | 9006e67d0981c0ed0e6a2330f44bb24272d6b8716adb91a1f2dcde5ed774b8e2 |