diff --git a/CHANGELOG b/CHANGELOG index cacad4d..abf97d3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -36,7 +36,7 @@ Changelog ---------------- * IRC lexer is now in the default lexer list. -* One-time snippet support. Snippets get automatically deleted after the +* One-Time snippet support. Snippets get automatically deleted after the another user looks at it. * Toggle wordwrap for code snippets. * General UI and readability improvements. diff --git a/docs/settings.rst b/docs/settings.rst index 4f6c83d..9adc951 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -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:: diff --git a/dpaste/forms.py b/dpaste/forms.py index b5e42a9..3bb7542 100644 --- a/dpaste/forms.py +++ b/dpaste/forms.py @@ -8,7 +8,7 @@ from dpaste.models import Snippet from dpaste.highlight import LEXER_LIST, LEXER_DEFAULT, LEXER_KEYS EXPIRE_CHOICES = getattr(settings, 'DPASTE_EXPIRE_CHOICES', ( - ('onetime', _(u'One Time Snippet')), + ('onetime', _(u'One-Time snippet')), (3600, _(u'In one hour')), (3600 * 24 * 7, _(u'In one week')), (3600 * 24 * 30, _(u'In one month')), diff --git a/dpaste/locale/de/LC_MESSAGES/django.mo b/dpaste/locale/de/LC_MESSAGES/django.mo index 1f283bf..be42be5 100644 Binary files a/dpaste/locale/de/LC_MESSAGES/django.mo and b/dpaste/locale/de/LC_MESSAGES/django.mo differ diff --git a/dpaste/locale/de/LC_MESSAGES/django.po b/dpaste/locale/de/LC_MESSAGES/django.po index d6ecd36..d8fcf34 100644 --- a/dpaste/locale/de/LC_MESSAGES/django.po +++ b/dpaste/locale/de/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: dpaste\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-25 10:06+0000\n" +"POT-Creation-Date: 2014-10-28 11:00+0000\n" "PO-Revision-Date: 2014-10-28 11:20+0100\n" "Last-Translator: Martin Mahner \n" "Language-Team: DE \n" @@ -18,8 +18,8 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Generator: Poedit 1.6.10\n" -#: forms.py:11 -msgid "One Time Snippet" +#: forms.py:11 models.py:38 templates/dpaste/snippet_details.html:59 +msgid "One-Time snippet" msgstr "One-Time snippet" #: forms.py:12 @@ -74,10 +74,6 @@ msgstr "Nach Zeitstempel auslaufen lassen" msgid "Keep Forever" msgstr "Für immer behalten" -#: models.py:38 -msgid "One-Time snippet" -msgstr "One-Time snippet" - #: models.py:41 msgid "Secret ID" msgstr "Geheime ID" @@ -94,15 +90,11 @@ msgstr "Auslauftyp" msgid "View count" msgstr "Anzahl der Besuche" -#: views.py:200 -msgid "No changes were made between this two files." -msgstr "Zwischen diesen beiden Dateien wurden keine Änderungen gemacht." - -#: templates/dpaste/about.html:44 +#: templates/dpaste/about.html:59 msgid "Statistics" msgstr "Statistiken" -#: templates/dpaste/about.html:46 +#: templates/dpaste/about.html:61 #, python-format msgid "" "There are %(total)s snippets in the database. The most popular languages are:" @@ -139,10 +131,6 @@ msgstr "Erlischt in: %(date)s" msgid "Snippet never expires" msgstr "Snippet erlischt niemals" -#: templates/dpaste/snippet_details.html:59 -msgid "One-time snippet" -msgstr "One-Time snippet" - #: templates/dpaste/snippet_details.html:63 msgid "Really delete this snippet?" msgstr "Dieses Snippet wirklich löschen?" @@ -165,7 +153,7 @@ msgstr "Gist" #: templates/dpaste/snippet_details.html:82 msgid "This is a one-time snippet." -msgstr "Dies ist ein One-Time snippet" +msgstr "Dies ist ein One-Time Snippet." #: templates/dpaste/snippet_details.html:84 #, python-format @@ -205,6 +193,10 @@ msgstr "Erlischt in" msgid "Paste it" msgstr "Paste" +#: templates/dpaste/snippet_form.html:39 +msgid "or" +msgstr "" + #: templates/dpaste/snippet_list.html:16 msgid "DATETIME_FORMAT" msgstr "DATETIME_FORMAT" @@ -212,7 +204,7 @@ msgstr "DATETIME_FORMAT" #: templates/dpaste/snippet_list.html:17 #, python-format msgid "%(since)s ago" -msgstr "seit %(since)s" +msgstr "Vor %(since)s" #: templates/dpaste/snippet_list.html:23 msgid "" @@ -222,6 +214,10 @@ msgstr "" "Keine Snippets gespeichert. Entweder sind alle deine Snippets erloschen oder " "dein Cookie hat sich geändert." +#: views.py:200 +msgid "No changes were made between this two files." +msgstr "Zwischen diesen beiden Dateien wurden keine Änderungen gemacht." + #, fuzzy #~ msgid "Please fill out this field." #~ msgstr "Bitte dieses Feld ausfüllen." diff --git a/dpaste/locale/en/LC_MESSAGES/django.mo b/dpaste/locale/en/LC_MESSAGES/django.mo index 4f240ad..77e904a 100644 Binary files a/dpaste/locale/en/LC_MESSAGES/django.mo and b/dpaste/locale/en/LC_MESSAGES/django.mo differ diff --git a/dpaste/locale/en/LC_MESSAGES/django.po b/dpaste/locale/en/LC_MESSAGES/django.po index 872194e..eb26032 100644 --- a/dpaste/locale/en/LC_MESSAGES/django.po +++ b/dpaste/locale/en/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-25 10:08+0000\n" +"POT-Creation-Date: 2014-10-28 11:01+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,8 +17,8 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -#: forms.py:11 -msgid "One Time Snippet" +#: forms.py:11 models.py:38 templates/dpaste/snippet_details.html:59 +msgid "One-Time snippet" msgstr "" #: forms.py:12 @@ -73,10 +73,6 @@ msgstr "" msgid "Keep Forever" msgstr "" -#: models.py:38 -msgid "One-Time snippet" -msgstr "" - #: models.py:41 msgid "Secret ID" msgstr "" @@ -93,15 +89,11 @@ msgstr "" msgid "View count" msgstr "" -#: views.py:200 -msgid "No changes were made between this two files." -msgstr "" - -#: templates/dpaste/about.html:44 +#: templates/dpaste/about.html:59 msgid "Statistics" msgstr "" -#: templates/dpaste/about.html:46 +#: templates/dpaste/about.html:61 #, python-format msgid "" "There are %(total)s snippets in the database. The most popular languages are:" @@ -138,10 +130,6 @@ msgstr "" msgid "Snippet never expires" msgstr "" -#: templates/dpaste/snippet_details.html:59 -msgid "One-time snippet" -msgstr "" - #: templates/dpaste/snippet_details.html:63 msgid "Really delete this snippet?" msgstr "" @@ -200,6 +188,10 @@ msgstr "" msgid "Paste it" msgstr "" +#: templates/dpaste/snippet_form.html:39 +msgid "or" +msgstr "" + #: templates/dpaste/snippet_list.html:16 msgid "DATETIME_FORMAT" msgstr "" @@ -214,3 +206,7 @@ msgid "" "No snippets saved. Either all your snippets are expired or your cookie has " "changed." msgstr "" + +#: views.py:200 +msgid "No changes were made between this two files." +msgstr "" diff --git a/dpaste/locale/es/LC_MESSAGES/django.mo b/dpaste/locale/es/LC_MESSAGES/django.mo index ccbacb4..ae72222 100644 Binary files a/dpaste/locale/es/LC_MESSAGES/django.mo and b/dpaste/locale/es/LC_MESSAGES/django.mo differ diff --git a/dpaste/locale/es/LC_MESSAGES/django.po b/dpaste/locale/es/LC_MESSAGES/django.po index 5590d12..8b30bde 100644 --- a/dpaste/locale/es/LC_MESSAGES/django.po +++ b/dpaste/locale/es/LC_MESSAGES/django.po @@ -1,7 +1,7 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # Leonardo J. Caballero G. , 2014 # Sergio Oliveira , 2014 @@ -9,18 +9,19 @@ msgid "" msgstr "" "Project-Id-Version: dpaste\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-25 10:08+0000\n" +"POT-Creation-Date: 2014-10-28 11:02+0000\n" "PO-Revision-Date: 2014-10-27 17:05+0000\n" "Last-Translator: Leonardo J. Caballero G. \n" -"Language-Team: Spanish (http://www.transifex.com/projects/p/dpaste/language/es/)\n" +"Language-Team: Spanish (http://www.transifex.com/projects/p/dpaste/language/" +"es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" -#: forms.py:11 -msgid "One Time Snippet" +#: forms.py:11 models.py:38 templates/dpaste/snippet_details.html:59 +msgid "One-Time snippet" msgstr "Apenas una visualización" #: forms.py:12 @@ -75,10 +76,6 @@ msgstr "Caduca por fecha y hora" msgid "Keep Forever" msgstr "Guarde por siempre" -#: models.py:38 -msgid "One-Time snippet" -msgstr "Apenas una visualización" - #: models.py:41 msgid "Secret ID" msgstr "ID secreto" @@ -95,20 +92,17 @@ msgstr "Tipo de Caducidad " msgid "View count" msgstr "Visualizaciones" -#: views.py:200 -msgid "No changes were made between this two files." -msgstr "No hay cambios entre estos dos archivos." - -#: templates/dpaste/about.html:44 +#: templates/dpaste/about.html:59 msgid "Statistics" msgstr " Estadísticas" -#: templates/dpaste/about.html:46 +#: templates/dpaste/about.html:61 #, python-format msgid "" -"There are %(total)s snippets in the database. The most popular languages " -"are:" -msgstr "Hay %(total)s fragmentos en la base de datos. Los lenguajes más populares son:" +"There are %(total)s snippets in the database. The most popular languages are:" +msgstr "" +"Hay %(total)s fragmentos en la base de datos. Los lenguajes más populares " +"son:" #: templates/dpaste/base.html:8 templates/dpaste/base.html.py:21 #: templates/dpaste/snippet_new.html:6 templates/dpaste/snippet_new.html:7 @@ -141,10 +135,6 @@ msgstr "Caduca en: %(date)s" msgid "Snippet never expires" msgstr "El fragmento nunca caduca" -#: templates/dpaste/snippet_details.html:59 -msgid "One-time snippet" -msgstr "Apenas una visualización" - #: templates/dpaste/snippet_details.html:63 msgid "Really delete this snippet?" msgstr "¿Realmente desea eliminar este fragmento?" @@ -172,7 +162,8 @@ msgstr "Este fragmento podrá ser visualizado apenas sólo una vez." #: templates/dpaste/snippet_details.html:84 #, python-format msgid "It is automatically removed after %(remaining)s further views." -msgstr "Automáticamente eliminado después de más %(remaining)s visualizaciones." +msgstr "" +"Automáticamente eliminado después de más %(remaining)s visualizaciones." #: templates/dpaste/snippet_details.html:86 msgid "It is automatically removed after the next view." @@ -190,9 +181,13 @@ msgstr "Responder fragmento" #, python-format msgid "" "\n" -" Diff between #%(filea_id)s and #%(fileb_id)s\n" +" Diff between #%(filea_id)s and #%(fileb_id)s\n" " " -msgstr "\nComparar entre #%(filea_id)s y #%(fileb_id)s" +msgstr "" +"\n" +"Comparar entre #%(filea_id)s y #%(fileb_id)s" #: templates/dpaste/snippet_form.html:32 msgid "Expire in" @@ -202,6 +197,10 @@ msgstr "Caduca en" msgid "Paste it" msgstr "Pegarlo" +#: templates/dpaste/snippet_form.html:39 +msgid "or" +msgstr "" + #: templates/dpaste/snippet_list.html:16 msgid "DATETIME_FORMAT" msgstr "DATETIME_FORMAT" @@ -215,4 +214,10 @@ msgstr "%(since)s atrás" msgid "" "No snippets saved. Either all your snippets are expired or your cookie has " "changed." -msgstr "No hay fragmentos guardados. O sus fragmentos han caducado o su cookie cambió." +msgstr "" +"No hay fragmentos guardados. O sus fragmentos han caducado o su cookie " +"cambió." + +#: views.py:200 +msgid "No changes were made between this two files." +msgstr "No hay cambios entre estos dos archivos." diff --git a/dpaste/locale/pt_BR/LC_MESSAGES/django.mo b/dpaste/locale/pt_BR/LC_MESSAGES/django.mo index 761fd64..28827d1 100644 Binary files a/dpaste/locale/pt_BR/LC_MESSAGES/django.mo and b/dpaste/locale/pt_BR/LC_MESSAGES/django.mo differ diff --git a/dpaste/locale/pt_BR/LC_MESSAGES/django.po b/dpaste/locale/pt_BR/LC_MESSAGES/django.po index 1289589..4e1cf52 100644 --- a/dpaste/locale/pt_BR/LC_MESSAGES/django.po +++ b/dpaste/locale/pt_BR/LC_MESSAGES/django.po @@ -1,25 +1,26 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. -# +# # Translators: # Sergio Oliveira , 2014 msgid "" msgstr "" "Project-Id-Version: dpaste\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-10-25 10:08+0000\n" +"POT-Creation-Date: 2014-10-28 11:03+0000\n" "PO-Revision-Date: 2014-10-25 14:25+0000\n" "Last-Translator: Sergio Oliveira \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/dpaste/language/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/projects/p/" +"dpaste/language/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" -#: forms.py:11 -msgid "One Time Snippet" +#: forms.py:11 models.py:38 templates/dpaste/snippet_details.html:59 +msgid "One-Time snippet" msgstr "Uma única visualização" #: forms.py:12 @@ -74,10 +75,6 @@ msgstr "Expira por tempo" msgid "Keep Forever" msgstr "Não expira" -#: models.py:38 -msgid "One-Time snippet" -msgstr "Uma única visualização" - #: models.py:41 msgid "Secret ID" msgstr "ID secreto" @@ -94,19 +91,14 @@ msgstr "Tipo de validade" msgid "View count" msgstr "Visualizações" -#: views.py:200 -msgid "No changes were made between this two files." -msgstr "Nenhuma alterção feita entre esses dois arquivos." - -#: templates/dpaste/about.html:44 +#: templates/dpaste/about.html:59 msgid "Statistics" msgstr "Estatísticas" -#: templates/dpaste/about.html:46 +#: templates/dpaste/about.html:61 #, python-format msgid "" -"There are %(total)s snippets in the database. The most popular languages " -"are:" +"There are %(total)s snippets in the database. The most popular languages are:" msgstr "Existem %(total)s pastes no banco de dados. A linguagem mais popular é" #: templates/dpaste/base.html:8 templates/dpaste/base.html.py:21 @@ -140,10 +132,6 @@ msgstr "Expira em: %(date)s" msgid "Snippet never expires" msgstr "Paste nunca expira" -#: templates/dpaste/snippet_details.html:59 -msgid "One-time snippet" -msgstr "Uma única visualização" - #: templates/dpaste/snippet_details.html:63 msgid "Really delete this snippet?" msgstr "Deseja realmente remover esse paste?" @@ -189,9 +177,14 @@ msgstr "Responder paste" #, python-format msgid "" "\n" -" Diff between #%(filea_id)s and #%(fileb_id)s\n" +" Diff between #%(filea_id)s and #%(fileb_id)s\n" +" " +msgstr "" +"\n" +" Diff entre #%(filea_id)s e #%(fileb_id)s\n" " " -msgstr "\n Diff entre #%(filea_id)s e #%(fileb_id)s\n " #: templates/dpaste/snippet_form.html:32 msgid "Expire in" @@ -201,6 +194,10 @@ msgstr "Expira em" msgid "Paste it" msgstr "Criar paste" +#: templates/dpaste/snippet_form.html:39 +msgid "or" +msgstr "" + #: templates/dpaste/snippet_list.html:16 msgid "DATETIME_FORMAT" msgstr "DATETIME_FORMAT" @@ -214,4 +211,10 @@ msgstr "%(since)s atrás" msgid "" "No snippets saved. Either all your snippets are expired or your cookie has " "changed." -msgstr "Nenhum paste salvo. Ou todos os seus pastes expiraram ou seu cookie foi alterado." +msgstr "" +"Nenhum paste salvo. Ou todos os seus pastes expiraram ou seu cookie foi " +"alterado." + +#: views.py:200 +msgid "No changes were made between this two files." +msgstr "Nenhuma alterção feita entre esses dois arquivos." diff --git a/dpaste/templates/dpaste/snippet_details.html b/dpaste/templates/dpaste/snippet_details.html index 2f14c22..23381d9 100644 --- a/dpaste/templates/dpaste/snippet_details.html +++ b/dpaste/templates/dpaste/snippet_details.html @@ -56,7 +56,7 @@ {% elif snippet.expire_type == 2 %} {% trans "Snippet never expires" %} {% elif snippet.expire_type == 3 %} - {% trans "One-time snippet" %} + {% trans "One-Time snippet" %} {% endif %} {% if snippet.pk|in_list:request.session.snippet_list %} diff --git a/dpaste/templates/dpaste/snippet_form.html b/dpaste/templates/dpaste/snippet_form.html index 1c2366f..fac4747 100644 --- a/dpaste/templates/dpaste/snippet_form.html +++ b/dpaste/templates/dpaste/snippet_form.html @@ -36,6 +36,6 @@
- ⌘+⏎ or Ctrl+⏎ + ⌘+⏎ {% trans "or" %} Ctrl+⏎
diff --git a/dpaste/tests/test_snippet.py b/dpaste/tests/test_snippet.py index a79c8c8..9cc724d 100644 --- a/dpaste/tests/test_snippet.py +++ b/dpaste/tests/test_snippet.py @@ -108,7 +108,7 @@ class SnippetTestCase(TestCase): def test_new_snippet_onetime(self): """ - One-time snippets get deleted after two views. + One-Time snippets get deleted after two views. """ # POST data data = self.valid_form_data()