gist: 44309 Download_button fork
public
Public Clone URL: git://gist.github.com/44309.git
globalize1_interface_for_globalize2.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class String
 
   def translate
     I18n.t self, :default => self
   end
 
   def t
     translate
   end
 
   def tn(namespace)
     I18n.t self, :scope => namespace, :default => self
   end
 
   def /(val)
     if sub!('%d', '{{count}}')
       I18n.t self, :count => val, :default => self
     elsif sub!('%s', '{{s}}')
       I18n.t self, :s => val, :default => self
     else
       translate
     end
   end
 
end
 
 

Owner

hchoroomi

Revisions