Skip to content

Commit

Permalink
[ST-1144] Updated default config and documentation (#190)
Browse files Browse the repository at this point in the history
* Updated default config and documentation

* Fixed tests.

* bumped patch version
  • Loading branch information
zeyuwu authored Oct 22, 2021
1 parent dde0484 commit 684c6f6
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ Insert the following into either config/application.rb or config/environments/.

config.wovnrb = {
:project_token => 'EnS!t3',
:default_lang => 'en',
:supported_langs => ['en'],
:default_lang => 'ja',
:supported_langs => ['ja', en'],
:url_pattern => 'path'
}
Expand All @@ -60,8 +60,8 @@ require 'wovnrb'
use Wovnrb::Interceptor, {
:project_token => 'EnS!t3',
:default_lang => 'en',
:supported_langs => ['en'],
:default_lang => 'ja',
:supported_langs => ['ja', 'en'],
:url_pattern => 'path'
}
Expand All @@ -77,8 +77,8 @@ The following is a list of the WOVN.io Ruby Library's valid parameters.
Parameter Name | Required | Default Setting
----------------------| -------- | ----------------
project_token | yes | ''
default_lang | yes | 'en'
supported_langs | yes | ['en']
default_lang | yes | 'ja'
supported_langs | yes | ['ja', 'en']
url_pattern | yes | 'path'
lang_param_name | | 'wovn'
query | | []
Expand Down
12 changes: 6 additions & 6 deletions README.ja.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ bundle install

config.wovnrb = {
:project_token => 'EnS!t3',
:default_lang => 'en',
:supported_langs => ['en'],
:default_lang => 'ja',
:supported_langs => ['ja', en'],
:url_pattern => 'path'
}
Expand All @@ -63,8 +63,8 @@ require 'wovnrb'
use Wovnrb::Interceptor, {
:project_token => 'EnS!t3',
:default_lang => 'en',
:supported_langs => ['en'],
:default_lang => 'ja',
:supported_langs => ['ja', 'en'],
:url_pattern => 'path'
}
Expand All @@ -80,8 +80,8 @@ use Wovnrb::Interceptor, {
パラメータ名 | 必須 | デフォルト設定
------------------ | -------- | ----------------
project_token | yes | ''
default_lang | yes | 'en'
supported_langs | yes | ['en']
default_lang | yes | 'ja'
supported_langs | yes | ['ja', 'en']
url_pattern | yes | 'path'
lang_param_name | | 'wovn'
query | | []
Expand Down
4 changes: 2 additions & 2 deletions lib/wovnrb/store.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ def self.default_settings
'ignore_class' => [],
'api_url' => 'https://wovn.global.ssl.fastly.net',
'api_timeout_seconds' => 1.0,
'default_lang' => 'en',
'supported_langs' => ['en'],
'default_lang' => 'ja',
'supported_langs' => %w[en ja],
'test_mode' => false,
'test_url' => '',
'cache_megabytes' => nil,
Expand Down
2 changes: 1 addition & 1 deletion lib/wovnrb/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Wovnrb
VERSION = '3.3.0'.freeze
VERSION = '3.3.1'.freeze
end
4 changes: 2 additions & 2 deletions test/lib/headers_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_redirect_location_without_lang_param_name
Wovnrb.get_env('url' => 'http://wovn.io/contact', 'HTTP_X_FORWARDED_HOST' => 'wovn.io'),
Store.instance.settings
)
assert_equal('http://wovn.io/contact?wovn=ja', sut.redirect_location('ja'))
assert_equal('http://wovn.io/contact?wovn=en', sut.redirect_location('en'))
end

def test_redirect_location_with_lang_param_name
Expand All @@ -179,7 +179,7 @@ def test_redirect_location_with_lang_param_name
Wovnrb.get_env('url' => 'http://wovn.io/contact', 'HTTP_X_FORWARDED_HOST' => 'wovn.io'),
Store.instance.settings
)
assert_equal('http://wovn.io/contact?lang=ja', sut.redirect_location('ja'))
assert_equal('http://wovn.io/contact?lang=en', sut.redirect_location('en'))
end

#########################
Expand Down

0 comments on commit 684c6f6

Please sign in to comment.