Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle default language prefix #12

Closed
st4lk opened this issue Feb 23, 2015 · 0 comments
Closed

Handle default language prefix #12

st4lk opened this issue Feb 23, 2015 · 0 comments

Comments

@st4lk
Copy link
Owner

st4lk commented Feb 23, 2015

Add following settings (all False by default):

SOLID_I18N_HANDLE_DEFAULT_PREFIX

If True, respond normally to url with default language prefix. Otherwise raise 404 (default behaviour).
Example:

LANGUAGE_CODE = 'en'
SOLID_I18N_HANDLE_DEFAULT_PREFIX = False # default
url '/' render default language
url '/en/' return 404

# ========
SOLID_I18N_HANDLE_DEFAULT_PREFIX = True
url '/' render default language
url '/en/' render default language (same as '/')

SOLID_I18N_DEFAULT_PREFIX_REDIRECT

If True, url with default language prefix will return redirect to url without any language prefix.
Example:

LANGUAGE_CODE = 'en'
SOLID_I18N_DEFAULT_PREFIX_REDIRECT = False # default
url '/' render default language
url '/en/' return 404

# ========
SOLID_I18N_HANDLE_DEFAULT_PREFIX = True
url '/' render default language
url '/en/' return redirect to '/'

Linked to #10

st4lk added a commit that referenced this issue Feb 23, 2015
st4lk added a commit that referenced this issue Feb 23, 2015
@st4lk st4lk closed this as completed Feb 23, 2015
@st4lk st4lk mentioned this issue Feb 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant