Opened 7 years ago

Last modified 6 years ago

#27449 closed New feature

Make django.utils.translation.trans_real.get_supported_language_variant public API — at Version 4

Reported by: Iacopo Spalletti Owned by: Iacopo Spalletti
Component: Internationalization Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
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 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

Change History (4)

comment:1 by Ingo Klöcker, 7 years ago

Type: UncategorizedNew feature

comment:2 by Ingo Klöcker, 7 years ago

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 by Iacopo Spalletti, 7 years ago

Owner: changed from nobody to Iacopo Spalletti
Status: newassigned

comment:4 by Iacopo Spalletti, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top