refinerycms-i18n 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9f3cc913b0e9ae54c7e114a610b2f7ba25c66ce7
4
- data.tar.gz: a99c91f97d16ece099057864ccdfffe125da92f6
3
+ metadata.gz: 23c6b946727499f4fc96f3bc9e047b8d34f11a50
4
+ data.tar.gz: 27a88c795ab764e8b5871630ef8c2b800fbc9f31
5
5
  SHA512:
6
- metadata.gz: 38d9ace175d27ca988b29b2248994f1a986bd6f3a1f3aebf5001c39152bb1c27fcad762fd01bd6279d308ef7489453db7c88792cb7c339cfb2c09448038e2316
7
- data.tar.gz: 3070b164f87a116dc689bd2fe9da46042885b0dc20cff7d6ba175df0817a2c9fcb79b98246c97c6aff9af1c55fa4a8345eb6d5faaed072bab8c0f79edc59c17f
6
+ metadata.gz: a63df0adefec2189c51d4c2c4c1ed43565b2d54eae1d605f8510b9abfc2eab8db8a49ca75dbf54c5a9d6739ffcb513d2091aa7f25120a6295d75270fb9b87d39
7
+ data.tar.gz: bc8d3209229d12cd69752c65b908f4f22ce1160b2feba9dcd94833fa733ba2e78ebd061f19a535e2250a82cb9b9e3c38ed4f307877f03574d4c7a8e7bca3c93c
data/.gitignore CHANGED
@@ -83,4 +83,7 @@ db/schema.rb
83
83
  # END REFINERY CMS DEVELOPMENT =================================================
84
84
 
85
85
  Gemfile.lock
86
- spec/dummy
86
+ spec/dummy
87
+
88
+ # Local Gemfile for developing without sharing dependencies
89
+ .gemfile
@@ -1,12 +1,11 @@
1
1
  language: ruby
2
- before_install:
3
- - 'if [[ "$TRAVIS_RUBY_VERSION" =~ "jruby" ]] ; then gem update --system ; fi'
4
- - gem install bundler
5
- install:
6
- - bundle install --without development
2
+ bundler_args: --without development
3
+ sudo: false
4
+ cache:
5
+ - bundler: true
7
6
  before_script:
8
7
  - "sh -e /etc/init.d/xvfb start"
9
- - "bundle exec rake refinery:testing:dummy_app > /dev/null"
8
+ - "bundle exec rake refinery:testing:dummy_app"
10
9
  script:
11
10
  - "DISPLAY=:99.0 bundle exec rspec spec"
12
11
  notifications:
@@ -21,15 +20,12 @@ notifications:
21
20
  on_failure: always
22
21
  rooms:
23
22
  - secure: "JaX+Ckvdd2wqL2bD6t8PHvMDBHxWBlCrkBKPcDKxV0t0DOwzzzwxMryVqcRi\nPsmM/zvmWFATDyRmivhNOpu4lRg9RytSroxZ9nkmbLDqjCyEAZ6tv4yZXME/\nPaxPwmfwgS9g8TKjj3lSWS7rEpqqg0D5S0XIfIHrj6KB6LUmFHc="
23
+ webhooks:
24
+ - https://webhooks.gitter.im/e/b5d48907cdc89864b874
24
25
  env:
25
26
  - DB=postgresql
26
27
  - DB=mysql
27
- matrix:
28
- allow_failures:
29
- - rvm: rbx-19mode
30
- - rvm: jruby-19mode
31
28
  rvm:
29
+ - 2.2
30
+ - 2.1
32
31
  - 2.0.0
33
- - 1.9.3
34
- - rbx-19mode
35
- - jruby-19mode
data/Gemfile CHANGED
@@ -1,73 +1,44 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
2
 
3
3
  gemspec
4
4
 
5
- git 'git://github.com/refinery/refinerycms.git', :branch => 'master' do
6
- gem 'refinerycms'
5
+ git "https://github.com/refinery/refinerycms", branch: "master" do
6
+ gem "refinerycms"
7
7
 
8
- group :development, :test do
9
- gem 'refinerycms-testing'
8
+ group :test do
9
+ gem "refinerycms-testing"
10
10
  end
11
11
  end
12
12
 
13
- group :development, :test do
14
- require 'rbconfig'
13
+ gem "mime-types", "~> 1.25.1"
15
14
 
16
- # Database Configuration
17
- unless ENV['TRAVIS']
18
- gem 'activerecord-jdbcsqlite3-adapter', :platform => :jruby
19
- gem 'sqlite3', :platform => :ruby
20
- end
21
-
22
- if !ENV['TRAVIS'] || ENV['DB'] == 'mysql'
23
- gem 'activerecord-jdbcmysql-adapter', :platform => :jruby
24
- gem 'jdbc-mysql', '= 5.1.13', :platform => :jruby
25
- gem 'mysql2', :platform => :ruby
26
- end
27
-
28
- if !ENV['TRAVIS'] || ENV['DB'] == 'postgresql'
29
- gem 'activerecord-jdbcpostgresql-adapter', :platform => :jruby
30
- gem 'pg', :platform => :ruby
31
- end
32
-
33
- platforms :mswin, :mingw do
34
- gem 'win32console'
35
- gem 'rb-fchange', '~> 0.0.5'
36
- gem 'rb-notifu', '~> 0.0.4'
37
- end
15
+ # Database Configuration
16
+ unless ENV["TRAVIS"]
17
+ gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby
18
+ gem "sqlite3", :platform => :ruby
19
+ end
38
20
 
39
- platforms :ruby do
40
- unless ENV['TRAVIS']
41
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
42
- gem 'rb-fsevent', '>= 0.3.9'
43
- gem 'growl', '~> 1.0.3'
44
- end
45
- if RbConfig::CONFIG['target_os'] =~ /linux/i
46
- gem 'rb-inotify', '>= 0.5.1'
47
- gem 'libnotify', '~> 0.1.3'
48
- gem 'therubyracer', '~> 0.9.9'
49
- end
50
- end
51
- end
21
+ if !ENV["TRAVIS"] || ENV["DB"] == "mysql"
22
+ gem "activerecord-jdbcmysql-adapter", :platform => :jruby
23
+ gem "jdbc-mysql", "= 5.1.13", :platform => :jruby
24
+ gem "mysql2", :platform => :ruby
25
+ end
52
26
 
53
- platforms :jruby do
54
- unless ENV['TRAVIS']
55
- if RbConfig::CONFIG['target_os'] =~ /darwin/i
56
- gem 'growl', '~> 1.0.3'
57
- end
58
- if RbConfig::CONFIG['target_os'] =~ /linux/i
59
- gem 'rb-inotify', '>= 0.5.1'
60
- gem 'libnotify', '~> 0.1.3'
61
- end
62
- end
63
- end
27
+ if !ENV["TRAVIS"] || ENV["DB"] == "postgresql"
28
+ gem "activerecord-jdbcpostgresql-adapter", :platform => :jruby
29
+ gem "pg", :platform => :ruby
64
30
  end
65
31
 
32
+ gem "jruby-openssl", :platform => :jruby
33
+
66
34
  # Refinery/rails should pull in the proper versions of these
67
35
  group :assets do
68
- gem 'sass-rails'
69
- gem 'coffee-rails'
70
- gem 'uglifier'
36
+ gem "sass-rails"
37
+ gem "coffee-rails"
38
+ gem "uglifier"
71
39
  end
72
40
 
73
- gem 'jquery-rails'
41
+ # Load local gems according to Refinery developer preference.
42
+ if File.exist? local_gemfile = File.expand_path("../.gemfile", __FILE__)
43
+ eval File.read(local_gemfile)
44
+ end
data/Rakefile CHANGED
@@ -13,7 +13,6 @@ if File.exists?(APP_RAKEFILE)
13
13
  end
14
14
 
15
15
  require "refinerycms-testing"
16
- Refinery::Testing::Railtie.load_tasks
17
16
  Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
18
17
 
19
18
  load File.expand_path('../tasks/rspec.rake', __FILE__)
@@ -21,6 +21,7 @@ module Refinery
21
21
  :nb => 'Norsk Bokmål',
22
22
  :sl => 'Slovenian',
23
23
  :es => 'Español',
24
+ :ca => 'Català',
24
25
  :it => 'Italiano',
25
26
  :de => 'Deutsch',
26
27
  :lv => 'Latviski',
@@ -16,7 +16,7 @@ module Refinery
16
16
 
17
17
  def self.frontend_locales
18
18
  config.frontend_locales.select do |locale|
19
- config.locales.keys.include?(locale)
19
+ config.locales.keys.map(&:to_s).include?(locale.to_s)
20
20
  end
21
21
  end
22
22
  end
@@ -28,13 +28,13 @@ module Refinery
28
28
 
29
29
  if ::Refinery::I18n.has_locale?(locale = params[:locale].try(:to_sym))
30
30
  ::I18n.locale = locale
31
- elsif locale.present? and locale != ::Refinery::I18n.default_frontend_locale
31
+ elsif locale.present? && locale != ::Refinery::I18n.default_frontend_locale
32
32
  params[:locale] = ::I18n.locale = ::Refinery::I18n.default_frontend_locale
33
33
  redirect_to(params, :notice => "The locale '#{locale}' is not supported.") and return
34
34
  else
35
35
  ::I18n.locale = ::Refinery::I18n.default_frontend_locale
36
36
  end
37
- Thread.current[:globalize_locale] = ::I18n.locale
37
+ Globalize.locale = ::I18n.locale
38
38
  end
39
39
 
40
40
  prepend_before_filter :find_or_set_locale
@@ -43,7 +43,7 @@ module Refinery
43
43
 
44
44
  ::Refinery::AdminController.class_eval do
45
45
  def find_or_set_locale
46
- if (params[:set_locale] and ::Refinery::I18n.locales.keys.map(&:to_sym).include?(params[:set_locale].to_sym))
46
+ if (params[:set_locale] && ::Refinery::I18n.locales.keys.map(&:to_sym).include?(params[:set_locale].to_sym))
47
47
  ::Refinery::I18n.current_locale = params[:set_locale].to_sym
48
48
  redirect_back_or_default(refinery.admin_root_path) and return
49
49
  else
@@ -54,13 +54,13 @@ module Refinery
54
54
  def globalize!
55
55
  if ::Refinery::I18n.frontend_locales.any?
56
56
  if params[:switch_locale]
57
- Thread.current[:globalize_locale] = params[:switch_locale].to_sym
57
+ Globalize.locale = params[:switch_locale].to_sym
58
58
  elsif ::I18n.locale != ::Refinery::I18n.default_frontend_locale
59
- Thread.current[:globalize_locale] = ::Refinery::I18n.default_frontend_locale
59
+ Globalize.locale = ::Refinery::I18n.default_frontend_locale
60
60
  end
61
61
  end
62
62
 
63
- Thread.current[:globalize_locale] = ::I18n.locale if Thread.current[:globalize_locale].nil?
63
+ Globalize.locale = ::I18n.locale if Globalize.locale.nil?
64
64
  end
65
65
  # globalize! should be prepended first so that it runs after find_or_set_locale
66
66
  prepend_before_filter :globalize!, :find_or_set_locale
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-i18n}
5
- s.version = %q{2.1.0}
5
+ s.version = %q{3.0.0}
6
6
  s.description = %q{i18n logic extracted from Refinery CMS, for Refinery CMS.}
7
7
  s.summary = %q{i18n logic for Refinery CMS.}
8
8
  s.email = %q{info@refinerycms.com}
@@ -14,6 +14,8 @@ Gem::Specification.new do |s|
14
14
  s.files = `git ls-files`.split("\n")
15
15
  s.test_files = `git ls-files -- spec/*`.split("\n")
16
16
 
17
- s.add_dependency 'routing-filter', '~> 0.3.0'
18
- s.add_dependency 'rails-i18n', '~> 0.7.3'
17
+ s.required_ruby_version = '>= 1.9.3'
18
+
19
+ s.add_dependency 'routing-filter', '>= 0.4.0.dev'
20
+ s.add_dependency 'rails-i18n', '~> 4.0.1'
19
21
  end
@@ -0,0 +1,16 @@
1
+ # encoding: utf-8
2
+ require "spec_helper"
3
+
4
+ describe "set_locale parameter", :type => :feature do
5
+ refinery_login_with :refinery_user
6
+
7
+ it "changes language used in backend" do
8
+ visit refinery.admin_pages_path
9
+
10
+ expect(page).to have_content("Switch to your website")
11
+
12
+ visit refinery.admin_pages_path(:set_locale => :cs)
13
+
14
+ expect(page).to have_content("Přepnout na web")
15
+ end
16
+ end
@@ -13,14 +13,10 @@ Rails.backtrace_cleaner.remove_silencers!
13
13
 
14
14
  RSpec.configure do |config|
15
15
  config.mock_with :rspec
16
- config.treat_symbols_as_metadata_keys_with_true_values = true
17
16
  config.filter_run :focus => true
18
17
  config.run_all_when_everything_filtered = true
19
18
  end
20
19
 
21
- # set javascript driver for capybara
22
- Capybara.javascript_driver = :selenium
23
-
24
20
  # Requires supporting files with custom matchers and macros, etc,
25
21
  # in ./support/ and its subdirectories including factories.
26
22
  ([Rails.root.to_s] | ::Refinery::Plugins.registered.pathnames).map{|p|
@@ -11,7 +11,7 @@ RSpec.configure do |config|
11
11
 
12
12
  config.frontend_locales = [:en]
13
13
 
14
- config.locales = {:en=>"English", :fr=>"Français", :nl=>"Nederlands", :"pt-BR"=>"Português", :da=>"Dansk", :nb=>"Norsk Bokmål", :sl=>"Slovenian", :es=>"Español", :it=>"Italiano", :de=>"Deutsch", :lv=>"Latviski", :ru=>"Русский", :sv=>"Svenska", :pl=>"Polski", :"zh-CN"=>"Simplified Chinese", :"zh-TW"=>"Traditional Chinese", :el=>"Ελληνικά", :rs=>"Srpski", :cs=>"Česky", :sk=>"Slovenský", :ja=>"日本語", :bg=>"Български"}
14
+ config.locales = {:en=>"English", :fr=>"Français", :nl=>"Nederlands", :"pt-BR"=>"Português", :da=>"Dansk", :nb=>"Norsk Bokmål", :sl=>"Slovenian", :es=>"Español", :ca=>"Català", :it=>"Italiano", :de=>"Deutsch", :lv=>"Latviski", :ru=>"Русский", :sv=>"Svenska", :pl=>"Polski", :"zh-CN"=>"Simplified Chinese", :"zh-TW"=>"Traditional Chinese", :el=>"Ελληνικά", :rs=>"Srpski", :cs=>"Česky", :sk=>"Slovenský", :ja=>"日本語", :bg=>"Български"}
15
15
  end
16
16
  end
17
17
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-i18n
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
@@ -9,44 +9,44 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-15 00:00:00.000000000 Z
12
+ date: 2015-01-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: routing-filter
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - ~>
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
- version: 0.3.0
20
+ version: 0.4.0.dev
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - ~>
25
+ - - ">="
26
26
  - !ruby/object:Gem::Version
27
- version: 0.3.0
27
+ version: 0.4.0.dev
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: rails-i18n
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - ~>
32
+ - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.7.3
34
+ version: 4.0.1
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - ~>
39
+ - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.7.3
41
+ version: 4.0.1
42
42
  description: i18n logic extracted from Refinery CMS, for Refinery CMS.
43
43
  email: info@refinerycms.com
44
44
  executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - .gitignore
49
- - .travis.yml
48
+ - ".gitignore"
49
+ - ".travis.yml"
50
50
  - Gemfile
51
51
  - Rakefile
52
52
  - app/assets/images/refinery/icons/flags/ad.png
@@ -84,7 +84,6 @@ files:
84
84
  - app/assets/images/refinery/icons/flags/by.png
85
85
  - app/assets/images/refinery/icons/flags/bz.png
86
86
  - app/assets/images/refinery/icons/flags/ca.png
87
- - app/assets/images/refinery/icons/flags/catalonia.png
88
87
  - app/assets/images/refinery/icons/flags/cc.png
89
88
  - app/assets/images/refinery/icons/flags/cd.png
90
89
  - app/assets/images/refinery/icons/flags/cf.png
@@ -313,7 +312,7 @@ files:
313
312
  - lib/translate/storage.rb
314
313
  - refinerycms-i18n.gemspec
315
314
  - script/rails
316
- - spec/features/dashboard_locale_picker_spec.rb
315
+ - spec/features/set_locale_spec.rb
317
316
  - spec/spec_helper.rb
318
317
  - spec/support/refinery/i18n/set_defaults.rb
319
318
  - tasks/rspec.rake
@@ -328,22 +327,22 @@ require_paths:
328
327
  - lib
329
328
  required_ruby_version: !ruby/object:Gem::Requirement
330
329
  requirements:
331
- - - '>='
330
+ - - ">="
332
331
  - !ruby/object:Gem::Version
333
- version: '0'
332
+ version: 1.9.3
334
333
  required_rubygems_version: !ruby/object:Gem::Requirement
335
334
  requirements:
336
- - - '>='
335
+ - - ">="
337
336
  - !ruby/object:Gem::Version
338
337
  version: '0'
339
338
  requirements: []
340
339
  rubyforge_project:
341
- rubygems_version: 2.0.3
340
+ rubygems_version: 2.4.5
342
341
  signing_key:
343
342
  specification_version: 4
344
343
  summary: i18n logic for Refinery CMS.
345
344
  test_files:
346
- - spec/features/dashboard_locale_picker_spec.rb
345
+ - spec/features/set_locale_spec.rb
347
346
  - spec/spec_helper.rb
348
347
  - spec/support/refinery/i18n/set_defaults.rb
349
348
  has_rdoc:
@@ -1,32 +0,0 @@
1
- # encoding: utf-8
2
- require "spec_helper"
3
-
4
- describe "dashboard locale picker" do
5
- refinery_login_with :refinery_user
6
-
7
- it "changes language used in backend", :js => true do
8
- visit refinery.admin_dashboard_path
9
-
10
- page.should have_content("Switch to your website")
11
-
12
- within "#current_locale" do
13
- click_link "Change language"
14
- end
15
- within "#other_locales" do
16
- click_link "Latviski"
17
- end
18
-
19
- page.should have_content("Pārslēgties uz jūsu saitu")
20
- page.should have_no_content("Switch to your website")
21
-
22
- within "#current_locale" do
23
- click_link "Mainīt valodu"
24
- end
25
- within "#other_locales" do
26
- click_link "English"
27
- end
28
-
29
- page.should have_content("Switch to your website")
30
- page.should have_no_content("Pārslēgties uz jūsu saitu")
31
- end
32
- end