Skip to main content
django-C3PO
=============
django-C3PO is a Django application using C3PO - module responsible for converting .po files from locale folder
with translations to .ods format and sending them to Google Spreadsheets.

This Django application provides panel where user can synchronize translations with GDocs and it gives
possibility to push all translations on git and checkout last commit.

After synchronization django-C3PO sends post_compilemessages signal which notifies that translations are ready.
Server restart is needed then to reload compiled .mo files into application.

Application uses celery to prevent timeout when synchronizing translations.
Be sure to properly configure it before use.

django-C3PO includes custom compilemessages command called verbosecompilemessages.
It is needed to write msgfmt errors on the stderr, because standard compile messages
does not show them.

Quick start
-----------

1. Add "django-C3PO" to your INSTALLED_APPS setting like this:

```python
INSTALLED_APPS = (
...
'django_c3po',
)
```

2. Add C3PO variable to your settings and define them. For example:

```python
C3PO = {
'LANGUAGES': ['en', 'pl', 'jp'],
'EMAIL': 'ttestt123321@gmail.com',
'PASSWORD': 'zxcasdqwe.',
'URL': 'https://docs.google.com/spreadsheet/ccc?key=0AnVOHClWGpLZdGRuQVlrWG5Ia3QtOHJEWWpmZVYyYnc#gid=0',
'HEADER': '# translated with po_translator\n',
'LOCALE_ROOT': os.path.join('conf', 'locale'),
'PO_FILES_PATH': 'LC_MESSAGES',
'TEMP_PATH': 'temp',
'GIT_REPOSITORY': 'git@git.hiddendata.co:mnogacki/testpo.git',
'GIT_BRANCH': 'master',
'SOURCE': 'PO Translator',
}
```

3. Include the po_translator URLconf in your project urls.py like this::

```python
url(r'^c3po/', include('django_c3po.urls')),
```

4. Add post_compilemessages signal receiver for server restart:
```python
@receiver(post_compilemessages)
def restart_server_callback(sender, *args, **kwargs):
manage_path = os.path.join(settings.ROOT_DIR, '..', 'manage.py')
os.system('touch ' + manage_path)
```

5. Configure celery in your settings:
```python
BROKER_URL = 'django://'
CELERY_IMPORTS = ('test_app.models',)

import djcelery
djcelery.setup_loader()
```
Be sure to include module with your signal receiver in CELERY_IMPORTS.

6. Start the development server, visit http://127.0.0.1:8000/admin/
and add permission 'django-C3PO.can_translate' to user.

7. Visit http://127.0.0.1:8000/c3po/ and log in as user with can_translate permission.

8. Use buttons to synchronize, make messages and git operations.
-
Usage
-----
After configuration and logging into the translator's panel, you will see basic configuration info with
link to the spreadsheet defined in settings. User can manage app translations with three actions:

- Synchronize - Synchronized translations from local files with GDoc state. If project has new expressions
which are not in the spreadsheet, GDoc is updated with this entries. Remember that after this action server
should be restarted.
- Make messages - Runs makemessages command updating po files with new expressions to translate.
- Publish - Pushes current po files to git repository.
- Reset - Reverts current changes and checkouts project to last commit. Note that changes are also reverted
in spreadsheet, so all new translations will be lost.

Metadata

Release files for django-C3PO 0.3.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 django-C3PO 0.3.0
File Size Uploaded Provenance Actions
django-C3PO-0.3.0.tar.gz 185.1 kB Without provenance Details for django-C3PO-0.3.0.tar.gz

Release files / django-C3PO-0.3.0.tar.gz

Download URL django-C3PO-0.3.0.tar.gz
Size 185.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d31ebdf70bf2886049abf8ee5b6417a84a8e5ba5b7bcf144237a8058c73188c7
BLAKE2b-256 checksum
How to use checksums
77fb63c3fa06bb14d60c027176834921754efa74703727ac50f2d05d08aff045
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-C3PO 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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