django-autotranslate
====================
A simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command
using google translate.
[![][travis-ci]][travis] [![][pypi-version]][pypi] ![][requirements]
Installation:
-------------
```bash
pip install django-autotranslate
```
Add ``'autotranslate'`` to your ``INSTALLED_APPS`` setting.
```python
INSTALLED_APPS = (
...
'autotranslate',
)
```
Quickstart:
-----------
```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
- ``-s, --source-language``: Override the default source language (en) used for translation
```bash
python manage.py translate_messages -l 'de' -l 'es'
```
Settings:
---------
- Use a different Translation Service:
```python
# default: 'autotranslate.services.GoogleTranslatorService'
# 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:
-----
```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]: https://travis-ci.org/ankitpopli1891/django-autotranslate.svg?branch=master
[travis]: https://travis-ci.org/ankitpopli1891/django-autotranslate
[pypi-version]: https://img.shields.io/pypi/v/django-autotranslate.svg
[pypi]: https://pypi.python.org/pypi/django-autotranslate/
[requirements]: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements.svg?branch=master
Raw data
{
"_id": null,
"home_page": "https://github.com/achillis2/django-autotranslate2",
"name": "django-autotranslate2",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Ding Li",
"author_email": "dingli@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/cc/74/277137cfe64ed4ce55dd142c903105c27f1bf07aa3c273b8aa00a06721f2/django-autotranslate2-1.2.7.tar.gz",
"platform": null,
"description": "\ndjango-autotranslate\n====================\n\nA simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command\nusing google translate.\n\n[![][travis-ci]][travis] [![][pypi-version]][pypi] ![][requirements]\n\nInstallation:\n-------------\n\n```bash\n pip install django-autotranslate\n```\n\nAdd ``'autotranslate'`` to your ``INSTALLED_APPS`` setting.\n\n```python\n INSTALLED_APPS = (\n ...\n 'autotranslate',\n )\n```\n\nQuickstart:\n-----------\n\n```bash\n python manage.py translate_messages\n```\n\nThe command finds all the generated pot (``.po``) files under the locale paths (``LOCALE_PATHS``) specified in django project settings, and translates them automatically.\n\n\nOptions:\n--------\n\n- ``-f, --set-fuzzy``: Set the 'fuzzy' flag on autotranslated entries\n- ``-l, --locale 'locale'``: Only translate the specified locales\n- ``-u, --untranslated``: Only translate the untranslated messages\n- ``-s, --source-language``: Override the default source language (en) used for translation\n\n```bash\n python manage.py translate_messages -l 'de' -l 'es'\n```\n\nSettings:\n---------\n\n- Use a different Translation Service:\n\n```python\n # default: 'autotranslate.services.GoogleTranslatorService'\n # pip install google-api-python-client\n AUTOTRANSLATE_TRANSLATOR_SERVICE = 'autotranslate.services.GoogleAPITranslatorService'\n GOOGLE_TRANSLATE_KEY = '<google-api-key>'\n```\n\nCompatibility Matrix:\n--------------------\n\n| autotranslate | django |\n| :-----------: | :---------: |\n| v1.0.x | Django 1.5+ |\n| v1.1.x | Django 1.8+ |\n\n\nTests:\n-----\n\n```bash\n # run test against all environments\n tox\n # run test against a specific environment defined in tox.ini\n # eg. django>1.9 & python3.4\n tox -e dj19-py34\n```\n\n[travis-ci]: https://travis-ci.org/ankitpopli1891/django-autotranslate.svg?branch=master\n[travis]: https://travis-ci.org/ankitpopli1891/django-autotranslate\n\n[pypi-version]: https://img.shields.io/pypi/v/django-autotranslate.svg\n[pypi]: https://pypi.python.org/pypi/django-autotranslate/\n\n[requirements]: https://requires.io/github/ankitpopli1891/django-autotranslate/requirements.svg?branch=master\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "A simple Django app to automatically translate the pot (`.po`) files generated by django's makemessages command using google translate.",
"version": "1.2.7",
"project_urls": {
"Homepage": "https://github.com/achillis2/django-autotranslate2"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b016e81397a81dcbd8eaad1d2e6be10231e5a6a675c5def8a23e7ac4eae25ad3",
"md5": "7e71028e2c0e8d0d3e3909d3e574bef7",
"sha256": "c8036db4817e58f2aab004cae8f3705cb999fe695bf66a64e2e543b80436e749"
},
"downloads": -1,
"filename": "django_autotranslate2-1.2.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "7e71028e2c0e8d0d3e3909d3e574bef7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 10632,
"upload_time": "2023-12-08T03:57:12",
"upload_time_iso_8601": "2023-12-08T03:57:12.831070Z",
"url": "https://files.pythonhosted.org/packages/b0/16/e81397a81dcbd8eaad1d2e6be10231e5a6a675c5def8a23e7ac4eae25ad3/django_autotranslate2-1.2.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "cc74277137cfe64ed4ce55dd142c903105c27f1bf07aa3c273b8aa00a06721f2",
"md5": "9ef372d86a8335df199c62b638694dbe",
"sha256": "c1ca2d7f296179ea6c289585f9cb43a29ecd640b6a53887e7fcff7359dde80d0"
},
"downloads": -1,
"filename": "django-autotranslate2-1.2.7.tar.gz",
"has_sig": false,
"md5_digest": "9ef372d86a8335df199c62b638694dbe",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 9841,
"upload_time": "2023-12-08T03:57:14",
"upload_time_iso_8601": "2023-12-08T03:57:14.616644Z",
"url": "https://files.pythonhosted.org/packages/cc/74/277137cfe64ed4ce55dd142c903105c27f1bf07aa3c273b8aa00a06721f2/django-autotranslate2-1.2.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-12-08 03:57:14",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "achillis2",
"github_project": "django-autotranslate2",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "django-autotranslate2"
}