French Calendar
This commit is contained in:
parent
c672bea536
commit
20dc665fec
8 changed files with 29 additions and 1 deletions
Binary file not shown.
BIN
calendrier/__pycache__/translate.cpython-34.pyc
Normal file
BIN
calendrier/__pycache__/translate.cpython-34.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
calendrier/templatetags/__pycache__/translate.cpython-34.pyc
Normal file
BIN
calendrier/templatetags/__pycache__/translate.cpython-34.pyc
Normal file
Binary file not shown.
27
calendrier/templatetags/translate.py
Normal file
27
calendrier/templatetags/translate.py
Normal file
|
@ -0,0 +1,27 @@
|
|||
from django import template
|
||||
from django.utils.safestring import mark_safe
|
||||
|
||||
register = template.Library()
|
||||
|
||||
@register.filter
|
||||
def translate(tex):
|
||||
tex = tex.replace("January", "Janvier", 1)
|
||||
tex = tex.replace("February", "Février", 1)
|
||||
tex = tex.replace("March", "Mars", 1)
|
||||
tex = tex.replace("April", "Avril", 1)
|
||||
tex = tex.replace("May", "Mai", 1)
|
||||
tex = tex.replace("June", "Juin", 1)
|
||||
tex = tex.replace("July", "Juillet", 1)
|
||||
tex = tex.replace("August", "Août", 1)
|
||||
tex = tex.replace("September", "Septembre", 1)
|
||||
tex = tex.replace("October", "Octobre", 1)
|
||||
tex = tex.replace("November", "Novembre", 1)
|
||||
tex = tex.replace("December", "Décembre", 1)
|
||||
tex = tex.replace("Mon", "Lun", 1)
|
||||
tex = tex.replace("Tue", "Mar", 1)
|
||||
tex = tex.replace('Wed', "Mer", 1)
|
||||
tex = tex.replace("Thu", "Jeu", 1)
|
||||
tex = tex.replace("Fri", "Ven", 1)
|
||||
tex = tex.replace("Sat", "Sam", 1)
|
||||
tex = tex.replace("Sun", "Dim", 1)
|
||||
return mark_safe(tex)
|
BIN
db.sqlite3
BIN
db.sqlite3
Binary file not shown.
|
@ -1,6 +1,7 @@
|
|||
{% extends "base.html" %}
|
||||
{% load staticfiles %}
|
||||
{% load frenchmonth %}
|
||||
{% load translate %}
|
||||
|
||||
{% block extrahead %}
|
||||
<link rel="stylesheet" href={% static 'css/calend.css' %} />
|
||||
|
@ -22,7 +23,7 @@
|
|||
</tr>
|
||||
</table>
|
||||
<div id="calendar">
|
||||
{{Calendar}}
|
||||
{{Calendar|translate}}
|
||||
</div>
|
||||
{% if user.profile.is_chef %}
|
||||
<a href="{% url "calendrier.views.create_event" %}">Ajouter un évènement</a>
|
||||
|
|
Loading…
Reference in a new issue