[google-appengine] i18n and verbose_name

2010-03-22 Thread Emilis Kuke
Hello!
 I spend more than few hours using google and reading django and
google app engine documentation, but I couldn't find solution for my
problem. So I expect maybe somebody could helps me.

So I have model:
class Advertisement(db.Model):
  name = db.StringProperty(required=True,verbose_name=_(u'First
name'))

ModelForm:
class GiftForm(djangoforms.ModelForm):
  class Meta:
model = Advertisement

And template form

{{form.as_p}}


The problem is that "First name" label translates only when I change
settings.py LANGUAGE_CODE value. All other parts of view works
correctly out of the box. So I suppose that problem isn't django. Any
suggestions?

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.



Re: [google-appengine] Re: i18n and verbose_name

2010-03-24 Thread Emilis Kuke
Hello Niklasro! Thanks for response.

Does your pack and implementation work with verbose_name correctly. Is
it possible to change language for this property outside of system.py
configuration file. And if it you have a such implementation could you
share it with me?

I need to change language model like this

class Advertisement(db.Model):
  name = db.StringProperty(required=True,verbose_name=_(u'First name'))

not in settings.py.

LANGUAGE_CODE = 'lt'

_ = lambda s: s

LANGUAGES = (
('en', _('English')),
('lt', _('Lithuanian')),
)

Views transtales very well  with
'localeurl.middleware.LocaleURLMiddleware', but doesn't translate out
of the box model field, which represents label in my form value. So
After changing language in url I must to change LANGUAGE_CODE in
settings.py. So I'm in truble, becouse, I coudn't do this action the
the fly. Firstly I should stop server, second change LANGUAGE_CODE
variable value, and run server. So maybe do you have better solution
for my problem.

Thanks for the effor!

-- 
Sincerely,

Emilis Kuke

Tel.: +37067837043

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.