aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert2017-12-12 18:52:07 +0100
committerRobert2017-12-12 18:52:07 +0100
commitf584e9bba564355ca4e3650e4a167991249defb8 (patch)
treee6fadd4522e635a79831d1fd0db535f07960dc3a
parentf4c5a5a986d2e0e45b33014564eeb6e4e09b66f7 (diff)
downloadchouette-core-f584e9bba564355ca4e3650e4a167991249defb8.tar.bz2
Refs: #5206@0.5h; Translations added
-rw-r--r--app/helpers/multiple_selection_toolbox_helper.rb4
-rw-r--r--config/locales/workbenches.en.yml4
-rw-r--r--config/locales/workbenches.fr.yml5
-rw-r--r--spec/helpers/multiple_selection_toolbox_helper_spec.rb10
-rw-r--r--spec/support/text.rb6
5 files changed, 19 insertions, 10 deletions
diff --git a/app/helpers/multiple_selection_toolbox_helper.rb b/app/helpers/multiple_selection_toolbox_helper.rb
index 8e23aef7d..c5a30ddb0 100644
--- a/app/helpers/multiple_selection_toolbox_helper.rb
+++ b/app/helpers/multiple_selection_toolbox_helper.rb
@@ -14,7 +14,7 @@ module MultipleSelectionToolboxHelper
method: :delete,
data: {
path: delete_path,
- # #5206 Missing Translations
+ # #5206 Missing Translations an
confirm: 'Etes-vous sûr(e) de vouloir effectuer cette action ?'
},
title: t("actions.#{action}")
@@ -29,7 +29,7 @@ module MultipleSelectionToolboxHelper
label = content_tag(
:span,
- ("<span>0</span> élément(s) sélectionné(s)").html_safe,
+ ("<span>0</span> #{t 'info.selected_elements'}").html_safe,
class: 'info-msg'
)
diff --git a/config/locales/workbenches.en.yml b/config/locales/workbenches.en.yml
index 7f21f47a0..264379daf 100644
--- a/config/locales/workbenches.en.yml
+++ b/config/locales/workbenches.en.yml
@@ -22,3 +22,7 @@ en:
zero: "workbench"
one: "workbench"
other: "workbenches"
+ info:
+ selected_elements: "chosen element(s)"
+ actions:
+ confirm: "Are you sure to really execute this action?"
diff --git a/config/locales/workbenches.fr.yml b/config/locales/workbenches.fr.yml
index d76255e86..edf503798 100644
--- a/config/locales/workbenches.fr.yml
+++ b/config/locales/workbenches.fr.yml
@@ -12,3 +12,8 @@ fr:
zero: "espace de travail"
one: "espace de travail"
other: "espaces de travail"
+ info:
+ selected_elements: "élément(s) sélectionné(s)"
+
+ actions:
+ confirm: "Etes-vous sûr(e) de vouloir effectuer cette action ?"
diff --git a/spec/helpers/multiple_selection_toolbox_helper_spec.rb b/spec/helpers/multiple_selection_toolbox_helper_spec.rb
index e30fb054a..450fae52c 100644
--- a/spec/helpers/multiple_selection_toolbox_helper_spec.rb
+++ b/spec/helpers/multiple_selection_toolbox_helper_spec.rb
@@ -5,13 +5,13 @@ RSpec.describe MultipleSelectionToolboxHelper, type: :helper do
let( :expected_html ) do <<-EOHTML.chomp
<div class="select_toolbox noselect" id="selected-referentials-action-box">
<ul>
- <li class="st_action"><a data-path="/workbenches/#{workbench_id}/referentials" data-confirm="Etes-vous sûr(e) de vouloir effectuer cette action ?" title="Supprimer" rel="nofollow" data-method="delete" href="#"><span class="fa fa-trash"></span></a></li>
+ <li class="st_action"><a data-path="/workbenches/#{workbench_id}/referentials" data-confirm="#{I18n.t('actions.confirm')}" title="Supprimer" rel="nofollow" data-method="delete" href="#"><span class="fa fa-trash"></span></a></li>
</ul>
- <span class="info-msg"><span>0</span> élément(s) sélectionné(s)</span></div>
+ <span class="info-msg"><span>0</span> #{I18n.t('info.selected_elements')}</span></div>
EOHTML
end
- context 'rendering' do
+ context 'rendering' do
it 'the expected output' do
output = beautify_html(helper.
@@ -19,7 +19,7 @@ RSpec.describe MultipleSelectionToolboxHelper, type: :helper do
expect(output).to eq(expected_html), colorized_diff(expected_html, output)
end
-
+
end
-
+
end
diff --git a/spec/support/text.rb b/spec/support/text.rb
index 1fe02436d..43b4ec6a5 100644
--- a/spec/support/text.rb
+++ b/spec/support/text.rb
@@ -1,8 +1,8 @@
require 'htmlbeautifier'
module Support::Text
-
- def beautify_html html, indent: 4
+
+ def beautify_html html, indent: 4
HtmlBeautifier.beautify(html, indent: ' ' * indent)
end
@@ -10,7 +10,7 @@ module Support::Text
RSpec::Support::Differ.new(
color: RSpec::Matchers.configuration.color?
).diff_as_string(expected, actual)
- end
+ end
end
RSpec.configure do | config |