Skip to content

Commit

Permalink
add gettext
Browse files Browse the repository at this point in the history
  • Loading branch information
fiorda committed Aug 27, 2017
1 parent 4a6a8e3 commit de1c656
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions pybossa/view/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ def users(user_id=None):
[ensure_authorized_to('update', found_user) for found_user in found]
if not found:
markup = Markup('<strong>{}</strong> {} <strong>{}</strong>')
flash(markup.format("Ooops!",
"We didn't find a user matching your query:",
flash(markup.format(gettext("Ooops!"),
gettext("We didn't find a user matching your query:"),
form.user.data))
response = dict(template='/admin/users.html', found=found, users=users,
title=gettext("Manage Admin Users"),
Expand Down Expand Up @@ -478,8 +478,9 @@ def delete_announcement(id):

ensure_authorized_to('delete', announcement)
announcement_repo.delete(announcement)
msg_1 = gettext('Announcement deleted!')
markup = '<i class="icon-ok"></i> {}'
flash(markup.format('Announcement deleted!'), 'success')
flash(markup.format(msg_1), 'success')
return redirect_content_type(url_for('admin.announcement'))


Expand Down
5 changes: 3 additions & 2 deletions pybossa/view/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -784,11 +784,12 @@ def task_presenter(short_name, task_id):
"Ooops! You are an anonymous user and will not "
"get any credit"
" for your contributions.")
msg_2 = gettext('Sign in now!')
next_url = url_for('project.task_presenter',
short_name=short_name, task_id=task_id)
url = url_for('account.signin', next=next_url)
markup = Markup('<a href="{}">Sign in now!</a>'.format(url))
flash(msg_1 + markup, "warning")
markup = Markup('{{}} <a href="{}">{{}}</a>'.format(url))
flash(markup.format(msg_1, msg_2), "warning")

title = project_title(project, "Contribute")
project_sanitized, owner_sanitized = sanitize_project_owner(project, owner,
Expand Down

0 comments on commit de1c656

Please sign in to comment.