Skip to content

Commit

Permalink
locale won't find by symbolic key
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Hoffman committed Feb 18, 2010
1 parent e1583c0 commit 4d2cabd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/i18n_util.rb
Expand Up @@ -9,7 +9,9 @@ def self.load_from_file(file_name)
end

data.each do |code, translations|
locale = Locale.find_or_create_by_code(code)
locale = Locale.find_or_create_by_code(code.to_s)
locale.save!

backend = I18n::Backend::Simple.new
keys = extract_i18n_keys(translations)
keys.each do |key|
Expand Down
1 change: 1 addition & 0 deletions lib/models/translation.rb
Expand Up @@ -3,6 +3,7 @@
class Translation < ActiveRecord::Base
belongs_to :locale
validates_presence_of :key
validates_presence_of :locale_id
before_validation_on_create :generate_hash_key
after_update :update_cache

Expand Down

0 comments on commit 4d2cabd

Please sign in to comment.