[Django] #27449: Make django.utils.translation.trans_real.get_supported_language_variant public API

14 views
Skip to first unread message

Django

unread,
Nov 6, 2016, 5:14:39 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
------------------------------------------------+------------------------
Reporter: Iacopo Spalletti | Owner: nobody
Type: Uncategorized | Status: new
Component: Internationalization | Version: 1.10
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
How about making
django.utils.translation.trans_real.get_supported_language_variant part of
the public API?

A use case for this: Check if a given language is within the ones listed
in LANGUAGES, including the sublanguages, as stated in
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/:

This example restricts languages that are available for automatic
selection to German and English (and any sublanguage, like de-ch or en-
us).

Example: https://github.com/django-parler/django-parler/issues/156

Making this public will involve:

* Adding documentation
* Exposing it in ``django.utils.translation``

--
Ticket URL: <https://code.djangoproject.com/ticket/27449>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Nov 6, 2016, 6:54:21 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------

Reporter: Iacopo Spalletti | Owner: nobody
Type: New feature | Status: new
Component: | Version: 1.10
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 Ingo Klöcker):

* type: Uncategorized => New feature


--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:1>

Django

unread,
Nov 6, 2016, 7:13:04 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
--------------------------------------+------------------------------------

Reporter: Iacopo Spalletti | Owner: nobody
Type: New feature | Status: new
Component: Internationalization | Version: 1.10
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by Ingo Klöcker):

* easy: 0 => 1
* stage: Unreviewed => Accepted


Comment:

I think it makes sense to make it public API. It also seems to be fairly
easy to do.

--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:2>

Django

unread,
Nov 6, 2016, 7:27:50 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Iacopo
| Spalletti
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |

Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Iacopo Spalletti):

* owner: nobody => Iacopo Spalletti
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:3>

Django

unread,
Nov 6, 2016, 7:28:24 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Iacopo
| Spalletti
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Iacopo Spalletti:

Old description:

> How about making
> django.utils.translation.trans_real.get_supported_language_variant part
> of the public API?
>
> A use case for this: Check if a given language is within the ones listed
> in LANGUAGES, including the sublanguages, as stated in
> https://docs.djangoproject.com/en/1.10/topics/i18n/translation/:
>
> This example restricts languages that are available for automatic
> selection to German and English (and any sublanguage, like de-ch or en-
> us).
>
> Example: https://github.com/django-parler/django-parler/issues/156
>
> Making this public will involve:
>
> * Adding documentation
> * Exposing it in ``django.utils.translation``

New description:

How about making
django.utils.translation.trans_real.get_supported_language_variant part of
the public API?

A use case for this: Check if a given language is within the ones listed
in LANGUAGES, including the sublanguages, as stated in
https://docs.djangoproject.com/en/1.10/topics/i18n/translation/:

This example restricts languages that are available for automatic
selection to German and English (and any sublanguage, like de-ch or en-
us).

Example: https://github.com/django-parler/django-parler/issues/156

Making this public will involve:

* Adding documentation
* Exposing it in `django.utils.translation`

--

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

Django

unread,
Nov 6, 2016, 7:28:42 AM11/6/16
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Iacopo
| Spalletti
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Iacopo Spalletti):

I will work on a patch

--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:5>

Django

unread,
Feb 19, 2017, 6:30:49 PM2/19/17
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Iacopo
| Spalletti
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Lee Cartwright):

It's been a while since this ticket was updated. Are there any objections
to me taking it on?

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

Django

unread,
Jun 27, 2017, 7:40:14 PM6/27/17
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi

Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sebastian Sangervasi):

* owner: Iacopo Spalletti => Sebastian Sangervasi


Comment:

This seems to have gone unattended for four months, so I worked on it as a
first contribution. I have a pull request ready to go, so I'm going to
claim this.

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

Django

unread,
Jun 27, 2017, 8:00:30 PM6/27/17
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Sebastian Sangervasi):

* has_patch: 0 => 1


Comment:

I have submitted a pull request:
[https://github.com/django/django/pull/8682]

I followed procedure for the creation of new tests and all tests pass.
However, I had some questions about how tests are being done for
translation. I'm going to ask these these questions on the pull request,
but I can move them here if that is preferred.

--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:8>

Django

unread,
Feb 18, 2018, 6:58:39 PM2/18/18
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Sebastian Sangervasi):

My patch has been reviewed and, after some documentation updates, should
be ready to merge into 2.1.

--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:9>

Django

unread,
Feb 19, 2018, 4:04:45 AM2/19/18
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi
Type: New feature | Status: assigned
Component: | Version: 1.10
Internationalization |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_docs: 0 => 1


--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:10>

Django

unread,
Feb 19, 2018, 2:43:41 PM2/19/18
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi
Type: New feature | Status: assigned
Component: | Version: 1.10
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* needs_docs: 1 => 0
* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:11>

Django

unread,
Feb 23, 2018, 3:22:43 PM2/23/18
to django-...@googlegroups.com
#27449: Make django.utils.translation.trans_real.get_supported_language_variant
public API
-------------------------------------+-------------------------------------
Reporter: Iacopo Spalletti | Owner: Sebastian
| Sangervasi
Type: New feature | Status: closed
Component: | Version: 1.10
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: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

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


Comment:

In [changeset:"7905815510fb1eae99010ccc0039249d981a121c" 7905815]:
{{{
#!CommitTicketReference repository=""
revision="7905815510fb1eae99010ccc0039249d981a121c"
Fixed #27449 -- Added
django.utils.translation.get_supported_language_variant().
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/27449#comment:12>

Reply all
Reply to author
Forward
0 new messages