Skip to main content

Connect your Django apps to PhraseApp, the powerful in-context-translation solution.

Project description

PhraseApp makes it easy and fast to localize you mobile app or website.

This adapter lets you connect your Django application to PhraseApp and integrate the powerful In-Context-Editor into your apps.

How does it work?

django-phrase provides In-Context translating facilities to your Django app by hooking into i18n template tags.

It exposes the underlying key names to the javascript editor that is provided by PhraseApp.

To get started with PhraseApp you need to sign up for a free account.

Installation

Install the package with pip:

pip install django-phrase

And add phrase to the list of installed apps:

INSTALLED_APPS = (
    'phrase',
)

You can now use the phrase_i18n template tag in your templates:

{% load phrase_i18n %}

Note: You have to load phrase_i18n after you load ì18n in order to let phrase override the translation methods.

Last step: add the javascript snippet to your base layout file with the folling tag. This should go inside the <head> section of your template file:

{% phrase_javascript %}

Configuration

You can configure PhraseApp in your settings with these default options:

PHRASE_ENABLED = True
PHRASE_AUTH_TOKEN = 'YOUR_AUTH_TOKEN'
PHRASE_PREFIX = '{{__'
PHRASE_SUFFIX = '__}}'

PHRASE_ENABLED

Enable/Disable In-Context-Editing completely and fall back to standard Django i18n handling. Disable PhraseApp for production environments at any time!

PHRASE_AUTH_TOKEN

Add your project auth token. You find your project auth token on the project overview page.

PHRASE_PREFIX

Change the prefix and suffix of the keys that are rendered by PhraseApp. Default typically works great but this can conflict with some JavaScript liberaries. Use this setting to change prefix and suffix to custom ones if necessary.

More Information

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-phrase-0.0.2.tar.gz (6.1 kB view details)

Uploaded Source

File details

Details for the file django-phrase-0.0.2.tar.gz.

File metadata

  • Download URL: django-phrase-0.0.2.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django-phrase-0.0.2.tar.gz
Algorithm Hash digest
SHA256 72d93ae0677192f8d9dc988b4589004af155ef8f2d7a619e2dc0e4a4b2bbc317
MD5 af101683ac500f1000457c7fe21efed1
BLAKE2b-256 00d42e7f6c458e75110bc174b6e77e36d3d6e3dd884c5a0f55dbbdbaae8c5911

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