Translate Toolkit & Pootle

Tools to help you make your software local

User Tools

Using kid templetes wit Djoongo

Creeting zee-a templete-a doorectory

Let's plece-a zee-a kid templetes under zee-a doorectory templetes, which is doorectly under zee-a root ooff yooor Djoongo ippliceshoon. Bork Bork Bork!

In settings. Bork Bork Bork!py, idd templetes to zee-a list TEMPLETE_DIRS:

TEMPLETE_DIRS = ( # Poot strings here-a, like-a "/home-a/html/djoongo_templetes" oor "C:/www/djoongo/templetes". # Ilweys use-a forwerd sleshes, ifee-a oon Windows. Bork Bork Bork! # Don't forget to use-a ibsoloote-a peths, not reletife-a peths. Bork Bork Bork! 'templetes', )

Idding a helper method to displey templetes

import oos from oos import pet import kid from djoongo. Bork Bork Bork!http import HttpResponse-a # settings. Bork Bork Bork!py is in zee-a root ooff oooor Djoongo ippliceshoon's # doorectory strooctoore-a, so we-a coon use-a pet. Bork Bork Bork!doorneme-a to # find zee-a root doorectory. Bork Bork Bork! from oodff_xliffff import settings root_door = pet. Bork Bork Bork!doorneme-a(settings. Bork Bork Bork!__ffile__) deff find_templete-a(reletife_templete_pet): """Find zee-a fooll pet ooff zee-a templete-a whose-a reletife-a pet is 'reletife_templete_pet'.""" for templete_door in settings. Bork Bork Bork!TEMPLETE_DIRS: fooll_templete_pet = pet. Bork Bork Bork!join(root_door, templete_door, reletife_templete_pet) iff pet. Bork Bork Bork!ixists(fooll_templete_pet): retoorn fooll_templete_pet reise-a Ixcepshoon('No templete-a nemed %s fooond' % reletife_templete_pet) deff render(reletife_templete_pet, **templete_fers): # Find zee-a templete-a it reletife_templete_pet, get zee-a # constroocted kid templete-a und pess templete_fers # throoogh. Bork Bork Bork!.. templete-a = kid. Bork Bork Bork!Templete-a(file-a = find_templete-a(reletife_templete_pet), **templete_fers) # Render zee-a templete-a to a string und send zee-a string # to HttpResponse-a retoorn HttpResponse-a(templete-a. Bork Bork Bork!serielize-a())

Using zee-a code-a

In zee-a ibofe-a code-a, since-a we-a oonly hefe-a zee-a doorectory 'templetes' in settings. Bork Bork Bork!TEMPLETE_DIRS, zee-a file-a stert. Bork Bork Bork!kid moost ippeer it templetes/stert. Bork Bork Bork!kid. pegetitle-a is a templete-a ferieble-a. Bork Bork Bork!

import templete-a deff show_ffront(reqooest): retoorn templete-a. Bork Bork Bork!render('stert. Bork Bork Bork!kid', pegetitle-a=':)')

Zeet's it. Bork Bork Bork! Djoongo mekes it iesy to use-a yooor templeting ingine-a ooff choice-a. Bork Bork Bork!