adds translation for admin settings' keys names
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<ul class="admin-list">
|
<ul class="admin-list">
|
||||||
<% @settings.each do |setting| %>
|
<% @settings.each do |setting| %>
|
||||||
<li>
|
<li>
|
||||||
<strong><%= setting.key.classify %></strong>
|
<strong><%= t("settings.#{setting.key}") %></strong>
|
||||||
|
|
||||||
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
|
<%= form_for(setting, url: admin_setting_path(setting), html: { id: "edit_#{dom_id(setting)}"}) do |f| %>
|
||||||
<%= f.text_field :value, label: false, id: dom_id(setting) %>
|
<%= f.text_field :value, label: false, id: dom_id(setting) %>
|
||||||
|
|||||||
8
config/locales/settings.en.yml
Normal file
8
config/locales/settings.en.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
en:
|
||||||
|
settings:
|
||||||
|
official_level_1_name: "Level 1 official positions"
|
||||||
|
official_level_2_name: "Level 2 official positions"
|
||||||
|
official_level_3_name: "Level 3 official positions"
|
||||||
|
official_level_4_name: "Level 4 official positions"
|
||||||
|
official_level_5_name: "Level 5 official positions"
|
||||||
|
max_ratio_anon_votes_on_debates: "Max allowed percentage of anonymous votes per debate"
|
||||||
8
config/locales/settings.es.yml
Normal file
8
config/locales/settings.es.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
es:
|
||||||
|
settings:
|
||||||
|
official_level_1_name: "Cargos públicos de nivel 1"
|
||||||
|
official_level_2_name: "Cargos públicos de nivel 2"
|
||||||
|
official_level_3_name: "Cargos públicos de nivel 3"
|
||||||
|
official_level_4_name: "Cargos públicos de nivel 4"
|
||||||
|
official_level_5_name: "Cargos públicos de nivel 5"
|
||||||
|
max_ratio_anon_votes_on_debates: "Porcentaje máximo de votos anónimos por debate"
|
||||||
@@ -140,8 +140,8 @@ FactoryGirl.define do
|
|||||||
end
|
end
|
||||||
|
|
||||||
factory :setting do
|
factory :setting do
|
||||||
sequence(:key) { |n| "setting key number #{n}" }
|
sequence(:key) { |n| "Setting Key #{n}" }
|
||||||
sequence(:value) { |n| "setting number #{n} value" }
|
sequence(:value) { |n| "Setting #{n} Value" }
|
||||||
end
|
end
|
||||||
|
|
||||||
factory :ahoy_event, :class => Ahoy::Event do
|
factory :ahoy_event, :class => Ahoy::Event do
|
||||||
|
|||||||
@@ -12,9 +12,9 @@ feature 'Admin settings' do
|
|||||||
scenario 'Index' do
|
scenario 'Index' do
|
||||||
visit admin_settings_path
|
visit admin_settings_path
|
||||||
|
|
||||||
expect(page).to have_content @setting1.key.classify
|
expect(page).to have_content @setting1.key
|
||||||
expect(page).to have_content @setting2.key.classify
|
expect(page).to have_content @setting2.key
|
||||||
expect(page).to have_content @setting3.key.classify
|
expect(page).to have_content @setting3.key
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario 'Update' do
|
scenario 'Update' do
|
||||||
|
|||||||
Reference in New Issue
Block a user