mongo-i18n 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README.rdoc +22 -4
- data/lib/mongo-i18n/version.rb +1 -1
- metadata +4 -4
data/README.rdoc
CHANGED
@@ -8,13 +8,31 @@ MongoDB backend implementation for I18n gem.
|
|
8
8
|
* I18n 0.5.0
|
9
9
|
* Rails 3.0.3
|
10
10
|
|
11
|
+
== Installation
|
12
|
+
|
13
|
+
From command line:
|
14
|
+
|
15
|
+
gem install mongo-i18n
|
16
|
+
|
17
|
+
At rails' 3 gemfile:
|
18
|
+
|
19
|
+
gem 'mongo-i18n'
|
20
|
+
|
11
21
|
== Usage with Rails 3
|
12
22
|
|
13
|
-
|
14
|
-
|
23
|
+
I recommend to start with Chain[https://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/chain.rb] backend while mongodb collection is empty, and move to entirely mongodb-based backend when you populate your database with all I18n messages.
|
24
|
+
|
25
|
+
Begin with:
|
26
|
+
|
27
|
+
collection = Mongo::Connection.new['my_app_related_db'].collection('i18n')
|
28
|
+
I18n.backend = I18n::Backend::Chain.new(I18n::Backend::KeyValue.new(MongoI18n::Store.new(collection)), I18n.backend)
|
29
|
+
|
30
|
+
And finish with:
|
31
|
+
|
32
|
+
collection = Mongo::Connection.new['my_app_related_db'].collection('i18n')
|
33
|
+
I18n.backend = I18n::Backend::KeyValue.new(MongoI18n::Store.new(collection)
|
15
34
|
|
16
|
-
|
17
|
-
Like this (assume that MongoMapper version is 0.8.6 and it is already initialized):
|
35
|
+
If you are already using a mongodb ORM in your project (and I suppose you are, why else would you be reading this article? :), I recommend using the existing database connection:
|
18
36
|
|
19
37
|
collection = MongoMapper.database.collection('i18n')
|
20
38
|
I18n.backend = I18n::Backend::KeyValue.new(MongoI18n::Store.new(collection))
|
data/lib/mongo-i18n/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongo-i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Alexander Ulizko
|
@@ -50,7 +50,7 @@ dependencies:
|
|
50
50
|
version: 2.3.0
|
51
51
|
type: :development
|
52
52
|
version_requirements: *id002
|
53
|
-
description:
|
53
|
+
description: MongoDB backend implementation for I18n gem.
|
54
54
|
email:
|
55
55
|
- alexander@ulizko.com
|
56
56
|
executables: []
|