Skip to content

Commit 69885fa

Browse files
author
Lukas Hodel
committed
Refines auto_sort behaviour
1 parent 4444ecc commit 69885fa

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/active_admin/globalize3/form_builder_extension.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ def translated_inputs(name = "Translations", options = {}, &block)
99
auto_sort = options.fetch(:auto_sort, :false)
1010
form_buffers.last << template.content_tag(:div, class: "activeadmin-translations") do
1111
template.content_tag(:ul, class: "available-locales") do
12-
locales = auto_sort ? I18n.available_locales.sort : I18n.available_locales
13-
locales.map do |locale|
12+
(auto_sort ? I18n.available_locales.sort : I18n.available_locales).map do |locale|
1413
template.content_tag(:li) do
1514
I18n.with_locale(switch_locale ? locale : I18n.locale) do
1615
template.content_tag(:a, I18n.t(:"active_admin.globalize3.language.#{locale}"), href:".locale-#{locale}")

0 commit comments

Comments
 (0)