Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2014-02-08 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  matiasb
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
  blocktrans,template_string_if_invalid|  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-

Comment (by Claude Paroz ):

 In [changeset:"02add43568b694ef25afeae474b5b1da883826c6"]:
 {{{
 #!CommitTicketReference repository=""
 revision="02add43568b694ef25afeae474b5b1da883826c6"
 Fixed #21417 -- Expanded TEMPLATE_STRING_IF_INVALID in blocktrans

 Thanks keturn for the reporti, Chris Medrela for details and
 Tim Graham for the review.
 Refs #19915.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/065.3ccc3bd5f3e1561c31adefbabd3ed2f7%40djangoproject.com.
For more options, visit https://groups.google.com/groups/opt_out.


Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-03-03 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  matiasb
 Type:  Bug  |   Status:  closed
Component:  Template system  |  Version:  1.4
 Severity:  Normal   |   Resolution:  fixed
 Keywords:   | Triage Stage:  Accepted
  blocktrans,template_string_if_invalid|  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by Ramiro Morales ):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"804366327d728d23a9f7a25ff77a6eed3c9f9323"]:
 {{{
 #!CommitTicketReference repository=""
 revision="804366327d728d23a9f7a25ff77a6eed3c9f9323"
 Fixed #19915 - Made blocktrans tag honor TEMPLATE_STRING_IF_INVALID.

 Thanks Natalia Bidart for the report and Matías Bordese for the fix.
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-02-27 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  matiasb
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  blocktrans,template_string_if_invalid|  Needs documentation:  0
Has patch:  1|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by matiasb):

 * has_patch:  0 => 1


Comment:

 Proposed fix, pull request: https://github.com/django/django/pull/865
 (all tests passing using SQLite).

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-02-25 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  matiasb
 Type:  Bug  |   Status:  assigned
Component:  Template system  |  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  blocktrans,template_string_if_invalid|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by matiasb):

 * status:  new => assigned
 * owner:  nobody => matiasb


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-02-25 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Template system  |  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:  Accepted
  blocktrans,template_string_if_invalid|  Needs documentation:  0
Has patch:  0|  Patch needs improvement:  0
  Needs tests:  0|UI/UX:  0
Easy pickings:  0|
-+-
Changes (by carljm):

 * component:  Uncategorized => Template system
 * stage:  Unreviewed => Accepted


-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-02-25 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |Owner:  nobody
 Type:  Bug  |   Status:  new
Component:  Uncategorized|  Version:  1.4
 Severity:  Normal   |   Resolution:
 Keywords:   | Triage Stage:
  blocktrans,template_string_if_invalid|  Unreviewed
Has patch:  0|  Needs documentation:  0
  Needs tests:  0|  Patch needs improvement:  0
Easy pickings:  0|UI/UX:  0
-+-
Changes (by nessita):

 * needs_better_patch:   => 0
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 A simple solution would be to apply something like this (if approved I can
 propose a proper patch with tests):

 {{{
 #!diff
 --- a/django/templatetags/i18n.py
 +++ b/django/templatetags/i18n.py
 @@ -143,7 +143,8 @@ class BlockTranslateNode(Node):
  result = translation.pgettext(message_context, singular)
  else:
  result = translation.ugettext(singular)
 -data = dict([(v, render_value_in_context(context.get(v, ''),
 context)) for v in vars])
 +from django.conf import settings
 +data = dict([(v, render_value_in_context(context.get(v,
 settings.TEMPLATE_STRING_IF_INVALID), context)) for v in vars])
  context.pop()
  try:
  result = result % data
 }}}

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.




[Django] #19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting

2013-02-25 Thread Django
#19915: templatetag "blocktrans" ignores the TEMPLATE_STRING_IF_INVALID setting
-+-
 Reporter:  nessita  |  Owner:  nobody
 Type:  Bug  | Status:  new
Component:   |Version:  1.4
  Uncategorized  |   Keywords:
 Severity:  Normal   |  blocktrans,template_string_if_invalid
 Triage Stage:   |  Has patch:  0
  Unreviewed |  UI/UX:  0
Easy pickings:  0|
-+-
 If I define the setting TEMPLATE_STRING_IF_INVALID to something other than
 the empty string, for example:

 TEMPLATE_STRING_IF_INVALID = 'INVALID'

 when I have a template that uses the templatetag blocktrans, all those
 variables not defined in any context (neither local nor global context)
 are not shown as INVALID but they are rendered as the empty string
 instead.

 You can reproduce this by:

 * define the setting to be:

 {{{
 TEMPLATE_STRING_IF_INVALID = 'INVALID'
 }}}

 * create a dummy template {{{foo.txt}}}:

 {{{
 {% load i18n %}

 {% blocktrans %}Hello {{ thing }}!

 Django {{ action }} big time!
 {% endblocktrans %}
 }}}

 * render the template with an incomplete context:

 {{{
 >>> from django.template.loader import render_to_string
 >>> print render_to_string('foo.txt', {'thing': 'world'})

 Hello world!

 Django  big time!
 }}}

 * then, remove the blocktrans tags, and re-render, you will get instead:

 {{{
 >>> print render_to_string('foo.txt', {'thing': 'world'})

 Hello world!

 Django INVALID big time!
 }}}

 I would expect the same behaviour with or without the use of blocktrans.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.