diff options
author | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-08 10:15:27 -0500 |
---|---|---|
committer | Alfredo Sumaran <alfredo@gitlab.com> | 2017-06-08 10:15:27 -0500 |
commit | b55bd9ef95734a6805b11a8a8322149e885425a6 (patch) | |
tree | 769f52169d7ad85d68aea3218c7e9116f9269b25 /app/helpers/ci_status_helper.rb | |
parent | c24b70682448f23d7eb01853026cfe6abdf86190 (diff) | |
parent | b4972c4b237ad270ad1a4054c2fe2439d60ee06d (diff) | |
download | gitlab-ce-25426-group-dashboard-ui.tar.gz |
Merge branch 'master' into 25426-group-dashboard-ui25426-group-dashboard-ui
Diffstat (limited to 'app/helpers/ci_status_helper.rb')
-rw-r--r-- | app/helpers/ci_status_helper.rb | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/app/helpers/ci_status_helper.rb b/app/helpers/ci_status_helper.rb index 32b1e7822af..21c0eb8b54c 100644 --- a/app/helpers/ci_status_helper.rb +++ b/app/helpers/ci_status_helper.rb @@ -16,16 +16,18 @@ module CiStatusHelper return status.label end - case status - when 'success' - 'passed' - when 'success_with_warnings' - 'passed with warnings' - when 'manual' - 'waiting for manual action' - else - status - end + label = case status + when 'success' + 'passed' + when 'success_with_warnings' + 'passed with warnings' + when 'manual' + 'waiting for manual action' + else + status + end + translation = "CiStatusLabel|#{label}" + s_(translation) end def ci_text_for_status(status) @@ -35,13 +37,22 @@ module CiStatusHelper case status when 'success' - 'passed' + s_('CiStatusText|passed') when 'success_with_warnings' - 'passed' + s_('CiStatusText|passed') when 'manual' - 'blocked' + s_('CiStatusText|blocked') else - status + # All states are already being translated inside the detailed statuses: + # :running => Gitlab::Ci::Status::Running + # :skipped => Gitlab::Ci::Status::Skipped + # :failed => Gitlab::Ci::Status::Failed + # :success => Gitlab::Ci::Status::Success + # :canceled => Gitlab::Ci::Status::Canceled + # The following states are customized above: + # :manual => Gitlab::Ci::Status::Manual + status_translation = "CiStatusText|#{status}" + s_(status_translation) end end |