Opened 5 years ago

Closed 4 years ago

Last modified 4 years ago

#25933 closed New feature (fixed)

Allow unprefixed default language in i18n_patterns

Reported by: Krzysztof Urbaniak Owned by: nobody
Component: Internationalization Version: master
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tim Graham)

The idea is to allow having the default language urls un-prefixed.

So adding a translations to existing site is more seamless - it does not require changing current urls, just adding new ones.

That pattern with un-prefixed default language is pretty common - for example https://www.apple.com (which is en_US) and https://www.apple.com/fr/ (fr_FR).

Any other language than the default one is prefixed as before using i18n_patterns.

The idea for that is having a prefix_default_language param to i18n_patterns, which is True by default, to keep it compatible with current approach. Setting it to False will turn on this "feature".

Here's the code: https://github.com/django/django/pull/5823

Change History (7)

comment:1 Changed 5 years ago by Tim Graham

Description: modified (diff)
Summary: Allow un-prefixed default language in i18n_patternsAllow unprefixed default language in i18n_patterns
Type: UncategorizedNew feature

comment:2 Changed 5 years ago by Tim Graham

Claude, does this proposal look reasonable?

comment:3 Changed 5 years ago by Claude Paroz

Has patch: set
Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedAccepted

comment:4 Changed 4 years ago by Simon Charette

Needs documentation: unset
Needs tests: unset

comment:5 Changed 4 years ago by Simon Charette

Triage Stage: AcceptedReady for checkin

comment:6 Changed 4 years ago by Tim Graham <timograham@…>

Resolution: fixed
Status: newclosed

In 839a955d:

Fixed #25933 -- Allowed an unprefixed default language in i18n_patterns().

comment:7 Changed 4 years ago by Tim Graham <timograham@…>

In 85a4844f:

Refs #25933 -- Fixed i18n_patterns() prefix_default_language=False with HTTP_ACCEPT_LANGUAGE header.

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