Django i18nize extends the i18nize python client. This package contains template tag for rendering translation and management command for fetching translations.
## Links
* *Website:* http://www.i18nize.com
* *Python client*: https://github.com/iktw/i18nize
* *JavaScript client*: https://github.com/iktw/i18nize-javascript
## Installation
```pip install django_i18nize```
## Example configuration (settings.py)
```python
DJANGO_I18NIZE_CONFIG = {
"project_id": "852c3729-6098-410e-ad9e-9783958bbc2d",
"live": False,
'destination_dir': os.path.realpath(os.path.join(REPO_DIR, 'staticfiles', 'locale'))
}
```
### Example 1: Template tag with simple translations (Uses the django language)
```html
<p>
{% i18n_switch "hello" %}
</p>
```
### Example 2: Template tag example with custom language:
```html
<p>
{% i18n_switch "hello" "sv" %}
</p>
```
### Example 3: Template tag example with values
#### Passed view context:
```python
context = {
'values': {
'name': 'John Doe'
}
}
```
#### Your translation at www.i18nize.com:
`"Hello {{name}}!"`
#### Inside your django template:
```html
<p>
{% i18n_switch "greet_person" "en" values %}
</p>
```
### Example 4: Usage within your python code
```python
from django_i18nize.utils import get_translation as _
# Simple translation (Uses the django language)
text = _('hello')
# Translation with custom language
text = _('hello', language='sv')
# Translation with custom values, remember that your key should be injected within your translation.
# For example, your translated key at www.i18nize.com should be "Hello {{name}}!"
text = _('greeting', values={"name": "John Doe"})
```
Metadata
Release files for django_i18nize 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django_i18nize-0.0.2.tar.gz | 3.3 kB | Without provenance | Details for django_i18nize-0.0.2.tar.gz |
Release files / django_i18nize-0.0.2.tar.gz
| Download URL | django_i18nize-0.0.2.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1a0fe0703239c9b0384e5ac3295b7170d5167b3aa1f85ef2ed9fbe038b56f809
|
|
BLAKE2b-256 checksum How to use checksums |
6f876a911c583f5f3b641c1fe8fa95cf222991f037c261abe66f45384a597e1b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django_i18nize 0.0.2
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.