lolita-i18n 0.1.3 → 0.1.4
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/Gemfile.lock +161 -165
- 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 +38 -38
- data/app/helpers/lolita/i18n_helper.rb +24 -24
- data/app/views/lolita/i18n/index.html.haml +33 -33
- data/config/routes.rb +10 -10
- data/lib/lolita-i18n.rb +81 -81
- data/lib/lolita-i18n/backend.rb +76 -68
- data/lib/lolita-i18n/rails.rb +6 -6
- data/lolita-i18n.gemspec +2 -2
- data/spec/controllers/lolita/i18n_controller_spec.rb +38 -38
- data/spec/lolita-i18n/backend_spec.rb +27 -20
- 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 +14 -14
- data/spec/rails_app/config/locales/en.yml +8 -8
- data/spec/rails_app/config/routes.rb +2 -2
- data/spec/spec_helper.rb +32 -32
- metadata +21 -21
data/.document
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
lib/**/*.rb
|
2
|
-
-
|
3
|
-
features/**/*.feature
|
4
|
-
LICENSE.txt
|
1
|
+
lib/**/*.rb
|
2
|
+
-
|
3
|
+
features/**/*.feature
|
4
|
+
LICENSE.txt
|
data/.rspec
CHANGED
@@ -1 +1 @@
|
|
1
|
-
--color
|
1
|
+
--color
|
data/Gemfile
CHANGED
@@ -1,24 +1,24 @@
|
|
1
|
-
source "http://rubygems.org"
|
2
|
-
|
3
|
-
gem "lolita", '~>3.2.0.rc.3'
|
4
|
-
gem "hiredis", "~> 0.3.1"
|
5
|
-
gem "redis", "~> 2.2.2", :require => ["redis/connection/hiredis", "redis"]
|
6
|
-
gem "yajl-ruby", "~> 1.0.0"
|
7
|
-
gem "easy_translate", "~> 0.2.1"
|
8
|
-
|
9
|
-
group :development do
|
10
|
-
gem "shoulda", ">= 0"
|
11
|
-
gem "bundler", "~> 1.0.0"
|
12
|
-
gem "jeweler", "~> 1.5.2"
|
13
|
-
gem "rcov", ">= 0"
|
14
|
-
end
|
15
|
-
|
16
|
-
group :test do
|
17
|
-
gem "rspec","~>2.6.0"
|
18
|
-
gem "rspec-rails", "~>2.6.0"
|
19
|
-
gem "webmock", "~> 1.7.6"
|
20
|
-
# gem "mongo", "~> 1.3.0"
|
21
|
-
# gem "mongoid", "~> 2.0.0"
|
22
|
-
# gem "bson_ext", "~> 1.4.0"
|
23
|
-
gem 'ruby-debug19', :require => 'ruby-debug'
|
24
|
-
end
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
gem "lolita", '~>3.2.0.rc.3'
|
4
|
+
gem "hiredis", "~> 0.3.1"
|
5
|
+
gem "redis", "~> 2.2.2", :require => ["redis/connection/hiredis", "redis"]
|
6
|
+
gem "yajl-ruby", "~> 1.0.0"
|
7
|
+
gem "easy_translate", "~> 0.2.1"
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "shoulda", ">= 0"
|
11
|
+
gem "bundler", "~> 1.0.0"
|
12
|
+
gem "jeweler", "~> 1.5.2"
|
13
|
+
gem "rcov", ">= 0"
|
14
|
+
end
|
15
|
+
|
16
|
+
group :test do
|
17
|
+
gem "rspec","~>2.6.0"
|
18
|
+
gem "rspec-rails", "~>2.6.0"
|
19
|
+
gem "webmock", "~> 1.7.6"
|
20
|
+
# gem "mongo", "~> 1.3.0"
|
21
|
+
# gem "mongoid", "~> 2.0.0"
|
22
|
+
# gem "bson_ext", "~> 1.4.0"
|
23
|
+
gem 'ruby-debug19', :require => 'ruby-debug'
|
24
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,165 +1,161 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
abstract (1.0.0)
|
5
|
-
actionmailer (3.1.
|
6
|
-
actionpack (= 3.1.
|
7
|
-
mail (~> 2.3.0)
|
8
|
-
actionpack (3.1.
|
9
|
-
activemodel (= 3.1.
|
10
|
-
activesupport (= 3.1.
|
11
|
-
builder (~> 3.0.0)
|
12
|
-
erubis (~> 2.7.0)
|
13
|
-
i18n (~> 0.6)
|
14
|
-
rack (~> 1.3.2)
|
15
|
-
rack-cache (~> 1.
|
16
|
-
rack-mount (~> 0.8.2)
|
17
|
-
rack-test (~> 0.6.1)
|
18
|
-
sprockets (~> 2.0.
|
19
|
-
activemodel (3.1.
|
20
|
-
activesupport (= 3.1.
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
rack-
|
81
|
-
rack
|
82
|
-
rack-
|
83
|
-
rack (>= 1.0
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
rspec-
|
112
|
-
rspec-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
ruby-debug19
|
163
|
-
shoulda
|
164
|
-
webmock (~> 1.7.6)
|
165
|
-
yajl-ruby (~> 1.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)
|
data/LICENSE.txt
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright (c) 2011 ITHouse (Latvia) and Arturs Meisters
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright (c) 2011 ITHouse (Latvia) and Arturs Meisters
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,27 +1,27 @@
|
|
1
|
-
# About
|
2
|
-
|
3
|
-
Lolita I18n is Lolita[https://github.com/ithouse/lolita] plugin, that enables .yml file translation from WEB interface.
|
4
|
-
|
5
|
-
## Usage
|
6
|
-
|
7
|
-
* setup rails 3.1 project with ["Lolita"](https://github.com/ithouse/lolita)
|
8
|
-
* setup [Redis DB](http://redis.io) on your server
|
9
|
-
* add `gem 'lolita-i18n'` into Gemfile
|
10
|
-
* add `I18n.backend = Lolita::I18n.load Redis.new(:db => REDIS_DB)` into your `config/initializers/lolita.rb`
|
11
|
-
* add `REDIS_DB = 10` in your production/staging environment file.
|
12
|
-
* open `/lolita/i18n` and start translating
|
13
|
-
|
14
|
-
## Contributing to lolita-i18n
|
15
|
-
|
16
|
-
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
17
|
-
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
18
|
-
* Fork the project
|
19
|
-
* Start a feature/bugfix branch
|
20
|
-
* Commit and push until you are happy with your contribution
|
21
|
-
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
22
|
-
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
23
|
-
|
24
|
-
== Copyright
|
25
|
-
|
26
|
-
Copyright (c) 2011 ITHouse (Latvia). See LICENSE.txt for
|
1
|
+
# About
|
2
|
+
|
3
|
+
Lolita I18n is Lolita[https://github.com/ithouse/lolita] plugin, that enables .yml file translation from WEB interface.
|
4
|
+
|
5
|
+
## Usage
|
6
|
+
|
7
|
+
* setup rails 3.1 project with ["Lolita"](https://github.com/ithouse/lolita)
|
8
|
+
* setup [Redis DB](http://redis.io) on your server
|
9
|
+
* add `gem 'lolita-i18n'` into Gemfile
|
10
|
+
* add `I18n.backend = Lolita::I18n.load Redis.new(:db => REDIS_DB)` into your `config/initializers/lolita.rb`
|
11
|
+
* add `REDIS_DB = 10` in your production/staging environment file.
|
12
|
+
* open `/lolita/i18n` and start translating
|
13
|
+
|
14
|
+
## Contributing to lolita-i18n
|
15
|
+
|
16
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
17
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
18
|
+
* Fork the project
|
19
|
+
* Start a feature/bugfix branch
|
20
|
+
* Commit and push until you are happy with your contribution
|
21
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
22
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
23
|
+
|
24
|
+
== Copyright
|
25
|
+
|
26
|
+
Copyright (c) 2011 ITHouse (Latvia). See LICENSE.txt for
|
27
27
|
further details.
|