diff options
author | Kushal Pandya <kushalspandya@gmail.com> | 2017-08-18 13:00:32 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-08-18 13:00:32 +0300 |
commit | ee42bfbe88d449619255f1cca008d86c937296f8 (patch) | |
tree | 07bf974c2b80bbec86b7d9b28b3176b511377059 /app | |
parent | 934342de7876b3f3bdde7c919a36ae0fcf735f38 (diff) |
Add support for i18n on Project Activity Page
Diffstat (limited to 'app')
-rw-r--r-- | app/helpers/events_helper.rb | 8 | ||||
-rw-r--r-- | app/views/projects/_activity.html.haml | 2 | ||||
-rw-r--r-- | app/views/projects/_last_push.html.haml | 6 | ||||
-rw-r--r-- | app/views/projects/activity.html.haml | 4 | ||||
-rw-r--r-- | app/views/shared/_event_filter.html.haml | 12 |
5 files changed, 16 insertions, 16 deletions
diff --git a/app/helpers/events_helper.rb b/app/helpers/events_helper.rb index 48c87dca217..722a65eeb98 100644 --- a/app/helpers/events_helper.rb +++ b/app/helpers/events_helper.rb @@ -35,18 +35,18 @@ module EventsHelper [event.action_name, target].join(" ") end - def event_filter_link(key, tooltip) + def event_filter_link(key, text, tooltip) key = key.to_s active = 'active' if @event_filter.active?(key) link_opts = { - class: "event-filter-link", + class: "event-filter-link has-tooltip", id: "#{key}_event_filter", - title: "Filter by #{tooltip.downcase}" + title: tooltip } content_tag :li, class: active do link_to request.path, link_opts do - content_tag(:span, ' ' + tooltip) + content_tag(:span, ' ' + text) end end end diff --git a/app/views/projects/_activity.html.haml b/app/views/projects/_activity.html.haml index ad63f5e73ae..1f701f2aa1b 100644 --- a/app/views/projects/_activity.html.haml +++ b/app/views/projects/_activity.html.haml @@ -1,7 +1,7 @@ %div{ class: container_class } .nav-block.activity-filter-block.activities .controls - = link_to project_path(@project, rss_url_options), title: "Subscribe", class: 'btn rss-btn has-tooltip' do + = link_to project_path(@project, rss_url_options), title: s_("ProjectActivityRSS|Subscribe"), class: 'btn rss-btn has-tooltip' do = icon('rss') = render 'shared/event_filter' diff --git a/app/views/projects/_last_push.html.haml b/app/views/projects/_last_push.html.haml index 1a71bfca2e2..56eecece54c 100644 --- a/app/views/projects/_last_push.html.haml +++ b/app/views/projects/_last_push.html.haml @@ -3,16 +3,16 @@ .row-content-block.top-block.hidden-xs.white .event-last-push .event-last-push-text - %span You pushed to + %span= s_("LastPushEvent|You pushed to") %strong = link_to event.ref_name, project_commits_path(event.project, event.ref_name), class: 'ref-name' - if event.project != @project - %span at + %span= s_("LastPushEvent|at") %strong= link_to_project event.project #{time_ago_with_tooltip(event.created_at)} .pull-right - = link_to new_mr_path_from_push_event(event), title: "New merge request", class: "btn btn-info btn-sm" do + = link_to new_mr_path_from_push_event(event), title: _("New merge request"), class: "btn btn-info btn-sm" do #{ _('Create merge request') } diff --git a/app/views/projects/activity.html.haml b/app/views/projects/activity.html.haml index 9e2688e492e..5452c6db6a6 100644 --- a/app/views/projects/activity.html.haml +++ b/app/views/projects/activity.html.haml @@ -1,9 +1,9 @@ - @no_container = true - if show_new_nav? - - add_to_breadcrumbs("Project", project_path(@project)) + - add_to_breadcrumbs(_("Project"), project_path(@project)) -- page_title "Activity" +- page_title _("Activity") = render "projects/head" = render 'projects/last_push' diff --git a/app/views/shared/_event_filter.html.haml b/app/views/shared/_event_filter.html.haml index e50ab5fea09..151aad306a0 100644 --- a/app/views/shared/_event_filter.html.haml +++ b/app/views/shared/_event_filter.html.haml @@ -1,11 +1,11 @@ %ul.nav-links.event-filter.scrolling-tabs - = event_filter_link EventFilter.all, 'All' + = event_filter_link EventFilter.all, _('All'), s_('EventFilterBy|Filter by all') - if event_filter_visible(:repository) - = event_filter_link EventFilter.push, 'Push events' + = event_filter_link EventFilter.push, _('Push events'), s_('EventFilterBy|Filter by push events') - if event_filter_visible(:merge_requests) - = event_filter_link EventFilter.merged, 'Merge events' + = event_filter_link EventFilter.merged, _('Merge events'), s_('EventFilterBy|Filter by merge events') - if event_filter_visible(:issues) - = event_filter_link EventFilter.issue, 'Issue events' + = event_filter_link EventFilter.issue, _('Issue events'), s_('EventFilterBy|Filter by issue events') - if comments_visible? - = event_filter_link EventFilter.comments, 'Comments' - = event_filter_link EventFilter.team, 'Team' + = event_filter_link EventFilter.comments, _('Comments'), s_('EventFilterBy|Filter by comments') + = event_filter_link EventFilter.team, _('Team'), s_('EventFilterBy|Filter by team') |