The only use case I can think of where string_concat is still needed is
when concatenating an arbitrary amount of list elements. My guess is that
this use case rarely exists - and those that do exist might be able to use
django.utils.text.get_text_list ?
(An alternative approach would be to move
django.utils.translation.string_concat to django.utils.text.concat_lazy -
since django.utils.text is more appropriate)
--
Ticket URL: <https://code.djangoproject.com/ticket/27067>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
Just realized string_concat could be directly replaced by:
{{{
format_lazy('{}'*len(params), *params)
}}}
Maybe not the prettiest but should work for those rare cases.
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:1>
* stage: Unreviewed => Accepted
Comment:
I'm fully for deprecating `string_concat` if we have a nice replacement. I
guess the first step to demonstrate the feasibility is to do the
replacement for Django usage itself.
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:2>
* owner: nobody => lovmat
* status: new => assigned
Comment:
https://github.com/lovmat/django/tree/ticket_27067
Todo: Documentation
Depends on: #26866 / PR 7087
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:3>
Comment (by claudep):
I think I'm totally convinced now :-)
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:4>
Comment (by claudep):
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/#joining-
strings-string-concat will also need an update.
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:5>
* has_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:7>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"2315114090815aed72be2b9bc936d7b6374f12fc" 23151140]:
{{{
#!CommitTicketReference repository=""
revision="2315114090815aed72be2b9bc936d7b6374f12fc"
Fixed #27067 -- Deprecated string_concat() in favor of format_lazy().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"87d2240e6cc594a3bf28dfdb2ec023c54fb76ff7" 87d2240e]:
{{{
#!CommitTicketReference repository=""
revision="87d2240e6cc594a3bf28dfdb2ec023c54fb76ff7"
Refs #27067 -- Removed django.utils.translation.string_concat() per
deprecation timeline.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:9>
Comment (by Tim Graham <timograham@…>):
In [changeset:"3fa0a824c2f62f6f0173651168402d5abcfb5765" 3fa0a82]:
{{{
#!CommitTicketReference repository=""
revision="3fa0a824c2f62f6f0173651168402d5abcfb5765"
Refs #27067 -- Removed string_concat in django.utils.translation.__all__.
Undefined since 87d2240e6cc594a3bf28dfdb2ec023c54fb76ff7.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:10>