mirror of
https://github.com/DarrenOfficial/dpaste.git
synced 2024-12-23 23:23:06 +11:00
Further language cleanup.
This commit is contained in:
parent
dce3d6b9bd
commit
8683c4c30d
5 changed files with 6 additions and 6 deletions
|
@ -61,7 +61,7 @@ behavior without touching the code:
|
|||
(3600 * 24 * 30 * 12 * 100, ugettext(u'100 Years')),
|
||||
)
|
||||
|
||||
**One-time snippets** are supported. One time snippets are automatically
|
||||
**One-time snippets** are supported. One-Time snippets are automatically
|
||||
deleted once a defined view count has reached (Default: ``2``). To
|
||||
enable one-time snippets you have to add a choice ``onetime`` to the
|
||||
expire choices::
|
||||
|
|
|
@ -82,7 +82,7 @@ class SnippetForm(forms.ModelForm):
|
|||
def clean_content(self):
|
||||
content = self.cleaned_data.get('content', '')
|
||||
if content.strip() == '':
|
||||
raise forms.ValidationError(_('Please fill out this field.'))
|
||||
raise forms.ValidationError(_('This field is required.'))
|
||||
return content
|
||||
|
||||
def clean_expires(self):
|
||||
|
|
|
@ -35,7 +35,7 @@ class Snippet(models.Model):
|
|||
EXPIRE_CHOICES = (
|
||||
(EXPIRE_TIME, _(u'Expire by timestamp')),
|
||||
(EXPIRE_KEEP, _(u'Keep Forever')),
|
||||
(EXPIRE_ONETIME, _(u'One time snippet')),
|
||||
(EXPIRE_ONETIME, _(u'One-Time snippet')),
|
||||
)
|
||||
|
||||
secret_id = models.CharField(_(u'Secret ID'), max_length=255, blank=True, null=True,
|
||||
|
|
|
@ -81,9 +81,9 @@
|
|||
<p class="message">
|
||||
{% trans "This is a one-time snippet." %}
|
||||
{% if snippet.remaining_views > 1 %}
|
||||
{% trans "It will automatically get deleted after {{ remaining }} further views." %}
|
||||
{% blocktrans with remaining=snippet.remaining_views %}It is automatically removed after {{ remaining }} further views.{% endblocktrans %}
|
||||
{% elif snippet.remaining_views == 1 %}
|
||||
{% trans "It will automatically get deleted after the next view." %}
|
||||
{% trans "It is automatically removed after the next view." %}
|
||||
{% else %}
|
||||
{% trans "It cannot be viewed again." %}
|
||||
{% endif %}
|
||||
|
|
|
@ -67,7 +67,7 @@ def snippet_details(request, snippet_id, template_name='dpaste/snippet_details.h
|
|||
"""
|
||||
snippet = get_object_or_404(Snippet, secret_id=snippet_id)
|
||||
|
||||
# One time snippet get deleted if the view count matches our limit
|
||||
# One-Time snippet get deleted if the view count matches our limit
|
||||
if snippet.expire_type == Snippet.EXPIRE_ONETIME \
|
||||
and snippet.view_count >= ONETIME_LIMIT:
|
||||
snippet.delete()
|
||||
|
|
Loading…
Reference in a new issue