diff --git a/CHANGELOG.md b/CHANGELOG.md index 11eb6c9..bec9b70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## unreleased + +- Support for + [`language`](https://www.filepicker.com/docs/file-ingestion/javascript-api/language?v=v2) + dialog option. + ## 2.1.0 (October, 07, 2015) - Support for diff --git a/app/helpers/filepicker_rails/application_helper.rb b/app/helpers/filepicker_rails/application_helper.rb index ea521d5..41fad63 100644 --- a/app/helpers/filepicker_rails/application_helper.rb +++ b/app/helpers/filepicker_rails/application_helper.rb @@ -37,6 +37,7 @@ def filepicker_js_include_tag # - `:open_to` - Open the picker to the given service. Ex: `COMPUTER`. # - `:class` - Add a class to the input. # - `:value` - Define the value of the input + # - `:language` - Open the picker to the given language. Ex: `fr`. # # #### Examples # diff --git a/app/helpers/filepicker_rails/form_helper.rb b/app/helpers/filepicker_rails/form_helper.rb index b47372c..c73210a 100644 --- a/app/helpers/filepicker_rails/form_helper.rb +++ b/app/helpers/filepicker_rails/form_helper.rb @@ -27,6 +27,7 @@ module FormHelper # - `:open_to` - Open the picker to the given service. Ex: `COMPUTER`. # - `:class` - Add a class to the input. # - `:value` - Define the value of the input + # - `:language` - Open the picker to the given language. Ex: `fr`. # # #### Examples # diff --git a/lib/filepicker_rails/tag.rb b/lib/filepicker_rails/tag.rb index c6f88cc..04f4f31 100644 --- a/lib/filepicker_rails/tag.rb +++ b/lib/filepicker_rails/tag.rb @@ -8,7 +8,7 @@ module Tag :store_location, :store_access, :store_container, :multiple] - FILEPICKER_OPTIONS_TO_CAMELIZE = [:max_size, :max_files, :open_to] + FILEPICKER_OPTIONS_TO_CAMELIZE = [:max_size, :max_files, :open_to, :language] private diff --git a/spec/support/shared_examples_for_filepicker_tags.rb b/spec/support/shared_examples_for_filepicker_tags.rb index 10a10be..4c9f560 100644 --- a/spec/support/shared_examples_for_filepicker_tags.rb +++ b/spec/support/shared_examples_for_filepicker_tags.rb @@ -150,6 +150,12 @@ expect(filepicker_input_tag).to include(attribute) end + it "have correct input with 'language'" do + args << { language: 'fr' } + attribute = %{data-fp-language="fr"} + expect(filepicker_input_tag).to include(attribute) + end + describe "policy" do before do