Opened 15 months ago

Last modified 7 months ago

#27449 assigned New feature

Make django.utils.translation.trans_real.get_supported_language_variant public API

Reported by: Iacopo Spalletti Owned by: Sebastian Sangervasi
Component: Internationalization Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by Iacopo Spalletti)

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

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


Making this public will involve:

  • Adding documentation
  • Exposing it in django.utils.translation

Change History (8)

comment:1 Changed 15 months ago by Ingo Klöcker

Type: UncategorizedNew feature

comment:2 Changed 15 months ago by Ingo Klöcker

Easy pickings: set
Triage Stage: UnreviewedAccepted

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

comment:3 Changed 15 months ago by Iacopo Spalletti

Owner: changed from nobody to Iacopo Spalletti
Status: newassigned

comment:4 Changed 15 months ago by Iacopo Spalletti

Description: modified (diff)

comment:5 Changed 15 months ago by Iacopo Spalletti

I will work on a patch

comment:6 Changed 11 months ago by Lee Cartwright

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

comment:7 Changed 7 months ago by Sebastian Sangervasi

Owner: changed from Iacopo Spalletti to Sebastian Sangervasi

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.

comment:8 Changed 7 months ago by Sebastian Sangervasi

Has patch: set

I have submitted a pull request:

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.

Note: See TracTickets for help on using tickets.
Back to Top