Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give freedom to set default_locale and available_locales instead of forcing #10

Merged
merged 3 commits into from
Aug 7, 2015

Conversation

raihan2006i
Copy link

@fabn It will be flexible and useful if you allow to set default_locale and available_locales

A usecase: I want to show English translation fields without tab, and want to show other languages within tabs.

    f.inputs do
      Globalize.with_locale(:en) do
        f.input :title
      end
    end
    f.inputs 'Translated fields' do
      f.translated_inputs 'ignored title', default_locale: :'zh-CN', switch_locale: false, available_locales: (I18n.available_locales - ['en']) do |t|
        t.input :title
      end
    end

@@ -5,12 +5,14 @@ module FormBuilderExtension

def translated_inputs(name = "Translations", options = {}, &block)
options.symbolize_keys!
available_locales = options.fetch(:available_locales, I18n.available_locales.sort)
switch_locale = options.fetch(:switch_locale, false)
auto_sort = options.fetch(:auto_sort, true)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you gave user the option to choose locales to show (and implicitly the option to sort them), I'd remove the auto_sort option. Can you do that and write a note in readme?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I will do that

@raihan2006i
Copy link
Author

@fabn auto_sort option removed and notes added for default_locale and available_locales options in README file

fabn added a commit that referenced this pull request Aug 7, 2015
Give freedom to set default_locale and available_locales instead of forcing
@fabn fabn merged commit 7be435c into fabn:develop Aug 7, 2015
@fabn
Copy link
Owner

fabn commented Aug 7, 2015

Thank you.

@raihan2006i
Copy link
Author

You are welcome :)

wongy91 pushed a commit to coingecko/activeadmin-globalize that referenced this pull request Oct 10, 2018
Made jsoneditor.css to scss for asset pipeline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants