gettext_i18n_rails 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.markdown CHANGED
@@ -133,6 +133,7 @@ Contributors
133
133
  - [ruby gettext extractor](http://github.com/retoo/ruby_gettext_extractor/tree/master) from [retoo](http://github.com/retoo)
134
134
  - [Paul McMahon](http://github.com/pwim)
135
135
  - [Duncan Mac-Vicar P](http://duncan.mac-vicar.com/blog/)
136
+ - [Ramihajamalala Hery](http://my.rails-royce.org/)
136
137
 
137
138
  [Michael Grosser](http://pragmatig.wordpress.com)
138
139
  grosser.michael@gmail.com
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.1
1
+ 0.1.2
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{gettext_i18n_rails}
8
- s.version = "0.1.1"
8
+ s.version = "0.1.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Michael Grosser"]
12
- s.date = %q{2010-05-23}
12
+ s.date = %q{2010-06-01}
13
13
  s.email = %q{grosser.michael@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.markdown"
@@ -6,7 +6,11 @@ class ActiveRecord::Base
6
6
 
7
7
  # CarDealer -> _('car dealer')
8
8
  def self.human_name(*args)
9
- _(self.to_s.underscore.gsub('_',' '))
9
+ _(self.human_name_without_translation)
10
+ end
11
+
12
+ def self.human_name_without_translation
13
+ self.to_s.underscore.gsub('_',' ')
10
14
  end
11
15
 
12
16
  private
@@ -14,4 +18,4 @@ class ActiveRecord::Base
14
18
  def self.gettext_translation_for_attribute_name(attribute)
15
19
  "#{self}|#{attribute.to_s.gsub('_',' ').capitalize}"
16
20
  end
17
- end
21
+ end
@@ -7,7 +7,7 @@ module GettextI18nRails
7
7
  ModelAttributesFinder.new.find(options).each do |table_name,column_names|
8
8
  #model name
9
9
  model = table_name.singularize.camelcase.constantize
10
- f.puts("_('#{model.to_s.underscore.gsub('_',' ')}')") #!Keep in sync with ActiveRecord::Base.human_name
10
+ f.puts("_('#{model.human_name_without_translation}')")
11
11
 
12
12
  #all columns namespaced under the model
13
13
  column_names.each do |attribute|
@@ -43,4 +43,4 @@ module GettextI18nRails
43
43
  patterns.detect{|p|p.to_s==name.to_s or (p.is_a?(Regexp) and name=~p)}
44
44
  end
45
45
  end
46
- end
46
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.1
8
+ - 2
9
+ version: 0.1.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Michael Grosser
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-05-23 00:00:00 +02:00
17
+ date: 2010-06-01 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency