From dad38b27e8d5339e63e77bc09c912cfe13ab14e7 Mon Sep 17 00:00:00 2001 From: Winnie Hellmann Date: Thu, 2 Nov 2017 08:41:11 +0000 Subject: Make contributors page translatable --- app/assets/javascripts/graphs/stat_graph_contributors.js | 3 ++- app/views/projects/graphs/show.html.haml | 14 +++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) (limited to 'app') diff --git a/app/assets/javascripts/graphs/stat_graph_contributors.js b/app/assets/javascripts/graphs/stat_graph_contributors.js index cdc4fcf6573..e7232ca3712 100644 --- a/app/assets/javascripts/graphs/stat_graph_contributors.js +++ b/app/assets/javascripts/graphs/stat_graph_contributors.js @@ -4,6 +4,7 @@ import _ from 'underscore'; import d3 from 'd3'; import { ContributorsGraph, ContributorsAuthorGraph, ContributorsMasterGraph } from './stat_graph_contributors_graph'; import ContributorsStatGraphUtil from './stat_graph_contributors_util'; +import { n__ } from '../locale'; export default (function() { function ContributorsStatGraph() {} @@ -44,7 +45,7 @@ export default (function() { commits = $('', { "class": 'graph-author-commits-count' }); - commits.text(author.commits + " commits"); + commits.text(n__('%d commit', '%d commits', author.commits)); return $('').append(commits); }; diff --git a/app/views/projects/graphs/show.html.haml b/app/views/projects/graphs/show.html.haml index 70156c03e3c..cce16bc58b3 100644 --- a/app/views/projects/graphs/show.html.haml +++ b/app/views/projects/graphs/show.html.haml @@ -1,5 +1,5 @@ - @no_container = true -- page_title "Contributors" +- page_title _('Contributors') - content_for :page_specific_javascripts do = webpack_bundle_tag('common_d3') = webpack_bundle_tag('graphs') @@ -7,23 +7,23 @@ .js-graphs-show{ class: container_class, 'data-project-graph-path': project_graph_path(@project, current_ref, format: :json) } .sub-header-block - .tree-ref-holder + .tree-ref-holder.inline.vertical-align-middle = render 'shared/ref_switcher', destination: 'graphs' - %ul.breadcrumb.repo-breadcrumb - = commits_breadcrumbs + = link_to s_('Commits|History'), project_commits_path(@project, current_ref), class: 'btn' .loading-graph .center %h3.page-title %i.fa.fa-spinner.fa-spin - Building repository graph. - %p.slead Please wait a moment, this page will automatically refresh when ready. + = s_('ContributorsPage|Building repository graph.') + %p.slead + = s_('ContributorsPage|Please wait a moment, this page will automatically refresh when ready.') .stat-graph.hide .header.clearfix %h3#date_header.page-title %p.light - Commits to #{@ref}, excluding merge commits. Limited to 6,000 commits. + = s_('ContributorsPage|Commits to %{branch_name}, excluding merge commits. Limited to 6,000 commits.') % { branch_name: @ref } %input#brush_change{ :type => "hidden" } .graphs.row #contributors-master -- cgit v1.2.1