Skip to content

Commit

Permalink
[i18n]: Tidy up strings.
Browse files Browse the repository at this point in the history
  • Loading branch information
David Read committed Feb 9, 2012
1 parent bd5d025 commit 6d9a164
Show file tree
Hide file tree
Showing 24 changed files with 683 additions and 540 deletions.
4 changes: 2 additions & 2 deletions .tx/config
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[main]
host = http://www.transifex.net

[ckan.1-5]
[ckan.1-6]
file_filter = ckan/i18n/<lang>/LC_MESSAGES/ckan.po
source_file = ckan/i18n/ckan.pot
source_lang = en
Expand All @@ -10,4 +10,4 @@ source_lang = en
# Transifex vs Babel (& CKAN)
# 'sr@Latin' vs 'sr_Latn'
trans.sr@Latin = ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
trans.sr@latin = ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
trans.sr@latin = ckan/i18n/sr_Latn/LC_MESSAGES/ckan.po
4 changes: 2 additions & 2 deletions ckan/controllers/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ def _save_new(self, context, group_type=None):
except NotAuthorized:
abort(401, _('Unauthorized to read group %s') % '')
except NotFound, e:
abort(404, _('Package not found'))
abort(404, _('Group not found'))
except DataError:
abort(400, _(u'Integrity Error'))
except ValidationError, e:
Expand All @@ -442,7 +442,7 @@ def _save_edit(self, id, context):
except NotAuthorized:
abort(401, _('Unauthorized to read group %s') % id)
except NotFound, e:
abort(404, _('Package not found'))
abort(404, _('Group not found'))
except DataError:
abort(400, _(u'Integrity Error'))
except ValidationError, e:
Expand Down
14 changes: 8 additions & 6 deletions ckan/controllers/home.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,16 @@ def index(self):
c.userobj.name.startswith('https://www.google.com/accounts/o8/id')
if not c.userobj.email and (is_google_id and not c.userobj.fullname):
msg = _('Please <a href="%s">update your profile</a>'
' and add your email address and your full name. %s uses'
' your email address if you need to reset your'
' password.''') % (url, g.site_title)
' and add your email address and your full name. ') + \
_('%s uses your email address'
' if you need to reset your password.') \
% (url, g.site_title)
elif not c.userobj.email:
msg = _('Please <a href="%s">update your profile</a>'
' and add your email address. %s uses your email address'
' if you need to reset your password.') \
% (url, g.site_title)
' and add your email address. ') + \
_('%s uses your email address'
' if you need to reset your password.') \
% (url, g.site_title)
elif is_google_id and not c.userobj.fullname:
msg = _('Please <a href="%s">update your profile</a>'
' and add your full name.') % (url)
Expand Down
26 changes: 13 additions & 13 deletions ckan/controllers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ def pager_url(q=None, page=None):
c.facets = query['facets']
c.page.items = query['results']
except SearchError, se:
log.error('Package search error: %r', se.args)
log.error('Dataset search error: %r', se.args)
c.query_error = True
c.facets = {}
c.page = h.Page(collection=[])
Expand Down Expand Up @@ -315,7 +315,7 @@ def read(self, id):
c.pkg = context['package']
c.pkg_json = json.dumps(c.pkg_dict)
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)

Expand Down Expand Up @@ -355,7 +355,7 @@ def comments(self, id):
c.pkg_dict = get_action('package_show')(context, {'id':id})
c.pkg = context['package']
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)

Expand Down Expand Up @@ -396,16 +396,16 @@ def history(self, id):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))

format = request.params.get('format', '')
if format == 'atom':
# Generate and return Atom 1.0 document.
from webhelpers.feedgenerator import Atom1Feed
feed = Atom1Feed(
title=_(u'CKAN Package Revision History'),
title=_(u'CKAN Dataset Revision History'),
link=h.url_for(controller='revision', action='read', id=c.pkg_dict['name']),
description=_(u'Recent changes to CKAN Package: ') + (c.pkg_dict['title'] or ''),
description=_(u'Recent changes to CKAN Dataset: ') + (c.pkg_dict['title'] or ''),
language=unicode(get_lang()),
)
for revision_dict in c.pkg_revisions:
Expand Down Expand Up @@ -495,7 +495,7 @@ def edit(self, id, data=None, errors=None, error_summary=None):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))

c.pkg = context.get("package")
c.pkg_json = json.dumps(data)
Expand Down Expand Up @@ -534,7 +534,7 @@ def read_ajax(self, id, revision=None):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))

## hack as db_to_form schema should have this
data['tag_string'] = ', '.join([tag['name'] for tag in data.get('tags', [])])
Expand All @@ -554,7 +554,7 @@ def history_ajax(self, id):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))


data = []
Expand Down Expand Up @@ -594,7 +594,7 @@ def _get_package_type(self, id):
try:
data = get_action('package_show')(context, {'id': id})
except NotFound:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)

Expand All @@ -614,7 +614,7 @@ def _save_new(self, context, package_type=None):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % '')
except NotFound, e:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))
except DataError:
abort(400, _(u'Integrity Error'))
except SearchIndexError, e:
Expand Down Expand Up @@ -645,7 +645,7 @@ def _save_edit(self, id, context):
except NotAuthorized:
abort(401, _('Unauthorized to read package %s') % id)
except NotFound, e:
abort(404, _('Package not found'))
abort(404, _('Dataset not found'))
except DataError:
abort(400, _(u'Integrity Error'))
except SearchIndexError, e:
Expand Down Expand Up @@ -691,7 +691,7 @@ def _adjust_license_id_options(self, pkg, fs):
def authz(self, id):
pkg = model.Package.get(id)
if pkg is None:
abort(404, gettext('Package not found'))
abort(404, gettext('Dataset not found'))
c.pkg = pkg # needed to add in the tab bar to the top of the auth page
c.pkgname = pkg.name
c.pkgtitle = pkg.title
Expand Down
2 changes: 1 addition & 1 deletion ckan/controllers/revision.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def list(self):
if revision.message:
item_title += ': %s' % (revision.message or '')
item_link = h.url_for(action='read', id=revision.id)
item_description = _('Packages affected: %s.\n') % pkgs
item_description = _('Datasets affected: %s.\n') % pkgs
item_description += '%s' % (revision.message or '')
item_author_name = revision.author
item_pubdate = revision.timestamp
Expand Down

0 comments on commit 6d9a164

Please sign in to comment.