date error message gets localized

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1870 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
j.wollert 14 years ago committed by jwollert
parent cb6ee1a78c
commit a0b17f60e5
  1. 2
      app/controllers/cost_reports_controller.rb
  2. 2
      app/models/cost_query/validation.rb
  3. 2
      app/models/cost_query/validation/dates.rb
  4. 4
      app/views/cost_reports/index.rhtml
  5. 4
      config/locales/de.yml
  6. 4
      config/locales/en.yml

@ -147,7 +147,7 @@ class CostReportsController < ApplicationController
def valid_query?
return true unless @query
errornous = @query.filters ? @query.filters.select { |f| !f.valid? } : []
@custom_error = errornous.map do |err|
@custom_errors = errornous.map do |err|
"Filter #{l(err.label)}: #{err.errors.join(", ")}"
end
errornous.empty?

@ -5,7 +5,7 @@ module CostQuery::Validation
begin
val_module = CostQuery::Validation.const_get const_name
metaclass.send(:include, val_module)
val_method = "validate_" + val_method.to_s
val_method = "validate_" + val_method.to_s.pluralize
if method(val_method)
validations << val_method
else

@ -6,7 +6,7 @@ module CostQuery::Validation
!!val.to_dateish
rescue ArgumentError
validate_dates(values - [val])
errors << "\'#{val}\' is not a valid date!"
errors << "\'#{val}\' " + l(:validation_failure_date)
false
end
end

@ -4,8 +4,8 @@
<%= stylesheet_link_tag 'reporting', :plugin => 'redmine_reporting' %>
<% end %>
<% if @custom_error && !@custom_error.empty? %>
<% @custom_error.each do |err| %>
<% if @custom_errors && !@custom_errors.empty? %>
<% @custom_errors.each do |err| %>
<div class="flash error"><%= err %></div>
<% end %>
<% end %>

@ -23,4 +23,6 @@ de:
label_count: Anzahl
label_sum: Summe
description_drill_down: Details anzeigen
description_drill_down: Details anzeigen
validation_failure_date: "ist kein gültiges Datum"

@ -23,4 +23,6 @@ en:
label_count: Count
label_sum: Sum
description_drill_down: Show details
description_drill_down: Show details
validation_failure_date: "is not a valid date"

Loading…
Cancel
Save