Skip to content

Commit f6b1014

Browse files
Revert "Add internationalization to paginated collection"
This reverts commit aba4f02.
1 parent aba4f02 commit f6b1014

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

lib/active_admin/locales/en.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,4 @@ en:
2424
less_than: "Less Than"
2525
main_content: "Please implement %{model}#main_content to display content."
2626
logout: "Logout"
27-
no_entries_found: "No %{model} found"
28-
displaying_entry: "Displaying %{number} %{model}"
29-
displaying_entries: "Displaying %{number} %{model}"
30-
displaying_n_entries_of_m: "Displaying %{model} %{range} of %{total} in total"
27+

lib/active_admin/locales/es.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,4 @@ es:
2424
less_than: "Menor que"
2525
main_content: "Por favor implemente %{model}#main_content para mostrar contenido."
2626
logout: "Salir"
27-
no_entries_found: "No se encontraron %{model}"
28-
displaying_entry: "Mostrando %{number} %{model}"
29-
displaying_entries: "Mostrando %{number} %{model}"
30-
displaying_n_entries_of_m: "Mostrando %{range} %{model} de %{total} en total"
27+

lib/active_admin/views/components/paginated_collection.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,18 @@ def page_entries_info(options = {})
7676

7777
if collection.num_pages < 2
7878
case collection.size
79-
when 0; I18n.t('active_admin.no_entries_found', :model => entry_name.pluralize)
80-
when 1; I18n.t('active_admin.displaying_entry', :number => '<b>1</b>', :model => entry_name)
81-
else; I18n.t('active_admin.displaying_entries', :number => "<b>#{collection.size}</b>", :model => entry_name.pluralize)
79+
when 0; "No #{entry_name.pluralize} found"
80+
when 1; "Displaying <b>1</b> #{entry_name}"
81+
else; "Displaying <b>all #{collection.size}</b> #{entry_name.pluralize}"
8282
end
8383
else
8484
offset = collection.current_page * ActiveAdmin.default_per_page
8585
total = collection.total_count
86-
range = %{<b>%d&nbsp;-&nbsp;%d</b>} % [
86+
%{Displaying #{entry_name.pluralize} <b>%d&nbsp;-&nbsp;%d</b> of <b>%d</b> in total} % [
8787
offset - ActiveAdmin.default_per_page + 1,
88-
offset > total ? total : offset
88+
offset > total ? total : offset,
89+
total
8990
]
90-
I18n.t('active_admin.displaying_n_entries_of_m', :range => range, :total => "<b>#{total}</b>", :model => entry_name.pluralize)
9191
end
9292
end
9393

0 commit comments

Comments
 (0)