Skip to content

Commit

Permalink
restructure and make it work with latest i18n v0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
netskin-ci committed Dec 9, 2010
1 parent 74c8f4f commit b0850a6
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ tmtags
coverage
rdoc
pkg
nbproject

## PROJECT::SPECIFIC
1 change: 1 addition & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ begin
gem.summary = 'I18n backend which uses a Sequel Model'
gem.description = 'I18n backend which allows to store/get the translations from a database using a sequel.'
gem.add_dependency "sequel", ">= 3.0.0"
gem.add_dependency "i18n", ">= 0.5.0"
gem.add_development_dependency "rspec", ">= 1.2.9"
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
end
Expand Down
35 changes: 16 additions & 19 deletions i18n_backend_sequel.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
# -*- encoding: utf-8 -*-

Gem::Specification.new do |s|
Expand All @@ -9,37 +9,31 @@ Gem::Specification.new do |s|

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Corin Langosch"]
s.date = %q{2010-09-21}
s.date = %q{2010-12-09}
s.description = %q{I18n backend which allows to store/get the translations from a database using a sequel.}
s.email = %q{info@netskin.com}
s.extra_rdoc_files = [
"LICENSE",
"README.rdoc"
"README.rdoc"
]
s.files = [
".document",
".gitignore",
"LICENSE",
"README.rdoc",
"Rakefile",
"VERSION",
"i18n_backend_sequel.gemspec",
"lib/i18n_backend_sequel.rb",
"lib/i18n_backend_sequel/missing.rb",
"lib/i18n_backend_sequel/store_procs.rb",
"lib/i18n_backend_sequel/translation.rb",
"spec/i18n_backend_sequel_spec.rb",
"spec/spec.opts",
"spec/spec_helper.rb"
"LICENSE",
"README.rdoc",
"Rakefile",
"VERSION",
"i18n_backend_sequel.gemspec",
"spec/i18n_backend_sequel_spec.rb",
"spec/spec.opts",
"spec/spec_helper.rb"
]
s.homepage = %q{http://github.com/gucki/i18n_backend_sequel}
s.rdoc_options = ["--charset=UTF-8"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.7}
s.summary = %q{I18n backend which uses a Sequel Model}
s.test_files = [
"spec/spec_helper.rb",
"spec/i18n_backend_sequel_spec.rb"
"spec/i18n_backend_sequel_spec.rb",
"spec/spec_helper.rb"
]

if s.respond_to? :specification_version then
Expand All @@ -48,13 +42,16 @@ Gem::Specification.new do |s|

if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<sequel>, [">= 3.0.0"])
s.add_runtime_dependency(%q<i18n>, [">= 0.5.0"])
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
else
s.add_dependency(%q<sequel>, [">= 3.0.0"])
s.add_dependency(%q<i18n>, [">= 0.5.0"])
s.add_dependency(%q<rspec>, [">= 1.2.9"])
end
else
s.add_dependency(%q<sequel>, [">= 3.0.0"])
s.add_dependency(%q<i18n>, [">= 0.5.0"])
s.add_dependency(%q<rspec>, [">= 1.2.9"])
end
end
Expand Down
9 changes: 6 additions & 3 deletions lib/i18n_backend_sequel.rb → lib/i18n/backend/sequel.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
require 'i18n'
require 'i18n/backend/base'

module I18n
module Backend
class Sequel
autoload :Missing, 'i18n_backend_sequel/missing'
autoload :StoreProcs, 'i18n_backend_sequel/store_procs'
autoload :Translation, 'i18n_backend_sequel/translation'
autoload :Missing, 'i18n/backend/sequel/missing'
autoload :StoreProcs, 'i18n/backend/sequel/store_procs'
autoload :Translation, 'i18n/backend/sequel/translation'

module Implementation
include Base, Flatten
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def store_default_translations(locale, key, options = {})
key = normalize_flat_keys(locale, key, scope, separator)

if Sequel::Translation.locale(locale).lookup(key).empty?
interpolations = options.keys - Base::RESERVED_KEYS
interpolations = options.keys - I18n::RESERVED_KEYS
keys = count ? I18n.t('i18n.plural.keys', :locale => locale).map { |k| [key, k].join(FLATTEN_SEPARATOR) } : [key]
keys.each { |key| store_default_translation(locale, key, interpolations) }
end
Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit b0850a6

Please sign in to comment.