Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions app/helpers/filepicker_rails/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
1 change: 1 addition & 0 deletions app/helpers/filepicker_rails/form_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
2 changes: 1 addition & 1 deletion lib/filepicker_rails/tag.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions spec/support/shared_examples_for_filepicker_tags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down