Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ source "http://rubygems.org"
gem "rails", "3.2.7"
gem 'i18n', '0.6.11'
gem 'yajl-ruby', require: 'yajl/json_gem'
gem "mongo", "1.1"
gem "bson_ext", ">=1.0.5"
gem "redis"

if RUBY_VERSION < '1.9'
Expand Down
78 changes: 38 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ GEM
activesupport (3.2.7)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bson (1.2.4)
bson_ext (1.2.4)
builder (3.0.3)
arel (3.0.3)
builder (3.0.4)
capybara (1.1.2)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
Expand All @@ -42,34 +40,34 @@ GEM
cgi_multipart_eof_fix (2.5.0)
childprocess (0.5.3)
ffi (~> 1.0, >= 1.0.11)
coderay (1.0.8)
coderay (1.1.0)
diff-lcs (1.1.3)
erubis (2.7.0)
fastthread (1.0.7)
ffi (1.9.3)
hike (1.2.1)
hike (1.2.3)
i18n (0.6.11)
journey (1.0.4)
json (1.7.5)
json (1.8.1)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.8)
mime-types (1.19)
mongo (1.1)
bson (>= 1.0.5)
method_source (0.8.2)
mime-types (1.25.1)
mini_portile (0.6.0)
multi_json (1.10.1)
nokogiri (1.5.5)
polyglot (0.3.3)
pry (0.9.10)
coderay (~> 1.0.5)
method_source (~> 0.8)
slop (~> 3.3.1)
rack (1.4.1)
nokogiri (1.6.3.1)
mini_portile (= 0.6.0)
polyglot (0.3.5)
pry (0.10.1)
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
Expand All @@ -88,57 +86,57 @@ GEM
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (0.9.2.2)
rdoc (3.12)
rake (10.3.2)
rdoc (3.12.2)
json (~> 1.4)
redis (2.1.1)
rspec (2.11.0)
rspec-core (~> 2.11.0)
rspec-expectations (~> 2.11.0)
rspec-mocks (~> 2.11.0)
rspec-core (2.11.1)
rspec-expectations (2.11.3)
diff-lcs (~> 1.1.3)
rspec-mocks (2.11.3)
rspec-rails (2.11.0)
redis (3.1.0)
rspec-collection_matchers (1.0.0)
rspec-expectations (>= 2.99.0.beta1)
rspec-core (2.99.2)
rspec-expectations (2.99.2)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.99.2)
rspec-rails (2.99.0)
actionpack (>= 3.0)
activemodel (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.11.0)
rspec-collection_matchers
rspec-core (~> 2.99.0)
rspec-expectations (~> 2.99.0)
rspec-mocks (~> 2.99.0)
rubyzip (1.1.6)
selenium-webdriver (2.42.0)
childprocess (>= 0.5.0)
multi_json (~> 1.0)
rubyzip (~> 1.0)
websocket (~> 1.0.4)
slop (3.3.3)
slop (3.6.0)
sprockets (2.1.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.16.0)
tilt (1.3.3)
thor (0.19.1)
tilt (1.4.1)
timecop (0.3.5)
treetop (1.4.11)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.33)
tzinfo (0.3.41)
websocket (1.0.7)
xpath (0.1.4)
nokogiri (~> 1.3)
yajl-ruby (1.1.0)
yajl-ruby (1.2.1)

PLATFORMS
ruby

DEPENDENCIES
bson_ext (>= 1.0.5)
capybara (= 1.1.2)
cgi_multipart_eof_fix
diff-lcs (= 1.1.3)
fastthread
i18n (= 0.6.11)
mongo (= 1.1)
pry
rails (= 3.2.7)
redis
Expand Down
24 changes: 5 additions & 19 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@

== Installation

=== For MongoDB:
=== For Redis:

Create Gemfile and run "bundle":

gem 'mongo'
gem 'bson_ext'
gem 'redis'
gem 'translator', :git => "git://github.com/amberbit/translator.git"

Create initializer, for example config/initializers/translator.rb:
conn = Mongo::Connection.new.db("translator_test").collection("translations")
Translator.current_store = Translator::MongoStore.new(conn)

Translator.current_store = Translator::RedisStore.new(Redis.new)
I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new)


In Rails > 3.1 you should mount the translator Engine in config/routes.rb:
mount Translator::Engine, :to => '/admin' # will provide a /admin/translations path

Expand All @@ -24,18 +24,6 @@ You might also need to override default yaml parser by adding the line to Gemfil
There also appear to be problems with i18n v0.6.1 (truncated translations), so you might need to force v0.6.0:
gem 'i18n', '0.6.0'

=== For Redis:

Create Gemfile and run "bundle":

gem 'redis'
gem 'translator', :git => "git://github.com/amberbit/translator.git"

Create initializer, for example config/initializers/translator.rb:

Translator.current_store = Translator::RedisStore.new(Redis.new)
I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new)

== Usage

Remember to restart your server after running 'bundle' command. Translations engine is available under http://localhost:3000/translations and there is *no authorization* by default.
Expand Down Expand Up @@ -105,8 +93,6 @@ As a developer, I want to override list of 'Framework Translations' with a custo

As a user, I want to revert to default translation, loaded from YAML file, by clicking on 'Default' link.

Ad a user, I want to choose between Redis and MongoDB for translations storage.

== Future features:

As a user, I want to have all strings I enter validated, based on values from *.yml files, so I cannot break the app with malformed translations (ie. with wrong number of parameters).
Expand Down
43 changes: 0 additions & 43 deletions app/backends/translator/mongo_store.rb

This file was deleted.

21 changes: 0 additions & 21 deletions spec/acceptance/mongodb_spec.rb

This file was deleted.

2 changes: 0 additions & 2 deletions spec/dummy/config/initializers/translator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
if Rails.env.development?
conn = Mongo::Connection.new.db("translator_test").collection("translations")
# Translator.current_store = Translator::MongoStore.new(conn)
Translator.current_store = Translator::RedisStore.new(Redis.new)

I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new)
Expand Down
22 changes: 0 additions & 22 deletions spec/unit/mongo_store_spec.rb

This file was deleted.

4 changes: 2 additions & 2 deletions spec/unit/translator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

describe Translator do
before :all do
conn = Mongo::Connection.new.db("translator_test").collection("translations")
Translator.current_store = Translator::MongoStore.new(conn)
@store = Translator::RedisStore.new(Redis.new)
Translator.current_store = @store
I18n.backend = Translator.setup_backend(I18n::Backend::Simple.new)
end

Expand Down