lolita-i18n 0.1.4 → 0.1.18
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +4 -4
- data/.rspec +1 -1
- data/Gemfile +24 -24
- data/History.rdoc +7 -0
- data/LICENSE.txt +20 -20
- data/README.md +26 -26
- data/Rakefile +46 -46
- data/VERSION +1 -1
- data/app/controllers/lolita/i18n_controller.rb +42 -38
- data/app/helpers/lolita/i18n_helper.rb +24 -24
- data/app/views/lolita/i18n/index.html.haml +35 -33
- data/config/locales/en.yml +5 -0
- data/config/locales/lv.yml +5 -0
- data/config/routes.rb +10 -10
- data/lib/lolita-i18n/backend.rb +76 -76
- data/lib/lolita-i18n/google_translate.rb +6 -6
- data/lib/lolita-i18n/rails.rb +7 -6
- data/lib/lolita-i18n.rb +116 -81
- data/lolita-i18n.gemspec +12 -12
- data/{app/assets → public}/images/lolita/i18n/google_translate_icon.png +0 -0
- data/{app/assets → public}/javascripts/lolita/i18n/application.js +0 -0
- data/public/javascripts/lolita/i18n/i18n.js +169 -0
- data/{app/assets → public}/javascripts/lolita/i18n/spin.min.js +0 -0
- data/{app/assets/stylesheets/lolita/i18n/application.scss → public/stylesheets/lolita/i18n/application.css} +1 -1
- data/spec/controllers/lolita/i18n_controller_spec.rb +38 -38
- data/spec/lolita-i18n/backend_spec.rb +27 -27
- data/spec/rails_app/app/controllers/application_controller.rb +2 -2
- data/spec/rails_app/config/application.rb +18 -18
- data/spec/rails_app/config/enviroment.rb +4 -4
- data/spec/rails_app/config/initializers/lolita_i18n.rb +16 -15
- data/spec/rails_app/config/locales/en.yml +8 -8
- data/spec/rails_app/config/routes.rb +2 -2
- data/spec/spec_helper.rb +34 -32
- metadata +29 -32
- data/Gemfile.lock +0 -161
- data/app/assets/javascripts/lolita/i18n/i18n.js.coffee +0 -135
@@ -1,15 +1,16 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
#
|
4
|
-
#
|
5
|
-
# config.
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
|
15
|
-
|
1
|
+
|
2
|
+
Lolita.setup do |config|
|
3
|
+
# ==> User and authentication configuration
|
4
|
+
# Add one or more of your user classes to Lolita
|
5
|
+
# config.user_classes << MyUser
|
6
|
+
# config.authentication = :authenticate_user!
|
7
|
+
|
8
|
+
# Define authentication for Lolita controllers.
|
9
|
+
# Call some of your own methods
|
10
|
+
# config.authentication=:is_admin?
|
11
|
+
# Or use some customized logic
|
12
|
+
# config.authentication={
|
13
|
+
# current_user.is_a?(Admin) || current_user.has_role?(:admin)
|
14
|
+
# }
|
15
|
+
config.i18n.store = {:db => 11}
|
16
|
+
end
|
@@ -1,9 +1,9 @@
|
|
1
|
-
en:
|
2
|
-
"Page title": "Page title"
|
3
|
-
posts:
|
4
|
-
"Title": Posts
|
5
|
-
"Description": "Posts description"
|
6
|
-
comments:
|
7
|
-
"Title": Comments
|
8
|
-
"Description": "Comment description"
|
1
|
+
en:
|
2
|
+
"Page title": "Page title"
|
3
|
+
posts:
|
4
|
+
"Title": Posts
|
5
|
+
"Description": "Posts description"
|
6
|
+
comments:
|
7
|
+
"Title": Comments
|
8
|
+
"Description": "Comment description"
|
9
9
|
"Footer": "Footer text"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
Test::Application.routes.draw do
|
2
|
-
|
1
|
+
Test::Application.routes.draw do
|
2
|
+
|
3
3
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -1,33 +1,35 @@
|
|
1
|
-
require 'rubygems'
|
2
|
-
require 'bundler'
|
3
|
-
begin
|
4
|
-
Bundler.setup(:default, :test)
|
5
|
-
rescue Bundler::BundlerError => e
|
6
|
-
$stderr.puts e.message
|
7
|
-
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
-
exit e.status_code
|
9
|
-
end
|
10
|
-
|
11
|
-
require 'rails'
|
12
|
-
require 'lolita'
|
13
|
-
require '
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
#
|
19
|
-
|
20
|
-
#
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
1
|
+
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
begin
|
4
|
+
Bundler.setup(:default, :test)
|
5
|
+
rescue Bundler::BundlerError => e
|
6
|
+
$stderr.puts e.message
|
7
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
8
|
+
exit e.status_code
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'rails'
|
12
|
+
require 'lolita'
|
13
|
+
require File.expand_path('lib/lolita-i18n')
|
14
|
+
require 'webmock/rspec'
|
15
|
+
require 'ruby-debug'
|
16
|
+
|
17
|
+
if defined?(USE_RAILS)
|
18
|
+
# require 'mongoid'
|
19
|
+
|
20
|
+
# Mongoid.configure do |config|
|
21
|
+
# config.master = Mongo::Connection.new('127.0.0.1', 27017).db("lolita-i18n-test")
|
22
|
+
# end
|
23
|
+
|
24
|
+
require File.expand_path("../rails_app/config/enviroment.rb",__FILE__)
|
25
|
+
require "rspec/rails"
|
26
|
+
end
|
27
|
+
|
28
|
+
|
29
|
+
|
30
|
+
RSpec.configure do |config|
|
31
|
+
config.mock_with :rspec
|
32
|
+
config.before(:each) do
|
33
|
+
Lolita.i18n.store.flushdb
|
34
|
+
end
|
33
35
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lolita-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.18
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -11,22 +11,22 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2011-
|
14
|
+
date: 2011-12-09 00:00:00.000000000Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: lolita
|
18
|
-
requirement: &
|
18
|
+
requirement: &19266740 !ruby/object:Gem::Requirement
|
19
19
|
none: false
|
20
20
|
requirements:
|
21
|
-
- -
|
21
|
+
- - =
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 3.
|
23
|
+
version: 3.1.18
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
|
-
version_requirements: *
|
26
|
+
version_requirements: *19266740
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: hiredis
|
29
|
-
requirement: &
|
29
|
+
requirement: &19258960 !ruby/object:Gem::Requirement
|
30
30
|
none: false
|
31
31
|
requirements:
|
32
32
|
- - ~>
|
@@ -34,10 +34,10 @@ dependencies:
|
|
34
34
|
version: 0.3.1
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
|
-
version_requirements: *
|
37
|
+
version_requirements: *19258960
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: redis
|
40
|
-
requirement: &
|
40
|
+
requirement: &19257140 !ruby/object:Gem::Requirement
|
41
41
|
none: false
|
42
42
|
requirements:
|
43
43
|
- - ~>
|
@@ -45,10 +45,10 @@ dependencies:
|
|
45
45
|
version: 2.2.2
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
|
-
version_requirements: *
|
48
|
+
version_requirements: *19257140
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: yajl-ruby
|
51
|
-
requirement: &
|
51
|
+
requirement: &19255580 !ruby/object:Gem::Requirement
|
52
52
|
none: false
|
53
53
|
requirements:
|
54
54
|
- - ~>
|
@@ -56,10 +56,10 @@ dependencies:
|
|
56
56
|
version: 1.0.0
|
57
57
|
type: :runtime
|
58
58
|
prerelease: false
|
59
|
-
version_requirements: *
|
59
|
+
version_requirements: *19255580
|
60
60
|
- !ruby/object:Gem::Dependency
|
61
61
|
name: easy_translate
|
62
|
-
requirement: &
|
62
|
+
requirement: &19253800 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ~>
|
@@ -67,10 +67,10 @@ dependencies:
|
|
67
67
|
version: 0.2.1
|
68
68
|
type: :runtime
|
69
69
|
prerelease: false
|
70
|
-
version_requirements: *
|
70
|
+
version_requirements: *19253800
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: shoulda
|
73
|
-
requirement: &
|
73
|
+
requirement: &19252340 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
75
75
|
requirements:
|
76
76
|
- - ! '>='
|
@@ -78,10 +78,10 @@ dependencies:
|
|
78
78
|
version: '0'
|
79
79
|
type: :development
|
80
80
|
prerelease: false
|
81
|
-
version_requirements: *
|
81
|
+
version_requirements: *19252340
|
82
82
|
- !ruby/object:Gem::Dependency
|
83
83
|
name: bundler
|
84
|
-
requirement: &
|
84
|
+
requirement: &19214100 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
86
86
|
requirements:
|
87
87
|
- - ~>
|
@@ -89,10 +89,10 @@ dependencies:
|
|
89
89
|
version: 1.0.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
|
-
version_requirements: *
|
92
|
+
version_requirements: *19214100
|
93
93
|
- !ruby/object:Gem::Dependency
|
94
94
|
name: jeweler
|
95
|
-
requirement: &
|
95
|
+
requirement: &19184600 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
97
97
|
requirements:
|
98
98
|
- - ~>
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
version: 1.5.2
|
101
101
|
type: :development
|
102
102
|
prerelease: false
|
103
|
-
version_requirements: *
|
103
|
+
version_requirements: *19184600
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: rcov
|
106
|
-
requirement: &
|
106
|
+
requirement: &19170920 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
108
108
|
requirements:
|
109
109
|
- - ! '>='
|
@@ -111,7 +111,7 @@ dependencies:
|
|
111
111
|
version: '0'
|
112
112
|
type: :development
|
113
113
|
prerelease: false
|
114
|
-
version_requirements: *
|
114
|
+
version_requirements: *19170920
|
115
115
|
description: Lolita plugin, that enables .yml files management from administrative
|
116
116
|
interface. Also faster access to translations, that DB store
|
117
117
|
email: support@ithouse.lv
|
@@ -124,16 +124,11 @@ files:
|
|
124
124
|
- .document
|
125
125
|
- .rspec
|
126
126
|
- Gemfile
|
127
|
-
-
|
127
|
+
- History.rdoc
|
128
128
|
- LICENSE.txt
|
129
129
|
- README.md
|
130
130
|
- Rakefile
|
131
131
|
- VERSION
|
132
|
-
- app/assets/images/lolita/i18n/google_translate_icon.png
|
133
|
-
- app/assets/javascripts/lolita/i18n/application.js
|
134
|
-
- app/assets/javascripts/lolita/i18n/i18n.js.coffee
|
135
|
-
- app/assets/javascripts/lolita/i18n/spin.min.js
|
136
|
-
- app/assets/stylesheets/lolita/i18n/application.scss
|
137
132
|
- app/controllers/lolita/i18n_controller.rb
|
138
133
|
- app/helpers/lolita/i18n_helper.rb
|
139
134
|
- app/views/lolita/i18n/index.html.haml
|
@@ -146,6 +141,11 @@ files:
|
|
146
141
|
- lib/lolita-i18n/module.rb
|
147
142
|
- lib/lolita-i18n/rails.rb
|
148
143
|
- lolita-i18n.gemspec
|
144
|
+
- public/images/lolita/i18n/google_translate_icon.png
|
145
|
+
- public/javascripts/lolita/i18n/application.js
|
146
|
+
- public/javascripts/lolita/i18n/i18n.js
|
147
|
+
- public/javascripts/lolita/i18n/spin.min.js
|
148
|
+
- public/stylesheets/lolita/i18n/application.css
|
149
149
|
- spec/controllers/lolita/i18n_controller_spec.rb
|
150
150
|
- spec/lolita-i18n/backend_spec.rb
|
151
151
|
- spec/lolita-i18n/google_translate_spec.rb
|
@@ -170,9 +170,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
170
170
|
- - ! '>='
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
|
-
segments:
|
174
|
-
- 0
|
175
|
-
hash: 344396266830941763
|
176
173
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
174
|
none: false
|
178
175
|
requirements:
|
@@ -181,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
178
|
version: '0'
|
182
179
|
requirements: []
|
183
180
|
rubyforge_project:
|
184
|
-
rubygems_version: 1.8.
|
181
|
+
rubygems_version: 1.8.11
|
185
182
|
signing_key:
|
186
183
|
specification_version: 3
|
187
184
|
summary: Lolita plugin, that enables .yml management
|
data/Gemfile.lock
DELETED
@@ -1,161 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
abstract (1.0.0)
|
5
|
-
actionmailer (3.1.1)
|
6
|
-
actionpack (= 3.1.1)
|
7
|
-
mail (~> 2.3.0)
|
8
|
-
actionpack (3.1.1)
|
9
|
-
activemodel (= 3.1.1)
|
10
|
-
activesupport (= 3.1.1)
|
11
|
-
builder (~> 3.0.0)
|
12
|
-
erubis (~> 2.7.0)
|
13
|
-
i18n (~> 0.6)
|
14
|
-
rack (~> 1.3.2)
|
15
|
-
rack-cache (~> 1.1)
|
16
|
-
rack-mount (~> 0.8.2)
|
17
|
-
rack-test (~> 0.6.1)
|
18
|
-
sprockets (~> 2.0.2)
|
19
|
-
activemodel (3.1.1)
|
20
|
-
activesupport (= 3.1.1)
|
21
|
-
builder (~> 3.0.0)
|
22
|
-
i18n (~> 0.6)
|
23
|
-
activerecord (3.1.1)
|
24
|
-
activemodel (= 3.1.1)
|
25
|
-
activesupport (= 3.1.1)
|
26
|
-
arel (~> 2.2.1)
|
27
|
-
tzinfo (~> 0.3.29)
|
28
|
-
activeresource (3.1.1)
|
29
|
-
activemodel (= 3.1.1)
|
30
|
-
activesupport (= 3.1.1)
|
31
|
-
activesupport (3.1.1)
|
32
|
-
multi_json (~> 1.0)
|
33
|
-
addressable (2.2.6)
|
34
|
-
archive-tar-minitar (0.5.2)
|
35
|
-
arel (2.2.1)
|
36
|
-
builder (3.0.0)
|
37
|
-
columnize (0.3.4)
|
38
|
-
crack (0.3.1)
|
39
|
-
diff-lcs (1.1.3)
|
40
|
-
easy_translate (0.2.1)
|
41
|
-
json
|
42
|
-
erubis (2.7.0)
|
43
|
-
git (1.2.5)
|
44
|
-
haml (3.1.3)
|
45
|
-
hike (1.2.1)
|
46
|
-
hiredis (0.3.2)
|
47
|
-
i18n (0.6.0)
|
48
|
-
jeweler (1.5.2)
|
49
|
-
bundler (~> 1.0.0)
|
50
|
-
git (>= 1.2.5)
|
51
|
-
rake
|
52
|
-
jquery-rails (1.0.16)
|
53
|
-
railties (~> 3.0)
|
54
|
-
thor (~> 0.14)
|
55
|
-
json (1.6.1)
|
56
|
-
kaminari (0.12.4)
|
57
|
-
rails (>= 3.0.0)
|
58
|
-
linecache19 (0.5.12)
|
59
|
-
ruby_core_source (>= 0.1.4)
|
60
|
-
lolita (3.2.0.rc.5)
|
61
|
-
abstract
|
62
|
-
builder (~> 3.0)
|
63
|
-
haml (~> 3.1.2)
|
64
|
-
jquery-rails
|
65
|
-
kaminari (~> 0.12.4)
|
66
|
-
rails (~> 3.1.1)
|
67
|
-
tinymce-rails
|
68
|
-
mail (2.3.0)
|
69
|
-
i18n (>= 0.4.0)
|
70
|
-
mime-types (~> 1.16)
|
71
|
-
treetop (~> 1.4.8)
|
72
|
-
mime-types (1.16)
|
73
|
-
multi_json (1.0.3)
|
74
|
-
polyglot (0.3.2)
|
75
|
-
rack (1.3.5)
|
76
|
-
rack-cache (1.1)
|
77
|
-
rack (>= 0.4)
|
78
|
-
rack-mount (0.8.3)
|
79
|
-
rack (>= 1.0.0)
|
80
|
-
rack-ssl (1.3.2)
|
81
|
-
rack
|
82
|
-
rack-test (0.6.1)
|
83
|
-
rack (>= 1.0)
|
84
|
-
rails (3.1.1)
|
85
|
-
actionmailer (= 3.1.1)
|
86
|
-
actionpack (= 3.1.1)
|
87
|
-
activerecord (= 3.1.1)
|
88
|
-
activeresource (= 3.1.1)
|
89
|
-
activesupport (= 3.1.1)
|
90
|
-
bundler (~> 1.0)
|
91
|
-
railties (= 3.1.1)
|
92
|
-
railties (3.1.1)
|
93
|
-
actionpack (= 3.1.1)
|
94
|
-
activesupport (= 3.1.1)
|
95
|
-
rack-ssl (~> 1.3.2)
|
96
|
-
rake (>= 0.8.7)
|
97
|
-
rdoc (~> 3.4)
|
98
|
-
thor (~> 0.14.6)
|
99
|
-
rake (0.9.2)
|
100
|
-
rcov (0.9.11)
|
101
|
-
rdoc (3.11)
|
102
|
-
json (~> 1.4)
|
103
|
-
redis (2.2.2)
|
104
|
-
rspec (2.6.0)
|
105
|
-
rspec-core (~> 2.6.0)
|
106
|
-
rspec-expectations (~> 2.6.0)
|
107
|
-
rspec-mocks (~> 2.6.0)
|
108
|
-
rspec-core (2.6.4)
|
109
|
-
rspec-expectations (2.6.0)
|
110
|
-
diff-lcs (~> 1.1.2)
|
111
|
-
rspec-mocks (2.6.0)
|
112
|
-
rspec-rails (2.6.1)
|
113
|
-
actionpack (~> 3.0)
|
114
|
-
activesupport (~> 3.0)
|
115
|
-
railties (~> 3.0)
|
116
|
-
rspec (~> 2.6.0)
|
117
|
-
ruby-debug-base19 (0.11.25)
|
118
|
-
columnize (>= 0.3.1)
|
119
|
-
linecache19 (>= 0.5.11)
|
120
|
-
ruby_core_source (>= 0.1.4)
|
121
|
-
ruby-debug19 (0.11.6)
|
122
|
-
columnize (>= 0.3.1)
|
123
|
-
linecache19 (>= 0.5.11)
|
124
|
-
ruby-debug-base19 (>= 0.11.19)
|
125
|
-
ruby_core_source (0.1.5)
|
126
|
-
archive-tar-minitar (>= 0.5.2)
|
127
|
-
shoulda (2.11.3)
|
128
|
-
sprockets (2.0.3)
|
129
|
-
hike (~> 1.2)
|
130
|
-
rack (~> 1.0)
|
131
|
-
tilt (~> 1.1, != 1.3.0)
|
132
|
-
thor (0.14.6)
|
133
|
-
tilt (1.3.3)
|
134
|
-
tinymce-rails (3.4.6)
|
135
|
-
railties (~> 3.1.0)
|
136
|
-
treetop (1.4.10)
|
137
|
-
polyglot
|
138
|
-
polyglot (>= 0.3.1)
|
139
|
-
tzinfo (0.3.30)
|
140
|
-
webmock (1.7.7)
|
141
|
-
addressable (~> 2.2, > 2.2.5)
|
142
|
-
crack (>= 0.1.7)
|
143
|
-
yajl-ruby (1.0.0)
|
144
|
-
|
145
|
-
PLATFORMS
|
146
|
-
ruby
|
147
|
-
|
148
|
-
DEPENDENCIES
|
149
|
-
bundler (~> 1.0.0)
|
150
|
-
easy_translate (~> 0.2.1)
|
151
|
-
hiredis (~> 0.3.1)
|
152
|
-
jeweler (~> 1.5.2)
|
153
|
-
lolita (~> 3.2.0.rc.3)
|
154
|
-
rcov
|
155
|
-
redis (~> 2.2.2)
|
156
|
-
rspec (~> 2.6.0)
|
157
|
-
rspec-rails (~> 2.6.0)
|
158
|
-
ruby-debug19
|
159
|
-
shoulda
|
160
|
-
webmock (~> 1.7.6)
|
161
|
-
yajl-ruby (~> 1.0.0)
|