Skip to content

Commit

Permalink
Merge pull request #531 from commercekitchen/develop
Browse files Browse the repository at this point in the history
Spanish Translations
  • Loading branch information
tmichaelreis authored Aug 24, 2021
2 parents 7328f9a + 4c731b9 commit 684cffc
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/courses/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<% if @courses.count > 0 %>
<%= render "shared/courses/listing" %>
<% elsif params[:search].present? %>
<p>No courses match your search. <%= link_to "View all courses", courses_path %></p>
<p><%= t('course_page.no_courses_match') %> <%= link_to t('course_page.view_all_courses'), courses_path %></p>
<% else %>
<p><%= t('course_page.materials_coming_soon') %><p>
<% end %>
2 changes: 1 addition & 1 deletion app/views/shared/layout/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="container footer-content">
<ul class="cms_nav" id="footer_link_section">
<% if @footer_pages&.any? || @footer_links&.any? %>
<strong>LEARN MORE</strong>
<strong><%= t('common.learn_more') %></strong>
<% @footer_pages&.each do |page| %>
<li><%= link_to page.title, cms_page_path(page), class: "cms_nav--link" %></li>
<% end %>
Expand Down
4 changes: 4 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ en:
submit: "Submit"
save: "Save"
cancel: "Cancel"
learn_more: "LEARN MORE"
admin:
dashboard: "Admin Dashboard"
home:
Expand Down Expand Up @@ -225,6 +226,7 @@ en:
well_suggest_more_courses: "and we'll suggest even more courses."
ready_to_learn_more: "Ready to Learn More?"
find_new_courses_retake_quiz: "Find new courses when you retake the quiz"
view_your_courses: "View all your courses"
course_page:
add_to_your_plan: "Add to your plan"
lessons: "Activities"
Expand All @@ -246,6 +248,8 @@ en:
lesson: "Activity"
start_lesson_instructions: "Click on a lesson below to begin."
materials_coming_soon: "Course materials coming soon."
no_courses_match: "No courses match your search."
view_all_courses: "View all courses"
lesson_page:
percent_complete: "% Complete"
skip_to_next_lesson: "Skip to next Activity >>"
Expand Down
3 changes: 3 additions & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ es:
submit: "Enviar"
save: "Guardar"
cancel: "Cancelar"
learn_more: "APRENDE MÁS"
admin:
dashboard: "Panel de control"
home:
Expand Down Expand Up @@ -248,6 +249,8 @@ es:
lesson: "Actividad"
start_lesson_instructions: "Da click en una actividad debajo para empezar."
materials_coming_soon: "Próximamente los materiales del curso."
no_courses_match: "Ningún curso coincide con su búsqueda."
view_all_courses: "Ver todos los cursos"
lesson_page:
percent_complete: "% Avance"
skip_to_next_lesson: "Pasar a la siguiente actividad >>"
Expand Down
8 changes: 8 additions & 0 deletions spec/features/anonymous_user/course_search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@
expect(page).to have_link('View all courses', href: courses_path)
end

scenario 'no courses found - spanish' do
click_link 'Español'
fill_in 'Search', with: 'foobar'
click_on('submit-search')
expect(page).to have_content('Ningún curso coincide con su búsqueda.')
expect(page).to have_link('Ver todos los cursos', href: courses_path)
end

scenario 'course found' do
fill_in 'Search', with: course.title
click_on('submit-search')
Expand Down
8 changes: 8 additions & 0 deletions spec/features/user/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
expect(page).to have_link('View all courses', href: courses_path)
end

scenario 'no courses found - spanish' do
click_link 'Español'
fill_in 'Search', with: 'foobar'
click_on('submit-search')
expect(page).to have_content('Ningún curso coincide con su búsqueda.')
expect(page).to have_link('Ver todos los cursos', href: courses_path)
end

scenario 'course found' do
fill_in 'Search', with: course.title
click_on('submit-search')
Expand Down
3 changes: 3 additions & 0 deletions spec/features/user/user_walkthrough_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@

scenario 'english LEARN MORE links display' do
visit root_path
expect(page).to have_content('LEARN MORE')
expect(page).to have_link(cms_page.title, href: cms_page_path(cms_page))
expect(page).to have_link(link1.label, href: link1.url)
expect(page).to have_link(link2.label, href: link2.url)
Expand All @@ -104,6 +105,8 @@
scenario 'spanish LEARN MORE links display' do
visit root_path
click_link 'Español'
expect(page).to have_content('APRENDE MÁS')
expect(page).not_to have_content('LEARN MORE')
expect(page).to have_link(spanish_cms_page.title)
expect(page).to have_link(spanish_link.label)
expect(page).not_to have_link(cms_page.title)
Expand Down

0 comments on commit 684cffc

Please sign in to comment.