Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#25933 closed New feature (fixed)

Allow unprefixed default language in i18n_patterns

Reported by: Krzysztof Urbaniak Owned by: nobody
Component: Internationalization Version: dev
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 by Tim Graham, 8 years ago

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

comment:2 by Tim Graham, 8 years ago

Claude, does this proposal look reasonable?

comment:3 by Claude Paroz, 8 years ago

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

comment:4 by Simon Charette, 8 years ago

Needs documentation: unset
Needs tests: unset

comment:5 by Simon Charette, 8 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Tim Graham <timograham@…>, 8 years ago

Resolution: fixed
Status: newclosed

In 839a955d:

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

comment:7 by Tim Graham <timograham@…>, 8 years ago

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