Skip to content

Commit

Permalink
Make all reasons for no preview translatable
Browse files Browse the repository at this point in the history
  • Loading branch information
domoritz authored and tobes committed Mar 6, 2013
1 parent 197ca9e commit 2398f3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions ckan/lib/helpers.py
Expand Up @@ -1393,7 +1393,7 @@ def resource_preview(resource, pkg_id):
if not resource['url']:
return snippet("dataviewer/snippets/no_preview.html",
resource_type=format_lower,
reason=u'The resource url is not specified.')
reason=_(u'The resource url is not specified.'))
direct_embed = config.get('ckan.preview.direct', '').split()
if not direct_embed:
direct_embed = datapreview.DEFAULT_DIRECT_EMBED
Expand All @@ -1413,10 +1413,10 @@ def resource_preview(resource, pkg_id):
reason = None
if format_lower:
log.info(
u'No preview handler for resource type {0}'.format(format_lower)
_(u'No preview handler for resource of type {0}'.format(format_lower))
)
else:
reason = u'The resource format is not specified.'
reason = _(u'The resource format is not specified.')
return snippet("dataviewer/snippets/no_preview.html",
reason=reason,
resource_type=format_lower)
Expand Down
2 changes: 1 addition & 1 deletion ckan/templates/dataviewer/snippets/no_preview.html
Expand Up @@ -6,7 +6,7 @@
</button>
<div id="details" class="collapse">
{% if reason %}
{{_(reason)}}
{{ reason }}
{% else %}
{% set t = '<code>'|safe + resource_type + '</code>'|safe %}
{{ gettext('No handler defined for data type: %(type)s.', type=t) }}
Expand Down

0 comments on commit 2398f3e

Please sign in to comment.