Commit dbd1bdae authored by Ruben Davila's avatar Ruben Davila

More updates for translations plus some refactoring.

parent b7f01f2b
...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageCodeComponent = Vue.extend({ ...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageCodeComponent = Vue.extend({
<a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a> <a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a>
&middot; &middot;
<span> <span>
{{ __('Opened') }} {{ __('OpenedNDaysAgo|Opened') }}
<a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a> <a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a>
</span> </span>
<span> <span>
{{ __('Author|by') }} {{ __('ByAuthor|by') }}
<a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a> <a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a>
</span> </span>
</div> </div>
......
...@@ -32,7 +32,7 @@ global.cycleAnalytics.StageIssueComponent = Vue.extend({ ...@@ -32,7 +32,7 @@ global.cycleAnalytics.StageIssueComponent = Vue.extend({
<a :href="issue.url" class="issue-date">{{ issue.createdAt }}</a> <a :href="issue.url" class="issue-date">{{ issue.createdAt }}</a>
</span> </span>
<span> <span>
{{ __('Author|by') }} {{ __('ByAuthor|by') }}
<a :href="issue.author.webUrl" class="issue-author-link"> <a :href="issue.author.webUrl" class="issue-author-link">
{{ issue.author.name }} {{ issue.author.name }}
</a> </a>
......
...@@ -31,10 +31,10 @@ global.cycleAnalytics.StagePlanComponent = Vue.extend({ ...@@ -31,10 +31,10 @@ global.cycleAnalytics.StagePlanComponent = Vue.extend({
</a> </a>
</h5> </h5>
<span> <span>
{{ __('OfFirstTime|First') }} {{ __('FirstPushedBy|First') }}
<span class="commit-icon">${iconCommit}</span> <span class="commit-icon">${iconCommit}</span>
<a :href="commit.commitUrl" class="commit-hash-link monospace">{{ commit.shortSha }}</a> <a :href="commit.commitUrl" class="commit-hash-link monospace">{{ commit.shortSha }}</a>
{{ __('pushed by') }} {{ __('FirstPushedBy|pushed by') }}
<a :href="commit.author.webUrl" class="commit-author-link"> <a :href="commit.author.webUrl" class="commit-author-link">
{{ commit.author.name }} {{ commit.author.name }}
</a> </a>
......
...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageProductionComponent = Vue.extend({ ...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageProductionComponent = Vue.extend({
<a :href="issue.url" class="issue-link">#{{ issue.iid }}</a> <a :href="issue.url" class="issue-link">#{{ issue.iid }}</a>
&middot; &middot;
<span> <span>
{{ __('Opened') }} {{ __('OpenedNDaysAgo|Opened') }}
<a :href="issue.url" class="issue-date">{{ issue.createdAt }}</a> <a :href="issue.url" class="issue-date">{{ issue.createdAt }}</a>
</span> </span>
<span> <span>
{{ __('Author|by') }} {{ __('ByAuthor|by') }}
<a :href="issue.author.webUrl" class="issue-author-link"> <a :href="issue.author.webUrl" class="issue-author-link">
{{ issue.author.name }} {{ issue.author.name }}
</a> </a>
......
...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageReviewComponent = Vue.extend({ ...@@ -28,11 +28,11 @@ global.cycleAnalytics.StageReviewComponent = Vue.extend({
<a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a> <a :href="mergeRequest.url" class="issue-link">!{{ mergeRequest.iid }}</a>
&middot; &middot;
<span> <span>
{{ __('Opened') }} {{ __('OpenedNDaysAgo|Opened') }}
<a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a> <a :href="mergeRequest.url" class="issue-date">{{ mergeRequest.createdAt }}</a>
</span> </span>
<span> <span>
{{ __('Author|by') }} {{ __('ByAuthor|by') }}
<a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a> <a :href="mergeRequest.author.webUrl" class="issue-author-link">{{ mergeRequest.author.name }}</a>
</span> </span>
<template v-if="mergeRequest.state === 'closed'"> <template v-if="mergeRequest.state === 'closed'">
......
...@@ -32,7 +32,7 @@ global.cycleAnalytics.StageStagingComponent = Vue.extend({ ...@@ -32,7 +32,7 @@ global.cycleAnalytics.StageStagingComponent = Vue.extend({
</h5> </h5>
<span> <span>
<a :href="build.url" class="build-date">{{ build.date }}</a> <a :href="build.url" class="build-date">{{ build.date }}</a>
{{ __('Author|by') }} {{ __('ByAuthor|by') }}
<a :href="build.author.webUrl" class="issue-author-link"> <a :href="build.author.webUrl" class="issue-author-link">
{{ build.author.name }} {{ build.author.name }}
</a> </a>
......
...@@ -30,7 +30,7 @@ class CycleAnalyticsService { ...@@ -30,7 +30,7 @@ class CycleAnalyticsService {
startDate, startDate,
} = options; } = options;
return $.get(`${this.requestPath}/events/${stage.title.toLowerCase()}.json`, { return $.get(`${this.requestPath}/events/${stage.name.toLowerCase()}.json`, {
cycle_analytics: { cycle_analytics: {
start_date: startDate, start_date: startDate,
}, },
......
...@@ -39,7 +39,7 @@ global.cycleAnalytics.CycleAnalyticsStore = { ...@@ -39,7 +39,7 @@ global.cycleAnalytics.CycleAnalyticsStore = {
}); });
newData.stages.forEach((item) => { newData.stages.forEach((item) => {
const stageSlug = gl.text.dasherize(item.title.toLowerCase()); const stageSlug = gl.text.dasherize(item.name.toLowerCase());
item.active = false; item.active = false;
item.isUserAllowed = data.permissions[stageSlug]; item.isUserAllowed = data.permissions[stageSlug];
item.emptyStageText = EMPTY_STAGE_TEXTS[stageSlug]; item.emptyStageText = EMPTY_STAGE_TEXTS[stageSlug];
......
var locales = locales || {}; locales['de'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-04-12 22:37-0500","Last-Translator":"FULL NAME <EMAIL@ADDRESS>","Language-Team":"German","Language":"de","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","lang":"de","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"Author|by":[""],"Commits":[""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploys":[""],"Introducing Cycle Analytics":[""],"Last %d day":["",""],"Limited to showing %d event at most":["",""],"Median":[""],"New Issues":[""],"Not available":[""],"Not enough data":[""],"OfFirstTime|First":[""],"Opened":[""],"Pipeline Health":[""],"ProjectLifecycle|Stage":[""],"Read more":[""],"Related Commits":[""],"Related Issues":[""],"Related Merge Requests":[""],"Relative Builds Trigger by Commits":[""],"Relative Deployed Builds":[""],"Relative Merged Requests":[""],"Showing %d event":["",""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"You need permission.":[""],"day":["",""],"pushed by":[""]}}}; var locales = locales || {}; locales['de'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-04-12 22:37-0500","Last-Translator":"FULL NAME <EMAIL@ADDRESS>","Language-Team":"German","Language":"de","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","lang":"de","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"ByAuthor|by":[""],"Commit":["",""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploy":["",""],"FirstPushedBy|First":[""],"FirstPushedBy|pushed by":[""],"From issue creation until deploy to production":[""],"From merge request merge until deploy to production":[""],"Introducing Cycle Analytics":[""],"Last %d day":["",""],"Limited to showing %d event at most":["",""],"Median":[""],"New Issue":["",""],"Not available":[""],"Not enough data":[""],"Opened":[""],"OpenedNDaysAgo|Opened":[""],"Pipeline Health":[""],"ProjectLifecycle|Stage":[""],"Read more":[""],"Related Commits":[""],"Related Issues":[""],"Related Merge Requests":[""],"Relative Builds Trigger by Commits":[""],"Relative Deployed Builds":[""],"Relative Merged Requests":[""],"Showing %d event":["",""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"Time before an issue gets scheduled":[""],"Time before an issue starts implementation":[""],"Time between merge request creation and merge/close":[""],"Time until first merge request":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Total test time for all commits/merges":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"You need permission.":[""],"day":["",""]}}};
\ No newline at end of file \ No newline at end of file
var locales = locales || {}; locales['en'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-04-12 22:36-0500","Last-Translator":"FULL NAME <EMAIL@ADDRESS>","Language-Team":"English","Language":"en","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","lang":"en","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"Author|by":[""],"Commits":[""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploys":[""],"Introducing Cycle Analytics":[""],"Last %d day":["",""],"Limited to showing %d event at most":["",""],"Median":[""],"New Issues":[""],"Not available":[""],"Not enough data":[""],"OfFirstTime|First":[""],"Opened":[""],"Pipeline Health":[""],"ProjectLifecycle|Stage":[""],"Read more":[""],"Related Commits":[""],"Related Issues":[""],"Related Merge Requests":[""],"Relative Builds Trigger by Commits":[""],"Relative Deployed Builds":[""],"Relative Merged Requests":[""],"Showing %d event":["",""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"You need permission.":[""],"day":["",""],"pushed by":[""]}}}; var locales = locales || {}; locales['en'] = {"domain":"app","locale_data":{"app":{"":{"Project-Id-Version":"gitlab 1.0.0","Report-Msgid-Bugs-To":"","PO-Revision-Date":"2017-04-12 22:36-0500","Last-Translator":"FULL NAME <EMAIL@ADDRESS>","Language-Team":"English","Language":"en","MIME-Version":"1.0","Content-Type":"text/plain; charset=UTF-8","Content-Transfer-Encoding":"8bit","Plural-Forms":"nplurals=2; plural=n != 1;","lang":"en","domain":"app","plural_forms":"nplurals=2; plural=n != 1;"},"ByAuthor|by":[""],"Commit":["",""],"Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project.":[""],"CycleAnalyticsStage|Code":[""],"CycleAnalyticsStage|Issue":[""],"CycleAnalyticsStage|Plan":[""],"CycleAnalyticsStage|Production":[""],"CycleAnalyticsStage|Review":[""],"CycleAnalyticsStage|Staging":[""],"CycleAnalyticsStage|Test":[""],"Deploy":["",""],"FirstPushedBy|First":[""],"FirstPushedBy|pushed by":[""],"From issue creation until deploy to production":[""],"From merge request merge until deploy to production":[""],"Introducing Cycle Analytics":[""],"Last %d day":["",""],"Limited to showing %d event at most":["",""],"Median":[""],"New Issue":["",""],"Not available":[""],"Not enough data":[""],"Opened":[""],"OpenedNDaysAgo|Opened":[""],"Pipeline Health":[""],"ProjectLifecycle|Stage":[""],"Read more":[""],"Related Commits":[""],"Related Issues":[""],"Related Merge Requests":[""],"Relative Builds Trigger by Commits":[""],"Relative Deployed Builds":[""],"Relative Merged Requests":[""],"Showing %d event":["",""],"The coding stage shows the time from the first commit to creating the merge request. The data will automatically be added here once you create your first merge request.":[""],"The collection of events added to the data gathered for that stage.":[""],"The issue stage shows the time it takes from creating an issue to assigning the issue to a milestone, or add the issue to a list on your Issue Board. Begin creating issues to see data for this stage.":[""],"The phase of the development lifecycle.":[""],"The planning stage shows the time from the previous step to pushing your first commit. This time will be added automatically once you push your first commit.":[""],"The production stage shows the total time it takes between creating an issue and deploying the code to production. The data will be automatically added once you have completed the full idea to production cycle.":[""],"The review stage shows the time from creating the merge request to merging it. The data will automatically be added after you merge your first merge request.":[""],"The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time.":[""],"The testing stage shows the time GitLab CI takes to run every pipeline for the related merge request. The data will automatically be added after your first pipeline finishes running.":[""],"The time taken by each data entry gathered by that stage.":[""],"The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6.":[""],"Time before an issue gets scheduled":[""],"Time before an issue starts implementation":[""],"Time between merge request creation and merge/close":[""],"Time until first merge request":[""],"Time|hr":["",""],"Time|min":["",""],"Time|s":[""],"Total Time":[""],"Total test time for all commits/merges":[""],"Want to see the data? Please ask an administrator for access.":[""],"We don't have enough data to show this stage.":[""],"You need permission.":[""],"day":["",""]}}};
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
...@@ -273,14 +273,10 @@ class ApplicationController < ActionController::Base ...@@ -273,14 +273,10 @@ class ApplicationController < ActionController::Base
end end
def set_locale def set_locale
begin Gitlab::I18n.set_locale(current_user)
requested_locale = current_user&.preferred_language || I18n.default_locale
locale = FastGettext.set_locale(requested_locale) yield
I18n.locale = locale ensure
Gitlab::I18n.reset_locale
yield
ensure
I18n.locale = I18n.default_locale
end
end end
end end
...@@ -2,6 +2,7 @@ class AnalyticsStageEntity < Grape::Entity ...@@ -2,6 +2,7 @@ class AnalyticsStageEntity < Grape::Entity
include EntityDateHelper include EntityDateHelper
expose :title expose :title
expose :name
expose :legend expose :legend
expose :description expose :description
......
class AnalyticsSummaryEntity < Grape::Entity class AnalyticsSummaryEntity < Grape::Entity
expose :value, safe: true expose :value, safe: true
expose :title
expose :title do |object|
object.title.pluralize(object.value)
end
end end
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
%ul %ul
%li.stage-header %li.stage-header
%span.stage-name %span.stage-name
{{ s__('ProjectLifecycle|Stage') }} {{ __('ProjectLifecycle|Stage') }}
%i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The phase of the development lifecycle."), "aria-hidden" => "true" } %i.has-tooltip.fa.fa-question-circle{ "data-placement" => "top", title: _("The phase of the development lifecycle."), "aria-hidden" => "true" }
%li.median-header %li.median-header
%span.stage-name %span.stage-name
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
%ul %ul
%li.stage-nav-item{ ':class' => '{ active: stage.active }', '@click' => 'selectStage(stage)', "v-for" => "stage in state.stages" } %li.stage-nav-item{ ':class' => '{ active: stage.active }', '@click' => 'selectStage(stage)', "v-for" => "stage in state.stages" }
.stage-nav-item-cell.stage-name .stage-nav-item-cell.stage-name
{{ s__('CycleAnalyticsStage', stage.title) }} {{ stage.title }}
.stage-nav-item-cell.stage-median .stage-nav-item-cell.stage-median
%template{ "v-if" => "stage.isUserAllowed" } %template{ "v-if" => "stage.isUserAllowed" }
%span{ "v-if" => "stage.value" } %span{ "v-if" => "stage.value" }
......
...@@ -227,7 +227,7 @@ Gitlab::Seeder.quiet do ...@@ -227,7 +227,7 @@ Gitlab::Seeder.quiet do
if ENV[flag] if ENV[flag]
Project.all.each do |project| Project.all.each do |project|
seeder = Gitlab::Seeder::CycleAnalytics.new(project) seeder = Gitlab::Seeder::CycleAnalytics.new(pro)
seeder.seed! seeder.seed!
end end
elsif ENV['CYCLE_ANALYTICS_PERF_TEST'] elsif ENV['CYCLE_ANALYTICS_PERF_TEST']
......
...@@ -44,6 +44,9 @@ module API ...@@ -44,6 +44,9 @@ module API
end end
before { allow_access_with_scope :api } before { allow_access_with_scope :api }
before { Gitlab::I18n.set_locale(current_user) }
after { Gitlab::I18n.reset_locale }
rescue_from Gitlab::Access::AccessDeniedError do rescue_from Gitlab::Access::AccessDeniedError do
rack_response({ 'message' => '403 Forbidden' }.to_json, 403) rack_response({ 'message' => '403 Forbidden' }.to_json, 403)
......
...@@ -17,7 +17,7 @@ module Gitlab ...@@ -17,7 +17,7 @@ module Gitlab
end end
def title def title
name.to_s.capitalize raise NotImplementedError.new("Expected #{self.name} to implement title")
end end
def median def median
......
...@@ -13,12 +13,16 @@ module Gitlab ...@@ -13,12 +13,16 @@ module Gitlab
:code :code
end end
def title
s_('CycleAnalyticsStage|Code')
end
def legend def legend
_("Related Merge Requests") _("Related Merge Requests")
end end
def description def description
"Time until first merge request" _("Time until first merge request")
end end
end end
end end
......
...@@ -14,12 +14,16 @@ module Gitlab ...@@ -14,12 +14,16 @@ module Gitlab
:issue :issue
end end
def title
s_('CycleAnalyticsStage|Issue')
end
def legend def legend
_("Related Issues") _("Related Issues")
end end
def description def description
"Time before an issue gets scheduled" _("Time before an issue gets scheduled")
end end
end end
end end
......
...@@ -14,12 +14,16 @@ module Gitlab ...@@ -14,12 +14,16 @@ module Gitlab
:plan :plan
end end
def title
s_('CycleAnalyticsStage|Plan')
end
def legend def legend
_("Related Commits") _("Related Commits")
end end
def description def description
"Time before an issue starts implementation" _("Time before an issue starts implementation")
end end
end end
end end
......
...@@ -15,12 +15,16 @@ module Gitlab ...@@ -15,12 +15,16 @@ module Gitlab
:production :production
end end
def title
s_('CycleAnalyticsStage|Production')
end
def legend def legend
_("Related Issues") _("Related Issues")
end end
def description def description
"From issue creation until deploy to production" _("From issue creation until deploy to production")
end end
def query def query
......
...@@ -13,12 +13,16 @@ module Gitlab ...@@ -13,12 +13,16 @@ module Gitlab
:review :review
end end
def title
s_('CycleAnalyticsStage|Review')
end
def legend def legend
_("Relative Merged Requests") _("Relative Merged Requests")
end end
def description def description
"Time between merge request creation and merge/close" _("Time between merge request creation and merge/close")
end end
end end
end end
......
...@@ -14,12 +14,16 @@ module Gitlab ...@@ -14,12 +14,16 @@ module Gitlab
:staging :staging
end end
def title
s_('CycleAnalyticsStage|Staging')
end
def legend def legend
_("Relative Deployed Builds") _("Relative Deployed Builds")
end end
def description def description
"From merge request merge until deploy to production" _("From merge request merge until deploy to production")
end end
end end
end end
......
...@@ -8,7 +8,7 @@ module Gitlab ...@@ -8,7 +8,7 @@ module Gitlab
end end
def title def title
self.class.name.demodulize raise NotImplementedError.new("Expected #{self.name} to implement title")
end end
def value def value
......
...@@ -2,6 +2,10 @@ module Gitlab ...@@ -2,6 +2,10 @@ module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
class Commit < Base class Commit < Base
def title
n_('Commit', 'Commits', value)
end
def value def value
@value ||= count_commits @value ||= count_commits
end end
......
...@@ -2,6 +2,10 @@ module Gitlab ...@@ -2,6 +2,10 @@ module Gitlab
module CycleAnalytics module CycleAnalytics
module Summary module Summary
class Deploy < Base class Deploy < Base
def title
n_('Deploy', 'Deploys', value)
end
def value def value
@value ||= @project.deployments.where("created_at > ?", @from).count @value ||= @project.deployments.where("created_at > ?", @from).count
end end
......
...@@ -9,7 +9,7 @@ module Gitlab ...@@ -9,7 +9,7 @@ module Gitlab
end end
def title def title
'New Issue' n_('New Issue', 'New Issues', value)
end end
def value def value
......
...@@ -13,12 +13,16 @@ module Gitlab ...@@ -13,12 +13,16 @@ module Gitlab
:test :test
end end
def title
s_('CycleAnalyticsStage|Test')
end
def legend def legend
_("Relative Builds Trigger by Commits") _("Relative Builds Trigger by Commits")
end end
def description def description
"Total test time for all commits/merges" _("Total test time for all commits/merges")
end end
def stage_query def stage_query
......
...@@ -11,5 +11,15 @@ module Gitlab ...@@ -11,5 +11,15 @@ module Gitlab
def available_locales def available_locales
AVAILABLE_LANGUAGES.keys AVAILABLE_LANGUAGES.keys
end end
def set_locale(current_user)
requested_locale = current_user&.preferred_language || ::I18n.default_locale
locale = FastGettext.set_locale(requested_locale)
::I18n.locale = locale
end
def reset_locale
::I18n.locale = ::I18n.default_locale
end
end end
end end
...@@ -17,18 +17,17 @@ msgstr "" ...@@ -17,18 +17,17 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"\n" "\n"
msgid "Author|by" msgid "ByAuthor|by"
msgstr "" msgstr ""
msgid "Commits" msgid "Commit"
msgstr "" msgid_plural "Commits"
msgstr[0] ""
msgstr[1] ""
msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr "" msgstr ""
msgid "CycleAnalyticsStage"
msgstr ""
msgid "CycleAnalyticsStage|Code" msgid "CycleAnalyticsStage|Code"
msgstr "" msgstr ""
...@@ -50,7 +49,21 @@ msgstr "" ...@@ -50,7 +49,21 @@ msgstr ""
msgid "CycleAnalyticsStage|Test" msgid "CycleAnalyticsStage|Test"
msgstr "" msgstr ""
msgid "Deploys" msgid "Deploy"
msgid_plural "Deploys"
msgstr[0] ""
msgstr[1] ""
msgid "FirstPushedBy|First"
msgstr ""
msgid "FirstPushedBy|pushed by"
msgstr ""
msgid "From issue creation until deploy to production"
msgstr ""
msgid "From merge request merge until deploy to production"
msgstr "" msgstr ""
msgid "Introducing Cycle Analytics" msgid "Introducing Cycle Analytics"
...@@ -69,8 +82,10 @@ msgstr[1] "" ...@@ -69,8 +82,10 @@ msgstr[1] ""
msgid "Median" msgid "Median"
msgstr "" msgstr ""
msgid "New Issues" msgid "New Issue"
msgstr "" msgid_plural "New Issues"
msgstr[0] ""
msgstr[1] ""
msgid "Not available" msgid "Not available"
msgstr "" msgstr ""
...@@ -78,10 +93,10 @@ msgstr "" ...@@ -78,10 +93,10 @@ msgstr ""
msgid "Not enough data" msgid "Not enough data"
msgstr "" msgstr ""
msgid "OfFirstTime|First" msgid "Opened"
msgstr "" msgstr ""
msgid "Opened" msgid "OpenedNDaysAgo|Opened"
msgstr "" msgstr ""
msgid "Pipeline Health" msgid "Pipeline Health"
...@@ -149,6 +164,18 @@ msgstr "" ...@@ -149,6 +164,18 @@ msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr "" msgstr ""
msgid "Time before an issue gets scheduled"
msgstr ""
msgid "Time before an issue starts implementation"
msgstr ""
msgid "Time between merge request creation and merge/close"
msgstr ""
msgid "Time until first merge request"
msgstr ""
msgid "Time|hr" msgid "Time|hr"
msgid_plural "Time|hrs" msgid_plural "Time|hrs"
msgstr[0] "" msgstr[0] ""
...@@ -165,6 +192,9 @@ msgstr "" ...@@ -165,6 +192,9 @@ msgstr ""
msgid "Total Time" msgid "Total Time"
msgstr "" msgstr ""
msgid "Total test time for all commits/merges"
msgstr ""
msgid "Want to see the data? Please ask an administrator for access." msgid "Want to see the data? Please ask an administrator for access."
msgstr "" msgstr ""
...@@ -178,6 +208,3 @@ msgid "day" ...@@ -178,6 +208,3 @@ msgid "day"
msgid_plural "days" msgid_plural "days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "pushed by"
msgstr ""
...@@ -17,18 +17,17 @@ msgstr "" ...@@ -17,18 +17,17 @@ msgstr ""
"Plural-Forms: nplurals=2; plural=n != 1;\n" "Plural-Forms: nplurals=2; plural=n != 1;\n"
"\n" "\n"
msgid "Author|by" msgid "ByAuthor|by"
msgstr "" msgstr ""
msgid "Commits" msgid "Commit"
msgstr "" msgid_plural "Commits"
msgstr[0] ""
msgstr[1] ""
msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr "" msgstr ""
msgid "CycleAnalyticsStage"
msgstr ""
msgid "CycleAnalyticsStage|Code" msgid "CycleAnalyticsStage|Code"
msgstr "" msgstr ""
...@@ -50,7 +49,21 @@ msgstr "" ...@@ -50,7 +49,21 @@ msgstr ""
msgid "CycleAnalyticsStage|Test" msgid "CycleAnalyticsStage|Test"
msgstr "" msgstr ""
msgid "Deploys" msgid "Deploy"
msgid_plural "Deploys"
msgstr[0] ""
msgstr[1] ""
msgid "FirstPushedBy|First"
msgstr ""
msgid "FirstPushedBy|pushed by"
msgstr ""
msgid "From issue creation until deploy to production"
msgstr ""
msgid "From merge request merge until deploy to production"
msgstr "" msgstr ""
msgid "Introducing Cycle Analytics" msgid "Introducing Cycle Analytics"
...@@ -69,8 +82,10 @@ msgstr[1] "" ...@@ -69,8 +82,10 @@ msgstr[1] ""
msgid "Median" msgid "Median"
msgstr "" msgstr ""
msgid "New Issues" msgid "New Issue"
msgstr "" msgid_plural "New Issues"
msgstr[0] ""
msgstr[1] ""
msgid "Not available" msgid "Not available"
msgstr "" msgstr ""
...@@ -78,10 +93,10 @@ msgstr "" ...@@ -78,10 +93,10 @@ msgstr ""
msgid "Not enough data" msgid "Not enough data"
msgstr "" msgstr ""
msgid "OfFirstTime|First" msgid "Opened"
msgstr "" msgstr ""
msgid "Opened" msgid "OpenedNDaysAgo|Opened"
msgstr "" msgstr ""
msgid "Pipeline Health" msgid "Pipeline Health"
...@@ -149,6 +164,18 @@ msgstr "" ...@@ -149,6 +164,18 @@ msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr "" msgstr ""
msgid "Time before an issue gets scheduled"
msgstr ""
msgid "Time before an issue starts implementation"
msgstr ""
msgid "Time between merge request creation and merge/close"
msgstr ""
msgid "Time until first merge request"
msgstr ""
msgid "Time|hr" msgid "Time|hr"
msgid_plural "Time|hrs" msgid_plural "Time|hrs"
msgstr[0] "" msgstr[0] ""
...@@ -165,6 +192,9 @@ msgstr "" ...@@ -165,6 +192,9 @@ msgstr ""
msgid "Total Time" msgid "Total Time"
msgstr "" msgstr ""
msgid "Total test time for all commits/merges"
msgstr ""
msgid "Want to see the data? Please ask an administrator for access." msgid "Want to see the data? Please ask an administrator for access."
msgstr "" msgstr ""
...@@ -178,6 +208,3 @@ msgid "day" ...@@ -178,6 +208,3 @@ msgid "day"
msgid_plural "days" msgid_plural "days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "pushed by"
msgstr ""
...@@ -7,7 +7,7 @@ msgid "" ...@@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2017-05-03 12:28-0500\n" "PO-Revision-Date: 2017-05-03 21:03-0500\n"
"Language-Team: Spanish\n" "Language-Team: Spanish\n"
"Language: es\n" "Language: es\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
...@@ -17,18 +17,17 @@ msgstr "" ...@@ -17,18 +17,17 @@ msgstr ""
"Last-Translator: \n" "Last-Translator: \n"
"X-Generator: Poedit 2.0.1\n" "X-Generator: Poedit 2.0.1\n"
msgid "Author|by" msgid "ByAuthor|by"
msgstr "por" msgstr "por"
msgid "Commits" msgid "Commit"
msgstr "Cambios" msgid_plural "Commits"
msgstr[0] "Cambio"
msgstr[1] "Cambios"
msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr "Cycle Analytics ofrece una visión general de cuánto tiempo tarda en pasar de idea a producción en su proyecto." msgstr "Cycle Analytics ofrece una visión general de cuánto tiempo tarda en pasar de idea a producción en su proyecto."
msgid "CycleAnalyticsStage"
msgstr ""
msgid "CycleAnalyticsStage|Code" msgid "CycleAnalyticsStage|Code"
msgstr "Código" msgstr "Código"
...@@ -51,8 +50,22 @@ msgstr "Puesta en escena" ...@@ -51,8 +50,22 @@ msgstr "Puesta en escena"
msgid "CycleAnalyticsStage|Test" msgid "CycleAnalyticsStage|Test"
msgstr "Pruebas" msgstr "Pruebas"
msgid "Deploys" msgid "Deploy"
msgstr "Despliegues" msgid_plural "Deploys"
msgstr[0] "Despliegue"
msgstr[1] "Despliegues"
msgid "FirstPushedBy|First"
msgstr "Primer"
msgid "FirstPushedBy|pushed by"
msgstr "enviado por"
msgid "From issue creation until deploy to production"
msgstr "Desde la creación de la incidencia hasta el despliegue a producción"
msgid "From merge request merge until deploy to production"
msgstr "Desde la integración de la solicitud de fusión hasta el despliegue a producción"
msgid "Introducing Cycle Analytics" msgid "Introducing Cycle Analytics"
msgstr "Introducción a Cycle Analytics" msgstr "Introducción a Cycle Analytics"
...@@ -70,8 +83,10 @@ msgstr[1] "Limitado a mostrar máximo %d eventos" ...@@ -70,8 +83,10 @@ msgstr[1] "Limitado a mostrar máximo %d eventos"
msgid "Median" msgid "Median"
msgstr "Mediana" msgstr "Mediana"
msgid "New Issues" msgid "New Issue"
msgstr "Nuevas incidencias" msgid_plural "New Issues"
msgstr[0] "Nueva incidencia"
msgstr[1] "Nuevas incidencias"
msgid "Not available" msgid "Not available"
msgstr "No disponible" msgstr "No disponible"
...@@ -79,12 +94,12 @@ msgstr "No disponible" ...@@ -79,12 +94,12 @@ msgstr "No disponible"
msgid "Not enough data" msgid "Not enough data"
msgstr "No hay suficientes datos" msgstr "No hay suficientes datos"
msgid "OfFirstTime|First"
msgstr "Primer"
msgid "Opened" msgid "Opened"
msgstr "Abiertos" msgstr "Abiertos"
msgid "OpenedNDaysAgo|Opened"
msgstr "Abierto"
msgid "Pipeline Health" msgid "Pipeline Health"
msgstr "Estado del Pipeline" msgstr "Estado del Pipeline"
...@@ -150,6 +165,18 @@ msgstr "El tiempo utilizado por cada entrada de datos obtenido por esa etapa." ...@@ -150,6 +165,18 @@ msgstr "El tiempo utilizado por cada entrada de datos obtenido por esa etapa."
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr "El valor en el punto medio de una serie de valores observados. Por ejemplo, entre 3, 5, 9, la mediana es 5. Entre 3, 5, 7, 8, la mediana es (5 + 7) / 2 = 6." msgstr "El valor en el punto medio de una serie de valores observados. Por ejemplo, entre 3, 5, 9, la mediana es 5. Entre 3, 5, 7, 8, la mediana es (5 + 7) / 2 = 6."
msgid "Time before an issue gets scheduled"
msgstr "Tiempo antes de que una incidencia sea programada"
msgid "Time before an issue starts implementation"
msgstr "Tiempo antes de que empieze la implementación de una incidencia"
msgid "Time between merge request creation and merge/close"
msgstr "Tiempo entre la creación de la solicitud de fusión y la integración o cierre de esta"
msgid "Time until first merge request"
msgstr "Tiempo hasta la primera solicitud de fusión"
msgid "Time|hr" msgid "Time|hr"
msgid_plural "Time|hrs" msgid_plural "Time|hrs"
msgstr[0] "" msgstr[0] ""
...@@ -166,6 +193,9 @@ msgstr "" ...@@ -166,6 +193,9 @@ msgstr ""
msgid "Total Time" msgid "Total Time"
msgstr "Tiempo Total" msgstr "Tiempo Total"
msgid "Total test time for all commits/merges"
msgstr "Tiempo total de pruebas para todos los cambios o integraciones"
msgid "Want to see the data? Please ask an administrator for access." msgid "Want to see the data? Please ask an administrator for access."
msgstr "¿Quieres ver los datos? Por favor pedir acceso al administrador." msgstr "¿Quieres ver los datos? Por favor pedir acceso al administrador."
...@@ -179,6 +209,3 @@ msgid "day" ...@@ -179,6 +209,3 @@ msgid "day"
msgid_plural "days" msgid_plural "days"
msgstr[0] "día" msgstr[0] "día"
msgstr[1] "días" msgstr[1] "días"
msgid "pushed by"
msgstr "enviado por"
...@@ -8,8 +8,8 @@ msgid "" ...@@ -8,8 +8,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: gitlab 1.0.0\n" "Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-05-03 12:32-0500\n" "POT-Creation-Date: 2017-05-03 20:53-0500\n"
"PO-Revision-Date: 2017-05-03 12:32-0500\n" "PO-Revision-Date: 2017-05-03 20:53-0500\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n" "Language: \n"
...@@ -18,18 +18,17 @@ msgstr "" ...@@ -18,18 +18,17 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
msgid "Author|by" msgid "ByAuthor|by"
msgstr "" msgstr ""
msgid "Commits" msgid "Commit"
msgstr "" msgid_plural "Commits"
msgstr[0] ""
msgstr[1] ""
msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project." msgid "Cycle Analytics gives an overview of how much time it takes to go from idea to production in your project."
msgstr "" msgstr ""
msgid "CycleAnalyticsStage"
msgstr ""
msgid "CycleAnalyticsStage|Code" msgid "CycleAnalyticsStage|Code"
msgstr "" msgstr ""
...@@ -51,7 +50,21 @@ msgstr "" ...@@ -51,7 +50,21 @@ msgstr ""
msgid "CycleAnalyticsStage|Test" msgid "CycleAnalyticsStage|Test"
msgstr "" msgstr ""
msgid "Deploys" msgid "Deploy"
msgid_plural "Deploys"
msgstr[0] ""
msgstr[1] ""
msgid "FirstPushedBy|First"
msgstr ""
msgid "FirstPushedBy|pushed by"
msgstr ""
msgid "From issue creation until deploy to production"
msgstr ""
msgid "From merge request merge until deploy to production"
msgstr "" msgstr ""
msgid "Introducing Cycle Analytics" msgid "Introducing Cycle Analytics"
...@@ -70,8 +83,10 @@ msgstr[1] "" ...@@ -70,8 +83,10 @@ msgstr[1] ""
msgid "Median" msgid "Median"
msgstr "" msgstr ""
msgid "New Issues" msgid "New Issue"
msgstr "" msgid_plural "New Issues"
msgstr[0] ""
msgstr[1] ""
msgid "Not available" msgid "Not available"
msgstr "" msgstr ""
...@@ -79,10 +94,10 @@ msgstr "" ...@@ -79,10 +94,10 @@ msgstr ""
msgid "Not enough data" msgid "Not enough data"
msgstr "" msgstr ""
msgid "OfFirstTime|First" msgid "Opened"
msgstr "" msgstr ""
msgid "Opened" msgid "OpenedNDaysAgo|Opened"
msgstr "" msgstr ""
msgid "Pipeline Health" msgid "Pipeline Health"
...@@ -150,6 +165,18 @@ msgstr "" ...@@ -150,6 +165,18 @@ msgstr ""
msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6." msgid "The value lying at the midpoint of a series of observed values. E.g., between 3, 5, 9, the median is 5. Between 3, 5, 7, 8, the median is (5+7)/2 = 6."
msgstr "" msgstr ""
msgid "Time before an issue gets scheduled"
msgstr ""
msgid "Time before an issue starts implementation"
msgstr ""
msgid "Time between merge request creation and merge/close"
msgstr ""
msgid "Time until first merge request"
msgstr ""
msgid "Time|hr" msgid "Time|hr"
msgid_plural "Time|hrs" msgid_plural "Time|hrs"
msgstr[0] "" msgstr[0] ""
...@@ -166,6 +193,9 @@ msgstr "" ...@@ -166,6 +193,9 @@ msgstr ""
msgid "Total Time" msgid "Total Time"
msgstr "" msgstr ""
msgid "Total test time for all commits/merges"
msgstr ""
msgid "Want to see the data? Please ask an administrator for access." msgid "Want to see the data? Please ask an administrator for access."
msgstr "" msgstr ""
...@@ -179,6 +209,3 @@ msgid "day" ...@@ -179,6 +209,3 @@ msgid "day"
msgid_plural "days" msgid_plural "days"
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
msgid "pushed by"
msgstr ""
N_('Commits')
N_('CycleAnalyticsStage|Code')
N_('CycleAnalyticsStage|Issue')
N_('CycleAnalyticsStage|Plan')
N_('CycleAnalyticsStage|Production')
N_('CycleAnalyticsStage|Review')
N_('CycleAnalyticsStage|Staging')
N_('CycleAnalyticsStage|Test')
N_('Deploys')
N_('New Issues')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment