From 5b718da6648da66dadfb94f6411ec03cb404f3e4 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Sun, 18 Jan 2015 02:41:01 -0400 Subject: [PATCH] Simplify text messages, add proper pluralization --- mayan/apps/checkouts/views.py | 4 ++-- mayan/apps/document_comments/views.py | 4 ++-- mayan/apps/document_indexing/views.py | 2 +- mayan/apps/document_signatures/views.py | 4 ++-- mayan/apps/document_states/views.py | 6 +++--- mayan/apps/documents/views.py | 4 ++-- mayan/apps/folders/views.py | 2 +- mayan/apps/linking/views.py | 2 +- mayan/apps/tags/views.py | 12 +++++++----- 9 files changed, 21 insertions(+), 19 deletions(-) diff --git a/mayan/apps/checkouts/views.py b/mayan/apps/checkouts/views.py index ed24df7ff2..a7879e32d2 100644 --- a/mayan/apps/checkouts/views.py +++ b/mayan/apps/checkouts/views.py @@ -59,7 +59,7 @@ def checkout_info(request, document_pk): return render_to_response('main/generic_template.html', { 'paragraphs': paragraphs, 'object': document, - 'title': _(u'Check out details for document: %s') % document + 'title': _(u'Document check out details') }, context_instance=RequestContext(request)) @@ -92,7 +92,7 @@ def checkout_document(request, document_pk): return render_to_response('main/generic_form.html', { 'form': form, 'object': document, - 'title': _(u'Check out document: %s') % document + 'title': _(u'Document check out') }, context_instance=RequestContext(request)) diff --git a/mayan/apps/document_comments/views.py b/mayan/apps/document_comments/views.py index 13f413d9f9..644b2c651f 100644 --- a/mayan/apps/document_comments/views.py +++ b/mayan/apps/document_comments/views.py @@ -102,7 +102,7 @@ def comment_add(request, document_id): return render_to_response('main/generic_form.html', { 'form': form, - 'title': _(u'Add comment to document: %s') % document, + 'title': _(u'Add comment to document'), 'next': next, 'object': document, }, context_instance=RequestContext(request)) @@ -122,7 +122,7 @@ def comments_for_document(request, document_id): return render_to_response('main/generic_list.html', { 'object': document, 'access_object': document, - 'title': _(u'Comments for document: %s') % document, + 'title': _(u'Document comments'), 'object_list': Comment.objects.for_model(document).order_by('-submit_date'), 'hide_link': True, 'hide_object': True, diff --git a/mayan/apps/document_indexing/views.py b/mayan/apps/document_indexing/views.py index c7d0e725aa..6f7d35966e 100644 --- a/mayan/apps/document_indexing/views.py +++ b/mayan/apps/document_indexing/views.py @@ -402,7 +402,7 @@ def document_index_list(request, document_id): object_list.append(get_breadcrumbs(index_instance, single_link=True, include_count=True)) return render_to_response('main/generic_list.html', { - 'title': _(u'Indexes containing: %s') % document, + 'title': _(u'Indexes containing this document'), 'object_list': object_list, 'hide_link': True, 'object': document diff --git a/mayan/apps/document_signatures/views.py b/mayan/apps/document_signatures/views.py index 02cb9b8a96..e08880e080 100644 --- a/mayan/apps/document_signatures/views.py +++ b/mayan/apps/document_signatures/views.py @@ -68,7 +68,7 @@ def document_verify(request, document_pk): ) return render_to_response('main/generic_template.html', { - 'title': _(u'Signature properties for: %s') % document, + 'title': _(u'Document signature properties'), 'object': document, 'document': document, 'paragraphs': paragraphs, @@ -103,7 +103,7 @@ def document_signature_upload(request, document_pk): form = DetachedSignatureForm() return render_to_response('main/generic_form.html', { - 'title': _(u'Upload detached signature for: %s') % document, + 'title': _(u'Upload detached signature'), 'next': next, 'form': form, 'previous': previous, diff --git a/mayan/apps/document_states/views.py b/mayan/apps/document_states/views.py index 9732d3480e..595922936b 100644 --- a/mayan/apps/document_states/views.py +++ b/mayan/apps/document_states/views.py @@ -55,7 +55,7 @@ class DocumentWorkflowInstanceListView(SingleObjectListView): { 'hide_link': True, 'object': self.get_document(), - 'title': _('Workflows of document: %s') % self.get_document(), + 'title': _('Document workflows'), 'list_object_variable_name': 'workflow_instance', } ) @@ -94,8 +94,8 @@ class WorkflowInstanceDetailView(SingleObjectListView): {'object': 'object'}, {'object': 'workflow_instance'} ], - 'title': _('Detail of workflow: %(workflow)s - %(document)s') % { - 'workflow': self.get_workflow_instance(), 'document': self.get_workflow_instance().document + 'title': _('Detail of workflow: %(workflow)s') % { + 'workflow': self.get_workflow_instance() }, 'subtemplates_list': [ { diff --git a/mayan/apps/documents/views.py b/mayan/apps/documents/views.py index de2d1e2f30..3d7c982b5b 100644 --- a/mayan/apps/documents/views.py +++ b/mayan/apps/documents/views.py @@ -252,7 +252,7 @@ def document_edit(request, document_id): return render_to_response('main/generic_form.html', { 'form': form, 'object': document, - 'title': _('Edit properties of: %s') % document, + 'title': _('Edit document properties'), }, context_instance=RequestContext(request)) @@ -1106,7 +1106,7 @@ def document_version_list(request, document_pk): context = { 'object_list': document.versions.order_by('-timestamp'), - 'title': _(u'Versions for document: %s') % document, + 'title': _(u'Document versions'), 'hide_object': True, 'object': document, 'access_object': document, diff --git a/mayan/apps/folders/views.py b/mayan/apps/folders/views.py index 29ed6f8b6f..7110d6263f 100644 --- a/mayan/apps/folders/views.py +++ b/mayan/apps/folders/views.py @@ -207,7 +207,7 @@ def document_folder_list(request, document_id): AccessEntry.objects.check_access(PERMISSION_DOCUMENT_VIEW, request.user, document) context = { - 'title': _(u'Folders containing: %s') % document, + 'title': _(u'Folders containing this document'), 'object': document, 'hide_link': True, } diff --git a/mayan/apps/linking/views.py b/mayan/apps/linking/views.py index 56d53da9ce..be15ebbf41 100644 --- a/mayan/apps/linking/views.py +++ b/mayan/apps/linking/views.py @@ -79,7 +79,7 @@ def smart_link_instances_for_document(request, document_id): 'document': document, 'object': document, 'object_list': smart_links, - 'title': _(u'Smart links for: %s') % document, + 'title': _(u'Document smart links'), 'extra_columns': [ {'name': _('Indentifier'), 'attribute': encapsulate(lambda resolved_smart_link: resolved_smart_link.smart_link.get_dynamic_title(document))}, {'name': _('Documents'), 'attribute': encapsulate(lambda resolved_smart_link: resolved_smart_link.queryset.count())} diff --git a/mayan/apps/tags/views.py b/mayan/apps/tags/views.py index a1aac3a1c3..ee43a4567d 100644 --- a/mayan/apps/tags/views.py +++ b/mayan/apps/tags/views.py @@ -9,7 +9,7 @@ from django.conf import settings from django.http import HttpResponseRedirect from django.shortcuts import get_object_or_404, render_to_response from django.template import RequestContext -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import ugettext_lazy as _, ungettext from acls.models import AccessEntry from acls.views import acl_list_for @@ -91,13 +91,15 @@ def tag_attach(request, document_id=None, document_id_list=None): 'form': form, 'previous': previous, 'next': next, + 'title': ungettext( + u'Attach tag to document', + u'Attach tag to documents', + len(documents) + ) } if len(documents) == 1: context['object'] = documents[0] - context['title'] = _(u'Attach tag to document: %s.') % ', '.join([unicode(d) for d in documents]) - elif len(documents) > 1: - context['title'] = _(u'Attach tag to documents: %s.') % ', '.join([unicode(d) for d in documents]) return render_to_response('main/generic_form.html', context, context_instance=RequestContext(request)) @@ -236,7 +238,7 @@ def document_tags(request, document_id): context = { 'object': document, 'document': document, - 'title': _(u'Tags for: %s') % document, + 'title': _(u'Document tags'), } return tag_list(request, queryset=document.tags.all(), extra_context=context)