Revision b37a6fc5
Added by Benjamin Dauvergne almost 13 years ago
| entrouvert/djommon/locale/fr/LC_MESSAGES/django.po | ||
|---|---|---|
|
# djommon french translations
|
||
|
# Copyright (C) 2013 Entr'ouvert
|
||
|
# This file is distributed under the same license as the PACKAGE package.
|
||
|
# Benjamin Dauvergne <bdauvergne@entrouvert.com, 2013.
|
||
|
#
|
||
|
msgid ""
|
||
|
msgstr ""
|
||
|
"Project-Id-Version: djommon 1.0\n"
|
||
|
"Report-Msgid-Bugs-To: \n"
|
||
|
"POT-Creation-Date: 2013-04-25 18:01+0200\n"
|
||
|
"PO-Revision-Date: 2013-04-25 18:03+0200\n"
|
||
|
"Last-Translator: Benjamin Dauvergne <bdauvergne@entrouvert.com>\n"
|
||
|
"Language: fr\n"
|
||
|
"MIME-Version: 1.0\n"
|
||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||
|
"Content-Transfer-Encoding: 8bit\n"
|
||
|
"Plural-Forms: nplurals=2; plural=(n > 1)\n"
|
||
|
|
||
|
#: templatetags/djommon.py:32
|
||
|
msgctxt "list formation"
|
||
|
msgid ", "
|
||
|
msgstr ""
|
||
|
|
||
|
#: templatetags/djommon.py:34
|
||
|
msgctxt "list formation"
|
||
|
msgid "{first_part} and {last_part}"
|
||
|
msgstr "{first_part} et {last_part}"
|
||
| entrouvert/djommon/templatetags/eohumanize.py | ||
|---|---|---|
|
from django import template
|
||
|
from django.utils.safestring import mark_safe
|
||
|
from django.utils.html import escape
|
||
|
from django.utils.translation import pgettext
|
||
|
|
||
|
|
||
|
register = template.Library()
|
||
|
|
||
|
|
||
|
def widowless(value):
|
||
|
'''Replace normal spaces by non-breakable spaces'''
|
||
|
bits = escape(value).rsplit(' ', 1)
|
||
|
try:
|
||
|
widowless = u' '.join(bits)
|
||
|
return mark_safe(widowless)
|
||
|
except:
|
||
|
return value
|
||
|
register.filter(widowless)
|
||
|
|
||
|
|
||
|
def nonbreakinghyphen(value):
|
||
|
'''Replace normal hyphen by non-breaking version'''
|
||
|
return value.replace('-', '‑')
|
||
|
register.filter(nonbreakinghyphen)
|
||
|
|
||
|
|
||
|
def humanlist(value):
|
||
|
'''Format a list of string-like objects for human reading'''
|
||
|
if len(value) == 1:
|
||
|
return unicode(value[0])
|
||
|
elif len(value) > 1:
|
||
|
first_part = pgettext('list formation', ', ').join(map(unicode, value[:-1]))
|
||
|
last_part = unicode(value[-1])
|
||
|
return pgettext('list formation', u'{first_part} and {last_part}').format(first_part=first_part,
|
||
|
last_part=last_part)
|
||
|
register.filter(humanlist)
|
||
|
|
||
|
|
||
|
def ellipsize(value, length=25):
|
||
|
'''Truncate string and add an ellipsis to its end if it is longer than
|
||
|
length.
|
||
|
|
||
|
Default length is 25 characters.'''
|
||
|
if len(value) > length:
|
||
|
value = value[:length] + '…'
|
||
|
return value
|
||
|
register.filter(ellipsize)
|
||
Also available in: Unified diff
eohumanize: template tags for eo applications