Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
a4df1ae9
Commit
a4df1ae9
authored
Aug 24, 2016
by
Skia
🤘
Browse files
Add language chooser
parent
f2c3c7dc
Changes
3
Hide whitespace changes
Inline
Side-by-side
core/templates/core/base.jinja
View file @
a4df1ae9
...
...
@@ -34,6 +34,16 @@
<div
id=
"popupheader"
>
{{
user.get_display_name
()
}}
</div>
{%
endif
%}
{%
endblock
%}
<div
id=
"language_chooser"
>
{%
for
language
in
LANGUAGES
%}
<form
action=
"
{{
url
(
'set_language'
)
}}
"
method=
"post"
>
{%
csrf_token
%}
<input
name=
"language"
value=
"
{{
language
[
0
]
}}
"
type=
"hidden"
/>
<input
type=
"submit"
value=
"
{{
language
[
1
]
}}
"
/>
</form>
{%
endfor
%}
</div>
{%
block
nav
%}
{%
if
not
popup
%}
<nav>
...
...
sith/settings_sample.py
View file @
a4df1ae9
...
...
@@ -156,6 +156,11 @@ DATABASES = {
LANGUAGE_CODE
=
'fr-FR'
LANGUAGES
=
[
(
'en'
,
_
(
'English'
)),
(
'fr'
,
_
(
'French'
)),
]
TIME_ZONE
=
'Europe/Paris'
USE_I18N
=
True
...
...
sith/urls.py
View file @
a4df1ae9
...
...
@@ -33,5 +33,6 @@ urlpatterns = [
url
(
r
'^api/v1/'
,
include
(
'api.urls'
,
namespace
=
"api"
,
app_name
=
"api"
)),
url
(
r
'^admin/'
,
include
(
admin
.
site
.
urls
)),
url
(
r
'^ajax_select/'
,
include
(
ajax_select_urls
)),
url
(
r
'^i18n/'
,
include
(
'django.conf.urls.i18n'
)),
]
+
static
(
settings
.
MEDIA_URL
,
document_root
=
settings
.
MEDIA_ROOT
)
# TODO: remove me for production!!!
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment