Simplify text messages, add proper pluralization

This commit is contained in:
Roberto Rosario
2015-01-18 02:41:01 -04:00
parent 686b2f69dc
commit 5b718da664
9 changed files with 21 additions and 19 deletions

View File

@@ -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))

View File

@@ -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,

View File

@@ -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

View File

@@ -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,

View File

@@ -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': [
{

View File

@@ -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,

View File

@@ -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,
}

View File

@@ -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())}

View File

@@ -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)