On 16 ene, 22:21, Rajesh Dhawan <[EMAIL PROTECTED]> wrote: > > Hi! Here I answer your questions: > > I don't have the translations anywhere right now, I'd like to have > > them in the po file. The menus don't change often, this is the reason > > I think that it's better to keep translations in the po file (if > > possilbe) > > I don't have translations in the db. > > In that case the answer is really simple! This is a regular i18n > usecase. > > 1. At the top of your template tags file add this import: > > from django.utils.translation import ugettext as _ > > 2. In the template tags file, change this line: > > salida += u"\t<li><a href='%s' title='%s'> > %s</a>\n" %( entrada.enlace, entrada.nombre, entrada.nombre ) > > to this: > > salida += u"\t<li><a href='%s' title='%s'> > %s</a>\n" %(_(entrada.enlace), _(entrada.nombre), _(entrada.nombre)) > > 3. Lastly, in your .po file, add your translations by hand. For > example: > > msgid "DB Text String" > msgstr "Translated Text String" > > msgid "DB Text String2" > msgstr "Translated Text String2" > > and so on... > > Then, follow instructions in the i18n Django docs to compile that .po > file and restart your server.http://www.djangoproject.com/documentation/i18n/ > > -Rajesh D
Thank you very much for your help! I was a bit lost with this stuff. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---