gettext_i18n_rails 0.5.4 → 0.6.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gettext_i18n_rails (0.5.4)
4
+ gettext_i18n_rails (0.6.1)
5
5
  fast_gettext
6
6
 
7
7
  GEM
@@ -41,7 +41,7 @@ GEM
41
41
  builder (3.0.0)
42
42
  diff-lcs (1.1.2)
43
43
  erubis (2.7.0)
44
- fast_gettext (0.5.13)
44
+ fast_gettext (0.6.7)
45
45
  gettext (2.1.0)
46
46
  locale (>= 2.0.5)
47
47
  haml (3.1.4)
@@ -3,7 +3,7 @@ I18n::Config # autoload
3
3
  module I18n
4
4
  class Config
5
5
  def locale
6
- FastGettext.locale.to_sym
6
+ FastGettext.locale.gsub("_","-").to_sym
7
7
  end
8
8
 
9
9
  def locale=(new_locale)
@@ -36,6 +36,7 @@ module GettextI18nRails
36
36
  found = ActiveSupport::OrderedHash.new([])
37
37
 
38
38
  models.each do |model|
39
+ next if model.abstract_class
39
40
  table_name = model.table_name
40
41
  next if ignored?(table_name,options[:ignore_tables])
41
42
  model.columns.each do |column|
@@ -1,3 +1,3 @@
1
1
  module GettextI18nRails
2
- Version = VERSION = '0.5.4'
2
+ Version = VERSION = '0.6.1'
3
3
  end
@@ -80,5 +80,12 @@ describe GettextI18nRails do
80
80
  FastGettext.locale.should == 'de'
81
81
  I18n.locale.should == :de
82
82
  end
83
+
84
+ it "converts gettext to i18n style for nested locales" do
85
+ FastGettext.available_locales = ['de_CH']
86
+ I18n.locale = :"de-CH"
87
+ FastGettext.locale.should == 'de_CH'
88
+ I18n.locale.should == :"de-CH"
89
+ end
83
90
  end
84
- end
91
+ end
data/spec/spec_helper.rb CHANGED
@@ -72,4 +72,8 @@ class NotConventional < ActiveRecord::Base
72
72
  set_table_name :not_at_all_conventionals
73
73
  end
74
74
 
75
+ class Idea < ActiveRecord::Base
76
+ self.abstract_class = true
77
+ end
78
+
75
79
  ActiveRecord::Base.extend GettextI18nRails::ActiveRecord
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gettext_i18n_rails
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 5
9
- - 4
10
- version: 0.5.4
8
+ - 6
9
+ - 1
10
+ version: 0.6.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Grosser
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-24 00:00:00 Z
18
+ date: 2012-06-03 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: fast_gettext