Slide 1

Slide 1 text

django-parler Easily translate cheese omelet into omelette du fromage. Diederik van der Boor Django Meetup 14-05-2014

Slide 2

Slide 2 text

Simple Django model translations without nasty hacks with nice admin integration.

Slide 3

Slide 3 text

Got hopeful Making a CMS multilingual: Well, let's use something existing...

Slide 4

Slide 4 text

django-modeltranslation :-(

Slide 5

Slide 5 text

django-hvad :-( Very nice admin, awesome API – however: Overrides just about all ORM methods! Lots of metaclass magic Mixing translated with untranslated objects = hard Can't be combined with other apps (mptt, polymorphic, shop) Doesn't call super() often

Slide 6

Slide 6 text

django-polymorphic-tree Yes, we do crazy things...

Slide 7

Slide 7 text

django-fluent CMS ...when they make sense

Slide 8

Slide 8 text

1 row for each language

Slide 9

Slide 9 text

Let's just do this..!

Slide 10

Slide 10 text

And tried more hacking!

Slide 11

Slide 11 text

Package that! So we: – Hacked something directly in the CMS app – K.I.S.S – Manually created translated fields table – Manually assigned descriptors – Hey that works!!

Slide 12

Slide 12 text

Model API

Slide 13

Slide 13 text

Usage

Slide 14

Slide 14 text

Features Python 3 qs.translated(''en'', name=''foo'') qs.prefetch_related(''translations'') {% get_translated_url ''fr'' page as url %} caching individual objects admin tabs + inlines

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

Thanks to caching...

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

@vdboor @edoburu pip install 'django-parler>=1.0b2' https://github.com/edoburu/django-parler http://django-fluent.org