From e30cecbc27d45b384ace57a9f616a4d34acf9ec3 Mon Sep 17 00:00:00 2001 From: Jose Ivan Vargas Lopez Date: Wed, 15 Nov 2017 08:42:37 +0000 Subject: [PATCH] Resolve "Internationalization support for Prometheus Service Configuration" --- .../project_services/prometheus_service.rb | 6 ++--- .../services/prometheus/_show.html.haml | 27 +++++++++---------- ...t-for-prometheus-service-configuration.yml | 5 ++++ 3 files changed, 20 insertions(+), 18 deletions(-) create mode 100644 changelogs/unreleased/33338-internationalization-support-for-prometheus-service-configuration.yml diff --git a/app/models/project_services/prometheus_service.rb b/app/models/project_services/prometheus_service.rb index 217f753f05f..fa7b3f2bcaf 100644 --- a/app/models/project_services/prometheus_service.rb +++ b/app/models/project_services/prometheus_service.rb @@ -25,7 +25,7 @@ class PrometheusService < MonitoringService end def description - 'Prometheus monitoring' + s_('PrometheusService|Prometheus monitoring') end def self.to_param @@ -38,8 +38,8 @@ class PrometheusService < MonitoringService type: 'text', name: 'api_url', title: 'API URL', - placeholder: 'Prometheus API Base URL, like http://prometheus.example.com/', - help: 'By default, Prometheus listens on ‘http://localhost:9090’. It’s not recommended to change the default address and port as this might affect or conflict with other services running on the GitLab server.', + placeholder: s_('PrometheusService|Prometheus API Base URL, like http://prometheus.example.com/'), + help: s_('PrometheusService|By default, Prometheus listens on ‘http://localhost:9090’. It’s not recommended to change the default address and port as this might affect or conflict with other services running on the GitLab server.'), required: true } ] diff --git a/app/views/projects/services/prometheus/_show.html.haml b/app/views/projects/services/prometheus/_show.html.haml index d8e11500964..b0cb5ce5e8f 100644 --- a/app/views/projects/services/prometheus/_show.html.haml +++ b/app/views/projects/services/prometheus/_show.html.haml @@ -4,42 +4,39 @@ .row.prepend-top-default.append-bottom-default.prometheus-metrics-monitoring.js-prometheus-metrics-monitoring .col-lg-3 %h4.prepend-top-0 - Metrics + = s_('PrometheusService|Metrics') %p - Metrics are automatically configured and monitored - based on a library of metrics from popular exporters. - = link_to 'More information', help_page_path('user/project/integrations/prometheus') + = s_('PrometheusService|Metrics are automatically configured and monitored based on a library of metrics from popular exporters.') + = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus') .col-lg-9 .panel.panel-default.js-panel-monitored-metrics{ data: { "active-metrics" => "#{project_prometheus_active_metrics_path(@project, :json)}" } } .panel-heading %h3.panel-title - Monitored + = s_('PrometheusService|Monitored') %span.badge.js-monitored-count 0 .panel-body .loading-metrics.text-center.js-loading-metrics = icon('spinner spin 3x', class: 'metrics-load-spinner') - %p Finding and configuring metrics... + %p + = s_('PrometheusService|Finding and configuring metrics...') .empty-metrics.text-center.hidden.js-empty-metrics = custom_icon('icon_empty_metrics') - %p No metrics are being monitored. To start monitoring, deploy to an environment. - = link_to project_environments_path(@project), title: 'View environments', class: 'btn btn-success' do - View environments + %p + = s_('PrometheusService|No metrics are being monitored. To start monitoring, deploy to an environment.') + = link_to s_('PrometheusService|View environments'), project_environments_path(@project), class: 'btn btn-success' %ul.list-unstyled.metrics-list.hidden.js-metrics-list .panel.panel-default.hidden.js-panel-missing-env-vars .panel-heading %h3.panel-title = icon('caret-right lg fw', class: 'panel-toggle js-panel-toggle', 'aria-label' => 'Toggle panel') - Missing environment variable + = s_('PrometheusService|Missing environment variable') %span.badge.js-env-var-count 0 .panel-body.hidden .flash-container .flash-notice .flash-text - To set up automatic monitoring, add the environment variable - %code - $CI_ENVIRONMENT_SLUG - to exporter’s queries. - = link_to 'More information', help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels') + = s_("PrometheusService|To set up automatic monitoring, add the environment variable %{variable} to exporter's queries." % { variable: "$CI_ENVIRONMENT_SLUG" }).html_safe + = link_to s_('PrometheusService|More information'), help_page_path('user/project/integrations/prometheus', anchor: 'metrics-and-labels') %ul.list-unstyled.metrics-list.js-missing-var-metrics-list diff --git a/changelogs/unreleased/33338-internationalization-support-for-prometheus-service-configuration.yml b/changelogs/unreleased/33338-internationalization-support-for-prometheus-service-configuration.yml new file mode 100644 index 00000000000..d61bbf2e355 --- /dev/null +++ b/changelogs/unreleased/33338-internationalization-support-for-prometheus-service-configuration.yml @@ -0,0 +1,5 @@ +--- +title: Add internationalization support for the prometheus integration +merge_request: 33338 +author: +type: other