[Django] #27067: Deprecate string_concat

14 views
Skip to first unread message

Django

unread,
Aug 15, 2016, 4:16:45 PM8/15/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+--------------------
Reporter: lovmat | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+--------------------
Continuing from #26866 I'd like to deprecate
django.utils.translation.string_concat in favor of
django.utils.text.format_lazy. string_concat can easily be replaced by
format_lazy in Django source code.

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.

Django

unread,
Aug 15, 2016, 4:56:56 PM8/15/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
-------------------------------------+-------------------------------------
Reporter: lovmat | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by lovmat):

* 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>

Django

unread,
Aug 16, 2016, 3:52:20 AM8/16/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+------------------------------------

Reporter: lovmat | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Internationalization | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by claudep):

* 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>

Django

unread,
Aug 16, 2016, 6:12:27 AM8/16/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+------------------------------------
Reporter: lovmat | Owner: lovmat
Type: Cleanup/optimization | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by lovmat):

* 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>

Django

unread,
Aug 16, 2016, 8:20:46 AM8/16/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+------------------------------------
Reporter: lovmat | Owner: lovmat
Type: Cleanup/optimization | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by claudep):

I think I'm totally convinced now :-)

--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:4>

Django

unread,
Aug 19, 2016, 4:25:31 AM8/19/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+------------------------------------
Reporter: lovmat | Owner: lovmat
Type: Cleanup/optimization | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

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>

Django

unread,
Aug 24, 2016, 5:45:15 PM8/24/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
--------------------------------------+------------------------------------
Reporter: lovmat | Owner: lovmat
Type: Cleanup/optimization | Status: assigned
Component: Internationalization | Version: master

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by lovmat):

* has_patch: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:6>

Django

unread,
Aug 25, 2016, 10:03:11 AM8/25/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
-------------------------------------+-------------------------------------
Reporter: lovmat | Owner: lovmat
Type: | Status: assigned

Cleanup/optimization |
Component: | Version: master
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27067#comment:7>

Django

unread,
Aug 25, 2016, 4:13:13 PM8/25/16
to django-...@googlegroups.com
#27067: Deprecate string_concat
-------------------------------------+-------------------------------------
Reporter: lovmat | Owner: lovmat
Type: | Status: closed

Cleanup/optimization |
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* 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>

Django

unread,
Sep 22, 2017, 1:39:42 PM9/22/17
to django-...@googlegroups.com
#27067: Deprecate string_concat
-------------------------------------+-------------------------------------
Reporter: Mattias Loverot | Owner: Mattias
Type: | Loverot
Cleanup/optimization | Status: closed

Component: | Version: master
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Django

unread,
Sep 29, 2017, 10:32:46 AM9/29/17
to django-...@googlegroups.com
#27067: Deprecate string_concat
-------------------------------------+-------------------------------------
Reporter: Mattias Loverot | Owner: Mattias
Type: | Loverot
Cleanup/optimization | Status: closed
Component: | Version: master
Internationalization |
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

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>

Reply all
Reply to author
Forward
0 new messages