whowish_word 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/whowish_word/whowish_word.rb +19 -1
- data/whowish_word.gemspec +1 -1
- metadata +2 -2
@@ -31,10 +31,28 @@ module WhowishWord
|
|
31
31
|
|
32
32
|
I18n::MissingTranslation::Base.class_eval do
|
33
33
|
def html_message
|
34
|
-
key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1
|
34
|
+
key = keys.last.to_s.gsub('_', ' ').gsub(/\b('?[a-z])/) { $1 }
|
35
35
|
key
|
36
36
|
end
|
37
37
|
end
|
38
|
+
|
39
|
+
I18n.class_eval do
|
40
|
+
class << self
|
41
|
+
def interpolate_hash(string, values)
|
42
|
+
string.gsub(I18n::INTERPOLATION_PATTERN) do |match|
|
43
|
+
if match == '%%'
|
44
|
+
'%'
|
45
|
+
else
|
46
|
+
key = ($1 || $2).to_sym
|
47
|
+
value = values.key?(key) ? values[key] : "%{#{key}}" #raise(MissingInterpolationArgument.new(values, string))
|
48
|
+
value = value.call(values) if value.respond_to?(:call)
|
49
|
+
$3 ? sprintf("%#{$3}", value) : value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
38
56
|
end
|
39
57
|
|
40
58
|
extend self
|
data/whowish_word.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: whowish_word
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Inline internationlization for Rails 3.2.*
|
15
15
|
email:
|