From a75a4edf21ba69237b16b1affe9d1dae70dc5047 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 10 Oct 2014 02:29:37 -0400 Subject: [PATCH] Issue #39, Finish capitalizing source text messages --- mayan/apps/acls/models.py | 4 ++-- mayan/apps/checkouts/literals.py | 4 ++-- mayan/apps/checkouts/models.py | 12 ++++++------ mayan/apps/checkouts/views.py | 2 +- mayan/apps/common/utils.py | 2 +- mayan/apps/converter/links.py | 8 -------- mayan/apps/converter/literals.py | 12 ++++++------ mayan/apps/django_gpg/views.py | 18 +++++++++--------- mayan/apps/document_comments/__init__.py | 6 +++--- mayan/apps/document_comments/views.py | 2 +- mayan/apps/document_indexing/utils.py | 2 +- mayan/apps/documents/__init__.py | 2 +- mayan/apps/documents/models.py | 2 +- mayan/apps/dynamic_search/views.py | 2 +- mayan/apps/metadata/forms.py | 2 +- mayan/apps/statistics/links.py | 6 +++--- mayan/apps/statistics/views.py | 6 +++--- 17 files changed, 42 insertions(+), 50 deletions(-) delete mode 100644 mayan/apps/converter/links.py diff --git a/mayan/apps/acls/models.py b/mayan/apps/acls/models.py index eaf3c8ea47..4a2e53ef58 100644 --- a/mayan/apps/acls/models.py +++ b/mayan/apps/acls/models.py @@ -23,7 +23,7 @@ class AccessEntry(models.Model): """ Model that hold the permission, object, actor relationship """ - permission = models.ForeignKey(StoredPermission, verbose_name=_(u'permission')) + permission = models.ForeignKey(StoredPermission, verbose_name=_(u'Permission')) holder_type = models.ForeignKey( ContentType, @@ -65,7 +65,7 @@ class DefaultAccessEntry(models.Model): def get_classes(cls): return [AccessObjectClass.encapsulate(cls) for cls in get_classes()] - permission = models.ForeignKey(StoredPermission, verbose_name=_(u'permission')) + permission = models.ForeignKey(StoredPermission, verbose_name=_(u'Permission')) holder_type = models.ForeignKey( ContentType, diff --git a/mayan/apps/checkouts/literals.py b/mayan/apps/checkouts/literals.py index 23e9920984..99cc214ecd 100644 --- a/mayan/apps/checkouts/literals.py +++ b/mayan/apps/checkouts/literals.py @@ -11,6 +11,6 @@ STATE_ICONS = { } STATE_LABELS = { - STATE_CHECKED_OUT: _(u'checked out'), - STATE_CHECKED_IN: _(u'checked in/available'), + STATE_CHECKED_OUT: _(u'Checked out'), + STATE_CHECKED_IN: _(u'Checked in/available'), } diff --git a/mayan/apps/checkouts/models.py b/mayan/apps/checkouts/models.py index 183ebe79df..86f629a589 100644 --- a/mayan/apps/checkouts/models.py +++ b/mayan/apps/checkouts/models.py @@ -21,14 +21,14 @@ class DocumentCheckout(models.Model): """ Model to store the state and information of a document checkout """ - document = models.ForeignKey(Document, verbose_name=_(u'document'), unique=True) - checkout_datetime = models.DateTimeField(verbose_name=_(u'check out date and time'), blank=True, null=True) - expiration_datetime = models.DateTimeField(verbose_name=_(u'check out expiration date and time'), help_text=_(u'Amount of time to hold the document checked out in minutes.')) + document = models.ForeignKey(Document, verbose_name=_(u'Document'), unique=True) + checkout_datetime = models.DateTimeField(verbose_name=_(u'Check out date and time'), blank=True, null=True) + expiration_datetime = models.DateTimeField(verbose_name=_(u'Check out expiration date and time'), help_text=_(u'Amount of time to hold the document checked out in minutes.')) user_content_type = models.ForeignKey(ContentType, null=True, blank=True) # blank and null added for ease of db migration user_object_id = models.PositiveIntegerField(null=True, blank=True) user_object = generic.GenericForeignKey(ct_field='user_content_type', fk_field='user_object_id') - block_new_version = models.BooleanField(default=True, verbose_name=_(u'block new version upload'), help_text=_(u'Do not allow new version of this document to be uploaded.')) + block_new_version = models.BooleanField(default=True, verbose_name=_(u'Block new version upload'), help_text=_(u'Do not allow new version of this document to be uploaded.')) # block_metadata # block_editing @@ -51,5 +51,5 @@ class DocumentCheckout(models.Model): return ('checkout:checkout_info', [self.document.pk]) class Meta: - verbose_name = _(u'document checkout') - verbose_name_plural = _(u'document checkouts') + verbose_name = _(u'Document checkout') + verbose_name_plural = _(u'Document checkouts') diff --git a/mayan/apps/checkouts/views.py b/mayan/apps/checkouts/views.py index f54143b418..8a7359ea4f 100644 --- a/mayan/apps/checkouts/views.py +++ b/mayan/apps/checkouts/views.py @@ -54,7 +54,7 @@ def checkout_info(request, document_pk): paragraphs.append(_(u'User: %s') % get_object_name(checkout_info.user_object, display_object_type=False)) paragraphs.append(_(u'Check out time: %s') % checkout_info.checkout_datetime) paragraphs.append(_(u'Check out expiration: %s') % checkout_info.expiration_datetime) - paragraphs.append(_(u'New versions allowed: %s') % (_(u'yes') if not checkout_info.block_new_version else _(u'no'))) + paragraphs.append(_(u'New versions allowed: %s') % (_(u'Yes') if not checkout_info.block_new_version else _(u'No'))) return render_to_response('main/generic_template.html', { 'paragraphs': paragraphs, diff --git a/mayan/apps/common/utils.py b/mayan/apps/common/utils.py index a51b248923..f306d41f4f 100644 --- a/mayan/apps/common/utils.py +++ b/mayan/apps/common/utils.py @@ -113,7 +113,7 @@ def pretty_size_10(size): def return_type(value): if isinstance(value, types.FunctionType): - return value.__doc__ if value.__doc__ else _(u'function found') + return value.__doc__ if value.__doc__ else _(u'Function found') elif isinstance(value, types.ClassType): return u'%s.%s' % (value.__class__.__module__, value.__class__.__name__) elif isinstance(value, types.TypeType): diff --git a/mayan/apps/converter/links.py b/mayan/apps/converter/links.py deleted file mode 100644 index 0fbd763dad..0000000000 --- a/mayan/apps/converter/links.py +++ /dev/null @@ -1,8 +0,0 @@ -from django.utils.translation import ugettext_lazy as _ - - -def is_superuser(context): - return context['request'].user.is_staff or context['request'].user.is_superuser - - -formats_list = {'text': _('file formats'), 'view': 'converter:formats_list', 'famfam': 'pictures', 'icon': 'pictures.png', 'condition': is_superuser, 'children_view_regex': [r'formats_list']} diff --git a/mayan/apps/converter/literals.py b/mayan/apps/converter/literals.py index f4230b3b0e..3686402fa5 100644 --- a/mayan/apps/converter/literals.py +++ b/mayan/apps/converter/literals.py @@ -19,30 +19,30 @@ TRANSFORMATION_CHOICES = { 'label': _(u'Resize'), 'description': _(u'Resize.'), 'arguments': [ - {'name': 'width', 'label': _(u'width'), 'required': True}, - {'name': 'height', 'label': _(u'height'), 'required': False}, + {'name': 'width', 'label': _(u'Width'), 'required': True}, + {'name': 'height', 'label': _(u'Height'), 'required': False}, ] }, TRANSFORMATION_ROTATE: { 'label': _(u'Rotate'), 'description': _(u'Rotate by n degress.'), 'arguments': [ - {'name': 'degrees', 'label': _(u'degrees'), 'required': True} + {'name': 'degrees', 'label': _(u'Degrees'), 'required': True} ] }, TRANSFORMATION_DENSITY: { 'label': _(u'Density'), 'description': _(u'Change the resolution (ie: DPI) without resizing.'), 'arguments': [ - {'name': 'width', 'label': _(u'width'), 'required': True}, - {'name': 'height', 'label': _(u'height'), 'required': False}, + {'name': 'width', 'label': _(u'Width'), 'required': True}, + {'name': 'height', 'label': _(u'Height'), 'required': False}, ] }, TRANSFORMATION_ZOOM: { 'label': _(u'Zoom'), 'description': _(u'Zoom by n percent.'), 'arguments': [ - {'name': 'percent', 'label': _(u'percent'), 'required': True} + {'name': 'percent', 'label': _(u'Percent'), 'required': True} ] }, } diff --git a/mayan/apps/django_gpg/views.py b/mayan/apps/django_gpg/views.py index b4323054d5..9bd11ae53a 100644 --- a/mayan/apps/django_gpg/views.py +++ b/mayan/apps/django_gpg/views.py @@ -64,10 +64,10 @@ def key_list(request, secret=True): if secret: object_list = Key.get_all(gpg, secret=True) - title = _(u'private keys') + title = _(u'Private keys') else: object_list = Key.get_all(gpg) - title = _(u'public keys') + title = _(u'Public keys') return render_to_response('main/generic_list.html', { 'object_list': object_list, @@ -148,31 +148,31 @@ def key_query(request): 'attribute': 'keyid', }, { - 'name': _(u'type'), + 'name': _(u'Type'), 'attribute': 'algo', }, { - 'name': _(u'creation date'), + 'name': _(u'Creation date'), 'attribute': 'creation_date', }, { - 'name': _(u'disabled'), + 'name': _(u'Disabled'), 'attribute': 'disabled', }, { - 'name': _(u'expiration date'), + 'name': _(u'Expiration date'), 'attribute': 'expiration_date', }, { - 'name': _(u'expired'), + 'name': _(u'Expired'), 'attribute': 'expired', }, { - 'name': _(u'length'), + 'name': _(u'Length'), 'attribute': 'key_length', }, { - 'name': _(u'revoked'), + 'name': _(u'Revoked'), 'attribute': 'revoked', }, diff --git a/mayan/apps/document_comments/__init__.py b/mayan/apps/document_comments/__init__.py index 8c17f4b209..baa2a79d4f 100644 --- a/mayan/apps/document_comments/__init__.py +++ b/mayan/apps/document_comments/__init__.py @@ -29,15 +29,15 @@ class_permissions(Document, [PERMISSION_COMMENT_CREATE, register_model_list_columns(Comment, [ { - 'name': _(u'date'), + 'name': _(u'Date'), 'attribute': 'submit_date' }, { - 'name': _(u'user'), + 'name': _(u'User'), 'attribute': encapsulate(lambda x: x.user.get_full_name() if x.user.get_full_name() else x.user) }, { - 'name': _(u'comment'), + 'name': _(u'Comment'), 'attribute': 'comment' } ]) diff --git a/mayan/apps/document_comments/views.py b/mayan/apps/document_comments/views.py index cae74150de..5f3dbff4dc 100644 --- a/mayan/apps/document_comments/views.py +++ b/mayan/apps/document_comments/views.py @@ -123,7 +123,7 @@ def comments_for_document(request, document_id): return render_to_response('main/generic_list.html', { 'object': document, 'access_object': document, - 'title': _(u'comments: %s') % document, + 'title': _(u'Comments for document: %s') % document, 'object_list': Comment.objects.for_model(document).order_by('-submit_date'), 'hide_link': True, 'hide_object': True, diff --git a/mayan/apps/document_indexing/utils.py b/mayan/apps/document_indexing/utils.py index 465cca6763..932f8b2a48 100644 --- a/mayan/apps/document_indexing/utils.py +++ b/mayan/apps/document_indexing/utils.py @@ -18,7 +18,7 @@ def get_document_indexing_subtemplate(document): return { 'name': 'main/generic_list_subtemplate.html', 'context': { - 'title': _(u'document indexes'), + 'title': _(u'Document indexes'), 'object_list': object_list, 'hide_link': True } diff --git a/mayan/apps/documents/__init__.py b/mayan/apps/documents/__init__.py index 7ca6e8e57b..4b80a6f094 100644 --- a/mayan/apps/documents/__init__.py +++ b/mayan/apps/documents/__init__.py @@ -102,7 +102,7 @@ register_links('documents:document_page_transformation_create', [document_page_t register_links(['documents:document_page_transformation_edit', 'documents:document_page_transformation_delete'], [document_page_transformation_create], menu_name='sidebar') register_diagnostic('documents', _(u'Documents'), document_missing_list) -register_maintenance_links([document_find_all_duplicates, document_update_page_count, document_clear_image_cache], namespace='documents', title=_(u'documents')) +register_maintenance_links([document_find_all_duplicates, document_update_page_count, document_clear_image_cache], namespace='documents', title=_(u'Documents')) register_model_list_columns(Document, [ { 'name': _(u'Thumbnail'), 'attribute': diff --git a/mayan/apps/documents/models.py b/mayan/apps/documents/models.py index df55b89efa..9a673902d6 100644 --- a/mayan/apps/documents/models.py +++ b/mayan/apps/documents/models.py @@ -327,7 +327,7 @@ class DocumentVersion(models.Model): major = models.PositiveIntegerField(verbose_name=_(u'Mayor'), default=1) minor = models.PositiveIntegerField(verbose_name=_(u'Minor'), default=0) micro = models.PositiveIntegerField(verbose_name=_(u'Micro'), default=0) - release_level = models.PositiveIntegerField(choices=RELEASE_LEVEL_CHOICES, default=RELEASE_LEVEL_FINAL, verbose_name=_(u'release level')) + release_level = models.PositiveIntegerField(choices=RELEASE_LEVEL_CHOICES, default=RELEASE_LEVEL_FINAL, verbose_name=_(u'Release level')) serial = models.PositiveIntegerField(verbose_name=_(u'Serial'), default=0) timestamp = models.DateTimeField(verbose_name=_(u'Timestamp'), editable=False, db_index=True) comment = models.TextField(blank=True, verbose_name=_(u'Comment')) diff --git a/mayan/apps/dynamic_search/views.py b/mayan/apps/dynamic_search/views.py index 30efc625b5..62d1ef8987 100644 --- a/mayan/apps/dynamic_search/views.py +++ b/mayan/apps/dynamic_search/views.py @@ -46,7 +46,7 @@ def results(request, extra_context=None): 'result_count': result_count} else: - title = _(u'results') + title = _(u'Results') # Update the context with the search results context.update({ diff --git a/mayan/apps/metadata/forms.py b/mayan/apps/metadata/forms.py index d647158fa5..fa5714ae21 100644 --- a/mayan/apps/metadata/forms.py +++ b/mayan/apps/metadata/forms.py @@ -63,7 +63,7 @@ class MetadataForm(forms.Form): except Exception as exception: self.fields['value'].initial = exception - id = forms.CharField(label=_(u'id'), widget=forms.HiddenInput) + id = forms.CharField(label=_(u'ID'), widget=forms.HiddenInput) name = forms.CharField(label=_(u'Name'), required=False, widget=forms.TextInput(attrs={'readonly': 'readonly'})) value = forms.CharField(label=_(u'Value'), required=False) diff --git a/mayan/apps/statistics/links.py b/mayan/apps/statistics/links.py index 7781c70bc5..8870d426f7 100644 --- a/mayan/apps/statistics/links.py +++ b/mayan/apps/statistics/links.py @@ -7,7 +7,7 @@ def is_superuser(context): return context['request'].user.is_staff or context['request'].user.is_superuser -link_execute = {'text': _(u'execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser} -link_namespace_details = {'text': _(u'details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser} -link_namespace_list = {'text': _(u'namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser, 'children_view_regex': [r'statistics']} +link_execute = {'text': _(u'Execute'), 'view': 'statistics:execute', 'args': 'object.id', 'famfam': 'lightning', 'condition': is_superuser} +link_namespace_details = {'text': _(u'Details'), 'view': 'statistics:namespace_details', 'args': 'namespace.id', 'famfam': 'chart_curve_go', 'condition': is_superuser} +link_namespace_list = {'text': _(u'Namespace list'), 'view': 'statistics:namespace_list', 'famfam': 'chart_curve', 'condition': is_superuser, 'children_view_regex': [r'statistics']} link_statistics = {'text': _(u'Statistics'), 'view': 'statistics:namespace_list', 'famfam': 'table', 'icon': 'blackboard_sum.png', 'condition': is_superuser, 'children_view_regex': [r'statistics']} diff --git a/mayan/apps/statistics/views.py b/mayan/apps/statistics/views.py index d9ad287479..32ca2eb61e 100644 --- a/mayan/apps/statistics/views.py +++ b/mayan/apps/statistics/views.py @@ -32,7 +32,7 @@ def namespace_details(request, namespace_id): 'object_list': namespace.statistics, 'hide_link': True, 'title': _(u'Namespace details for: %s') % namespace, - 'object_name': _(u'namespace'), + 'object_name': _(u'Namespace'), }, context_instance=RequestContext(request)) @@ -46,8 +46,8 @@ def execute(request, statistic_id): 'object': statictic, 'namespace': statictic.namespace, 'navigation_object_list': [ - {'object': 'namespace', 'name': _(u'namespace')}, - {'object': 'object', 'name': _(u'statistic')}, + {'object': 'namespace', 'name': _(u'Namespace')}, + {'object': 'object', 'name': _(u'Statistic')}, ], 'object_list': statictic.get_results(), 'hide_link': True,