public
Description: Store translation strings in the database allowing you to update text without requiring a code deploy.
Clone URL: git://github.com/caring/gibberish_db.git
Include the keys both as strings and symbols.
dustin (author)
Thu Apr 24 13:03:39 -0700 2008
dustin (committer)
Thu Apr 24 13:06:34 -0700 2008
commit  aa337e299d4a14e3747805378bd65db5fdee9cc3
tree    2935e4b50af9794c59818cec1ac9e5a17c2e9da5
parent  e1e2aeb176bb5f729b0bbd994ee4945bede1593f
...
48
49
50
 
51
52
53
...
142
143
144
145
 
146
147
148
...
48
49
50
51
52
53
54
...
143
144
145
 
146
147
148
149
0
@@ -48,6 +48,7 @@ module Gibberish
0
         returning({}) do |rv|
0
           Translation.find(:all, :include => :language).group_by{|l| [l.language_id, l.key]}.each do |p|
0
             rv[p.first] = p.last.last
0
+ rv[[p.first.first, p.first.last.to_sym]] = p.last.last
0
           end
0
         end
0
       end
0
@@ -142,7 +143,7 @@ module Gibberish
0
     end
0
 
0
     def translate(key)
0
- all_translations[[@language.is_a?(Language) ? @language.id : @language, key.to_s]]
0
+ all_translations[[@language.is_a?(Language) ? @language.id : @language, key]]
0
     end
0
     alias_method :[], :translate
0
 

Comments

    No one has commented yet.