Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 1bffdb9

Browse files
committed
default localte option in translated_inputs form builder method
1 parent e4d934f commit 1bffdb9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/active_admin/globalize/form_builder_extension.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@ def translated_inputs(name = "Translations", options = {}, &block)
88
available_locales = options.fetch(:available_locales, I18n.available_locales.sort)
99
switch_locale = options.fetch(:switch_locale, false)
1010
auto_sort = options.fetch(:auto_sort, true)
11+
default_locale = options.fetch(:default_locale, I18n.default_locale)
1112
template.content_tag(:div, class: "activeadmin-translations") do
1213
template.content_tag(:ul, class: "available-locales") do
1314
(auto_sort ? available_locales.sort : available_locales).map do |locale|
14-
default = 'default' if locale == I18n.default_locale
15+
default = 'default' if locale == default_locale
1516
template.content_tag(:li) do
1617
I18n.with_locale(switch_locale ? locale : I18n.locale) do
1718
template.content_tag(:a, I18n.t(:"active_admin.globalize.language.#{locale}"), href:".locale-#{locale}", :class => default)

0 commit comments

Comments
 (0)