localization_generator 1.0.5 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/templates/localization.rb +7 -2
  2. metadata +2 -2
@@ -46,16 +46,21 @@ module <%= class_name %>
46
46
  filename =~ /(([a-z]+_?)+)\.yaml$/
47
47
  hash = YAML::load(File.read(filename))
48
48
  file_charset = hash['file_charset'] || 'ascii'
49
+ lang = $1
49
50
 
50
51
  # convert string keys to symbols
51
52
  symbol_hash = Hash.new
52
53
  Iconv.open(CONFIG[:web_charset], file_charset) do |i|
53
54
  hash.each do |key, value|
54
55
  symbol_hash[key.to_sym] = i.iconv(value)
56
+ if key =~ /^active_record_errors_(.*)/
57
+ ActiveRecord::Errors.default_error_messages[$1.to_sym] =
58
+ symbol_hash[key.to_sym]
59
+ end
55
60
  end
56
61
  end
57
-
58
- LOCALIZED_STRINGS[$1] = symbol_hash
62
+
63
+ LOCALIZED_STRINGS[lang] = symbol_hash
59
64
  end
60
65
  end
61
66
 
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
3
3
  specification_version: 1
4
4
  name: localization_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.5
7
- date: 2005-04-19
6
+ version: 1.0.6
7
+ date: 2005-04-24
8
8
  summary: "[Rails] Localization generator."
9
9
  require_paths:
10
10
  - lib