Re: i18n variable string translation
Another problem I am facing is it seems some pages are not being translated until I hit certain page, after that everything is fine. I am not exactly sure what the problem is but if you guys experience this problem, would appreciate some insights. -Aaron On Wed, Jun 16, 2010 at 4:47 PM, Aaron Leewrote: > Thanks, the lazy translation solves the problem. > > -Aaron > > > On Wed, Jun 16, 2010 at 2:59 PM, Antoni Aloy wrote: > >> Try to use lazy translation. >> >> El 16/06/2010 23:09, "Aaron" escribió: >> >> >> Well what happened was I have a forms.py >> >> which has >> >> CONSTANT = _("Hello World") >> x = {'var': CONSTANT } >> >> and in the django.po, I do have a translation >> >> msgid "Hello World" >> msgstr "xxx" >> >> But it doesn't show up on the website, all the other translations >> work, so I am wondering what am I missing >> >> -Aaron >> >> >> >> On Jun 16, 1:35 pm, Baurzhan Ismagulov wrote: >> > On Wed, Jun 16, 2010 at 01:00:3... >> > Baurzhan Ismagulovhttp://www.kz-easy.com/ >> >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To post to this group, send email to django-us...@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com >> . >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: i18n variable string translation
Thanks, the lazy translation solves the problem. -Aaron On Wed, Jun 16, 2010 at 2:59 PM, Antoni Aloywrote: > Try to use lazy translation. > > El 16/06/2010 23:09, "Aaron" escribió: > > > Well what happened was I have a forms.py > > which has > > CONSTANT = _("Hello World") > x = {'var': CONSTANT } > > and in the django.po, I do have a translation > > msgid "Hello World" > msgstr "xxx" > > But it doesn't show up on the website, all the other translations > work, so I am wondering what am I missing > > -Aaron > > > > On Jun 16, 1:35 pm, Baurzhan Ismagulov wrote: > > On Wed, Jun 16, 2010 at 01:00:3... > > Baurzhan Ismagulovhttp://www.kz-easy.com/ > > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group > > -- > You received this message because you are subscribed to the Google Groups > "Django users" group. > To post to this group, send email to django-us...@googlegroups.com. > To unsubscribe from this group, send email to > django-users+unsubscr...@googlegroups.com > . > For more options, visit this group at > http://groups.google.com/group/django-users?hl=en. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: i18n variable string translation
Try to use lazy translation. El 16/06/2010 23:09, "Aaron"escribió: Well what happened was I have a forms.py which has CONSTANT = _("Hello World") x = {'var': CONSTANT } and in the django.po, I do have a translation msgid "Hello World" msgstr "xxx" But it doesn't show up on the website, all the other translations work, so I am wondering what am I missing -Aaron On Jun 16, 1:35 pm, Baurzhan Ismagulov wrote: > On Wed, Jun 16, 2010 at 01:00:3... > Baurzhan Ismagulovhttp://www.kz-easy.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: i18n variable string translation
Well what happened was I have a forms.py which has CONSTANT = _("Hello World") x = {'var': CONSTANT } and in the django.po, I do have a translation msgid "Hello World" msgstr "xxx" But it doesn't show up on the website, all the other translations work, so I am wondering what am I missing -Aaron On Jun 16, 1:35 pm, Baurzhan Ismagulovwrote: > On Wed, Jun 16, 2010 at 01:00:36PM -0700, Aaron Lee wrote: > > def my_view(request): > > sentence = 'Welcome to my site.' > > output = _(sentence) > > return HttpResponse(output) > > > (The caveat with using variables or computed values, as in the previous two > > examples, is that Django’s translation-string-detecting utility, > > django-admin.py makemessages, won’t be able to find these strings. More on > > makemessages later.) > > It's a bit confusing, one one hand it says Translation works on variables, > > on the other hand, it says makemessages won't be able to find these strings. > > Yes, it will work if you happen to have a translation, and yes, it > doesn't say how to identify such strings for translation, because the > value of the variable may not be known at the time makemessages is run > (neither is it straightforward in cases where it could in theory be > calculated). > > What kind of problem are you trying to solve? > > With kind regards, > -- > Baurzhan Ismagulovhttp://www.kz-easy.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
Re: i18n variable string translation
On Wed, Jun 16, 2010 at 01:00:36PM -0700, Aaron Lee wrote: > def my_view(request): > sentence = 'Welcome to my site.' > output = _(sentence) > return HttpResponse(output) > > (The caveat with using variables or computed values, as in the previous two > examples, is that Django’s translation-string-detecting utility, > django-admin.py makemessages, won’t be able to find these strings. More on > makemessages later.) > It's a bit confusing, one one hand it says Translation works on variables, > on the other hand, it says makemessages won't be able to find these strings. Yes, it will work if you happen to have a translation, and yes, it doesn't say how to identify such strings for translation, because the value of the variable may not be known at the time makemessages is run (neither is it straightforward in cases where it could in theory be calculated). What kind of problem are you trying to solve? With kind regards, -- Baurzhan Ismagulov http://www.kz-easy.com/ -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.