Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #14256 - Update the strings to be more compliant with the proje… #156

Merged
merged 1 commit into from
Apr 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions app/controllers/api/v2/compliance/arf_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ def get_resource
api_base_url "/api/v2"
end

api :GET, '/compliance/arf_reports', N_('List Arf reports')
api :GET, '/compliance/arf_reports', N_('List ARF reports')
param_group :search_and_pagination, ::Api::V2::BaseController

def index
@arf_reports = resource_scope_for_index(:permission => :edit_compliance).includes(:asset)
end

api :GET, '/compliance/arf_reports/:id', N_('Show an Arf report')
api :GET, '/compliance/arf_reports/:id', N_('Show an ARF report')
param :id, :identifier, :required => true

def show
end

api :DELETE, '/compliance/arf_reports/:id', N_('Deletes an Arf Report')
api :DELETE, '/compliance/arf_reports/:id', N_('Deletes an ARF Report')
param :id, :identifier, :required => true

def destroy
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/api/v2/compliance/policies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ def show
param :policy, Hash, :required => true, :action_aware => true do
param :name, String, :required => true, :desc => N_('Policy name')
param :description, String, :desc => N_('Policy description')
param :scap_content_id, Integer, :required => true, :desc => N_('Policy scap content id')
param :scap_content_profile_id, Integer, :required => true, :desc => N_('Policy scap content profile id')
param :scap_content_id, Integer, :required => true, :desc => N_('Policy SCAP content ID')
param :scap_content_profile_id, Integer, :required => true, :desc => N_('Policy SCAP content profile ID')
param :period, String, :required => true, :desc => N_('Policy schedule period')
param :weekday, String, :required => true, :desc => N_('Policy schedule weekday')
param :hostgroup_ids, Array, :desc => N_('Apply policy to hostgroups')
param :hostgroup_ids, Array, :desc => N_('Apply policy to host groups')
param_group :taxonomies, ::Api::V2::BaseController
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def show

def_param_group :scap_content do
param :scap_content, Hash, :required => true, :action_aware => true do
param :title, String, :required => true, :desc => N_('Scap content name')
param :title, String, :required => true, :desc => N_('SCAP content name')
param :scap_file, String, :required => true
param_group :taxonomies, ::Api::V2::BaseController
end
Expand Down
10 changes: 5 additions & 5 deletions app/controllers/arf_reports_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ def parse_bzip
response = @arf_report.to_bzip
send_data response, :filename => "#{@arf_report.id}_arf_report.bz2", :type => 'application/octet-stream', :disposition => 'attachement'
rescue => e
process_error(:error_msg => (_("Failed to downloaded Arf report as bzip: %s") % (e.message)),
process_error(:error_msg => (_("Failed to downloaded ARF report as bzip: %s") % (e.message)),
:error_redirect => arf_report_path(@arf_report.id))
end
end

def destroy
if @arf_report.destroy
process_success(:success_msg => (_("Successfully deleted Arf report.")), :success_redirect => arf_reports_path)
process_success(:success_msg => (_("Successfully deleted ARF report.")), :success_redirect => arf_reports_path)
else
process_error(:error_msg => _("Failed to delete Arf Report for host %{host_name} reported at %{reported_at}") % {:host_name => @arf_report.host.name, :reported_at => @arf_report.reported_at})
process_error(:error_msg => _("Failed to delete ARF Report for host %{host_name} reported at %{reported_at}") % {:host_name => @arf_report.host.name, :reported_at => @arf_report.reported_at})
end
end

Expand Down Expand Up @@ -70,11 +70,11 @@ def find_multiple
if params[:arf_report_ids].present?
@arf_reports = ::ForemanOpenscap::ArfReport.where(:id => params[:arf_report_ids])
if @arf_reports.empty?
error _('No complince reports were found.')
error _('No compliance reports were found.')
redirect_to(arf_reports_path) and return false
end
else
error _('No complince reports selected')
error _('No compliance reports selected')
redirect_to(arf_reports_path) and return false
end
return @arf_reports
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/policies_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def remove_policy_from_multiple_hosts
notice _("Updated hosts: Unassigned from compliance policy '%s'") % policy.name
redirect_to hosts_path
else
error _('No valid policy id provided')
error _('No valid policy ID provided')
redirect_to hosts_path
end
end
Expand Down
26 changes: 26 additions & 0 deletions app/helpers/dashboard_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#
# Copyright (c) 2014 Red Hat Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 3 (GPLv3). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy of GPLv3
# along with this software; if not, see http://www.gnu.org/licenses/gpl.txt
#

module DashboardHelper

def latest_headers
string = "<th>#{_("Host")}</th>"
string += "<th>#{_("Policy")}</th>"
# TRANSLATORS: initial character of Passed
string += translated_header(s_('Passed|P'), _('Passed'))
# TRANSLATORS: initial character of Failed
string += translated_header(s_('Failed|F'), _('Failed'))
# TRANSLATORS: initial character of Othered which is an SCAP term
string += translated_header(s_('Othered|O'), _('Othered'))

string.html_safe
end

end
4 changes: 2 additions & 2 deletions app/lib/proxy_api/openscap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def arf_report_html(report, cname)
@connect_params[:headers] = { :accept => 'application/html' }
get "/arf/#{report.id}/#{cname}/#{report.reported_at.to_i}/#{report.policy_arf_report.digest}/html"
rescue => e
raise ::ProxyAPI::ProxyException.new(url, e, N_("Unable to get html version of requested report from Smart Proxy"))
raise ::ProxyAPI::ProxyException.new(url, e, N_("Unable to get HTML version of requested report from Smart Proxy"))
end
end

Expand All @@ -33,7 +33,7 @@ def arf_report_bzip(report, cname)
@connect_params[:headers] = { :content_type => 'application/arf-bzip2', :content_encoding => 'x-bzip2' }
get "/arf/#{report.id}/#{cname}/#{report.reported_at.to_i}/#{report.policy_arf_report.digest}/xml"
rescue => e
raise ::ProxyAPI::ProxyException.new(url, e, N_("Unable to get xml version of requested report from Smart Proxy"))
raise ::ProxyAPI::ProxyException.new(url, e, N_("Unable to get XML version of requested report from Smart Proxy"))
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/mailers/foreman_openscap/policy_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def policy_summary(options = {})
logger.warn "User with valid email not supplied, mail report will not be sent"
else
set_locale_for(user) do
subject = _("Scap policies summary")
subject = _("SCAP policies summary")
mail(:to => user.mail, :subject => subject)
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def update_scap_client_params(proxy_id)
new_proxy = SmartProxy.find proxy_id
model_match = self.class.name.underscore.match(/\Ahostgroup\z/) ? "hostgroup" : "fqdn"
puppetclass = Puppetclass.find_by_name("foreman_scap_client")
fail _("Puppetclass 'foreman_scap_client' not found, make sure it is imported form Puppetmaster") if puppetclass.nil?
fail _("Puppet class 'foreman_scap_client' not found, make sure it is imported form Puppet master") if puppetclass.nil?
scap_params = puppetclass.class_params
server_lookup_key = scap_params.find { |param| param.key == "server" }
port_lookup_key = scap_params.find { |param| param.key == "port" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module OpenscapProxyExtensions
def openscap_proxy_api
return @openscap_api if @openscap_api
proxy_url = openscap_proxy.url if openscap_proxy
fail(_("No openscap proxy found for %s") % id) unless proxy_url
fail(_("No OpenSCAP proxy found for %s") % id) unless proxy_url
@openscap_api = ::ProxyAPI::Openscap.new(:url => proxy_url)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/models/foreman_openscap/policy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def to_html
if (proxy = scap_content.proxy_url)
api = ProxyAPI::Openscap.new(:url => proxy)
else
return ("<h2>%s</h2>" % _('No valid OpenScap proxy server found.')).html_safe
return ("<h2>%s</h2>" % _('No valid OpenSCAP proxy server found.')).html_safe
end

api.policy_html_guide(scap_content.scap_file, scap_content_profile.profile_id)
Expand Down
6 changes: 3 additions & 3 deletions app/models/foreman_openscap/scap_content.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ def validate(scap_content)
return unless scap_content.scap_file_changed?

unless SmartProxy.with_features('Openscap').any?
scap_content.errors.add(:base, _('No Proxy with OpenScap features'))
scap_content.errors.add(:base, _('No proxy with OpenSCAP features'))
return false
end

if scap_content.proxy_url.nil?
scap_content.errors.add(:base, _('No Available Proxy to validate SCAP content'))
scap_content.errors.add(:base, _('No available proxy to validate SCAP content'))
return false
end

Expand All @@ -29,7 +29,7 @@ def validate(scap_content)


unless (scap_content.scap_content_profiles.map(&:profile_id) - scap_content.fetch_profiles.keys).empty?
scap_content.errors.add(:scap_file, _('Changed file does not include existing SCAP Content profiles'))
scap_content.errors.add(:scap_file, _('Changed file does not include existing SCAP content profiles'))
return false
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/arf_reports/delete_multiple.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@

<%= form_tag submit_delete_multiple_arf_reports_path({:arf_report_ids => params[:arf_report_ids]}) do %>
<span class="label label-danger"><%= _('Delete') %></span>
<%= _('these Complinace reports') %>
<%= _('these Complianace reports') %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/arf_reports/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= javascript 'foreman_openscap/reports' %>
<%= stylesheet 'foreman_openscap/reports' %>
<% title "#{@arf_report.host}" %>
<p class='ra'> <%= _("Reported at %s ") % @arf_report.reported_at %> </p>
<p class='ra'> <%= _("Reported at %s") % @arf_report.reported_at %> </p>

<% content_for(:search_bar) {show_logs} %>

Expand Down
2 changes: 1 addition & 1 deletion app/views/compliance_hosts/_openscap_proxy.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% data_url = @host ? openscap_proxy_changed_hosts_path : openscap_proxy_changed_hostgroups_path%>
<%= select_f f, :openscap_proxy_id, SmartProxy.with_features("Openscap"), :id, :name,
{ :include_blank => blank_or_inherit_f(f, :openscap_proxy) },
{ :label => _('Openscap Proxy'),
{ :label => _('OpenSCAP Proxy'),
:onchange => 'updateOpenscapProxy(this)',
:'data-url' => data_url,
:help_inline => :indicator } %>
2 changes: 1 addition & 1 deletion app/views/compliance_hosts/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<%= javascript 'dashboard', 'foreman_openscap/scap_hosts_show' %>

<% title _("%s compliance reports by policy") % @host.to_label %>
<% title n_("%s compliance report by policy", "%s compliance reports by policy"m , host.combined_policies.length) % @host.to_label %>
<% @host.combined_policies.each do |policy| %>
<h2 class="center-block"><%= _('Policy %s') % policy %></h2>
<div class="row">
Expand Down
8 changes: 2 additions & 6 deletions app/views/dashboard/_compliance_host_reports_widget.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
<% else %>
<table class="table table-striped ellipsis">
<tr>
<th><%= _('Host') %></th>
<th><%= _('Policy') %></th>
<%= translated_header(s_('Passed|P'), _('Passed')).html_safe %>
<%= translated_header(s_('Failed|F'), _('Failed')).html_safe %>
<%= translated_header(s_('Othered|O'), _('Othered')).html_safe %>
<%= latest_headers() %>
</tr>
<% latest_reports.each do |report| %>
<tr>
Expand All @@ -21,4 +17,4 @@
</tr>
<% end %>
</table>
<% end %>
<% end %>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title> Summary report for OpenScap from Foreman </title>
</head>
<body style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; color: #3f3f3f; background-color: #f1f1f1; padding: 10px 24px">
<h2 style="font-weight: normal; text-transform: uppercase; font-size: 120%;"><%= _("<b>Foreman</b> OpenScap summary").html_safe %></h2>
<h2 style="font-weight: normal; text-transform: uppercase; font-size: 120%;"><%= _("<b>Foreman</b> OpenSCAP summary").html_safe %></h2>
<h2 style="margin: 5px 0px;"><%= _("Summary from %{time} ago to now") % {:time => distance_of_time_in_words(Time.now - @time)} %></h2>
<h3 style="margin: 0px;"><%= _("Summary report from Foreman server at %{foreman_url}") % {:foreman_url => Setting[:foreman_url]} %></h3>
<div style="background: #e1e2e3; padding: 20px 40px; margin: 5px 0px 10px;">
Expand Down
2 changes: 1 addition & 1 deletion app/views/policies/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<% if show_organization_tab? %>
<li><a href='#organizations' data-toggle='tab'><%= _('Organizations') %></a></li>
<% end %>
<li><a href='#hostgroups' data-toggle='tab'><%= _('Hostgroups') %></a></li>
<li><a href='#hostgroups' data-toggle='tab'><%= _('Host Groups') %></a></li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="primary">
Expand Down
13 changes: 7 additions & 6 deletions app/views/policies/welcome.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<% title_actions display_link_if_authorized(_("New Compliance policy"), hash_for_new_policy_path) %>
<% title_actions display_link_if_authorized(_("New Compliance Policy"), hash_for_new_policy_path) %>

<% title _("Compliance policy configuration") %>
<div id="welcome">
<p>
<%= _('A compliance policy is defined by security professionals who specify desired settings
(often in the form of a checklist) that are to be used in the computing environment. Compliance audit is a process of figuring out
whether a given object follows all the rules written out in a compliance policy.') %>
<%= _('A compliance policy is defined by security professionals who specify desired ' +
'settings (often in the form of a checklist) that are to be used in the computing ' +
'environment. Compliance audit is a process of figuring out whether a given object ' +
'follows all the rules written out in a compliance policy.') %>
</p>
<p>
<%= (_('In Foreman, a compliance policy checklist is defined via %s, once SCAP content is present, you can create a policy,
assign select hostgroups and schedule to run.') % link_to(_('SCAP content'), scap_contents_path)).html_safe %>
<%= (_('In Foreman, a compliance policy checklist is defined via %s, once SCAP content ' +
'is present, you can create a policy, assign select host groups and schedule to run.') % link_to(_('SCAP content'), scap_contents_path)).html_safe %>
</p>
</div>
2 changes: 1 addition & 1 deletion app/views/scap_contents/welcome.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
and policy compliance evaluation. ') %><small><%= (_('Source: Wikipedia %s') % link_to(_('read more'), 'http://en.wikipedia.org/wiki/Security_Content_Automation_Protocol')).html_safe %></small>
</p>
<p>
<%= (_("In Foreman, scap_contents represent the SCAP security guides on your hosts, and create SCAP profiles for you to assign to hosts / hostgroups
<%= (_("In Foreman, scap_contents represent the SCAP security guides on your hosts, and create SCAP profiles for you to assign to hosts / host groups
via %s") % link_to('compliance policies', policies_path)).html_safe %>
</p>
</div>
2 changes: 1 addition & 1 deletion db/seeds.d/openscap_policy_notification.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
policy_notification = {
:name => :openscap_policy_summary,
:description => N_('A summary of reports for OpenScap policies'),
:description => N_('A summary of reports for OpenSCAP policies'),
:mailer => 'ForemanOpenscap::PolicyMailer',
:method => 'policy_summary',
:subscription_type => 'report',
Expand Down