# By Karl Hobley
# Via Karl Hobley (1) and Rui Martins (1)
* 'master' of https://github.com/infoportugal/wagtail-modeltranslation:
  Add a .gitignore file

Conflicts:
	wagtail_modeltranslation/models.pyc
This commit is contained in:
Rui Manuel da Silva Martins 2015-05-25 18:13:43 +01:00
commit 5d6d04f96a
27 changed files with 3 additions and 145 deletions

3
.gitignore vendored Normal file
View file

@ -0,0 +1,3 @@
*.pyc
/dist
/wagtail_modeltranslation.egg-info

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -1,118 +0,0 @@
Metadata-Version: 1.1
Name: wagtail-modeltranslation
Version: 0.1.1
Summary: Integration of django-modeltranslation with Wagtail CMS
Home-page: https://github.com/infoportugal/wagtail-modeltranslation
Author: Rui Martins
Author-email: rmartins16@gmail.com
License: BSD License
Description: # Wagtail modeltranslation
(based on https://github.com/deschler/django-modeltranslation)
Simple app containing a mixin model that integrates modeltranslation
(https://github.com/deschler/django-modeltranslation) into wagtail panels system.
![alt tag](https://github.com/infoportugal/wagtail-modeltranslation/blob/master/screenshot.png?raw=true)
## Quick start
1. Make sure you have django-modeltranslation installed:
pip install django-modeltranslation
2. Add "wagtail_modeltranslation" to your INSTALLED_APPS setting like this:
INSTALLED_APPS = (
...
'wagtail_modeltranslation',
'modeltranslation',
...
)
3. Use TranslationMixin in order to integrate django-modeltranslation with Wagtail admin. ** IMPORTANT: ** make sure that TranslationMixin is declared before Page class on model inheritance. Like following:
from wagtail_modeltranslation.models import TranslationMixin
class FooModel(TranslationMixin, Page):
foo = models.CharField()
FooModel.panels = [...]
4. Visit django-modeltranslation for documentation on how to implement translation fields: http://django-modeltranslation.readthedocs.org/en/latest/
5. In order to update pages url_path field use **"set\_translation\_url\_paths"** instead of original "set\_url\_paths"
6. Use **"change_lang"** template tag to fetch translated urls based on translated slugs:
{% load modeltranslation %}
<li class="dropdown">
<a data-toggle="dropdown" class="dropdown-toggle" data-hover="dropdown" href="#">{{ LANGUAGE_CODE }}<i class="fa fa-angle-down ml5"></i></a>
<ul class="dropdown-menu" id="language-dropdown">
{% for lang in languages %}
{% if lang.0 != LANGUAGE_CODE %}
<li tabindex="-1"><a href="{% change_lang lang.0 %}">{{ lang.1 }}</a></li>
{% endif %}
{% endfor %}
</ul>
</li>
## Release Notes
## v0.1.1
- Fixed url_path issue caused by a browser with language different from settings.LANGUAGE_CODE
## v0.1
- Minor release working but lacks full test coverage.
- Last version had required fields validation problems, now fixed.
## v0.0.9
- Fixed issue that causes duplicated translation fields, preventing auto-slug from working properly.
## v0.0.8
- Fixed issue related to deleting a non existing key on PAGE_EDIT_HANDLER dict
## v0.0.7
- Fixed set_url_path() translatable model method
### v0.0.6
- Fixed js issue related to auto-generating slugs
### v0.0.5
- Now using django-modeltranslation 0.9.1;
- Fixed problem related to slug field fallbacks;
### v0.0.4
** IMPORTANT: ** make sure that TranslationMixin comes before Page class on model inheritance
- Fix enhancement #1: url_path translation field
- Now includes a template tag that returns current page url to corresponding translated url
- New management command to update url_path translation fields - **set\_translation\_url\_paths**
### v0.0.3
- New methods;
- Now supports required fields;
- Fixed issue related to browser locale;
### v0.0.2
- Prepopulated fields now works for translated fields (title and slug)
Platform: UNKNOWN
Classifier: Environment :: Web Environment
Classifier: Framework :: Django
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content

View file

@ -1,23 +0,0 @@
MANIFEST.in
README.md
setup.py
wagtail_modeltranslation/.DS_Store
wagtail_modeltranslation/__init__.py
wagtail_modeltranslation/admin.py
wagtail_modeltranslation/models.py
wagtail_modeltranslation/tests.py
wagtail_modeltranslation/translation.py
wagtail_modeltranslation/views.py
wagtail_modeltranslation/wagtail_hooks.py
wagtail_modeltranslation.egg-info/PKG-INFO
wagtail_modeltranslation.egg-info/SOURCES.txt
wagtail_modeltranslation.egg-info/dependency_links.txt
wagtail_modeltranslation.egg-info/requires.txt
wagtail_modeltranslation.egg-info/top_level.txt
wagtail_modeltranslation/management/__init__.py
wagtail_modeltranslation/management/commands/__init__.py
wagtail_modeltranslation/management/commands/set_translation_url_paths.py
wagtail_modeltranslation/migrations/__init__.py
wagtail_modeltranslation/static/wagtail_modeltranslation/js/translated_slugs.js
wagtail_modeltranslation/templatetags/__init__.py
wagtail_modeltranslation/templatetags/modeltranslation.py

View file

@ -1,2 +0,0 @@
django-modeltranslation==0.9.1
wagtail

View file

@ -1 +0,0 @@
wagtail_modeltranslation

Binary file not shown.