fast_gettext 0.6.3 → 0.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/fast_gettext.gemspec +1 -1
- data/lib/fast_gettext/storage.rb +4 -4
- data/lib/fast_gettext/translation.rb +1 -1
- data/lib/fast_gettext/vendor/mofile.rb +0 -1
- data/lib/fast_gettext/vendor/string.rb +1 -1
- data/spec/fast_gettext/vendor/string_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.4
|
data/fast_gettext.gemspec
CHANGED
data/lib/fast_gettext/storage.rb
CHANGED
@@ -12,15 +12,15 @@ module FastGettext
|
|
12
12
|
|
13
13
|
[:available_locales, :_locale, :text_domain, :pluralisation_rule].each do |method_name|
|
14
14
|
key = "fast_gettext_#{method_name}".to_sym
|
15
|
-
define_method method_name do
|
16
|
-
Thread.current[key]
|
17
|
-
end
|
18
|
-
|
19
15
|
define_method "#{method_name}=" do |value|
|
20
16
|
Thread.current[key]=value
|
21
17
|
update_current_cache
|
22
18
|
end
|
23
19
|
end
|
20
|
+
|
21
|
+
def _locale
|
22
|
+
Thread.current[:fast_gettext__locale]
|
23
|
+
end
|
24
24
|
private :_locale, :_locale=
|
25
25
|
|
26
26
|
|
@@ -27,7 +27,7 @@ module FastGettext
|
|
27
27
|
# n_('apple','apples',3)
|
28
28
|
def n_(*keys)
|
29
29
|
count = keys.pop
|
30
|
-
translations = FastGettext.cached_plural_find
|
30
|
+
translations = FastGettext.cached_plural_find(*keys)
|
31
31
|
|
32
32
|
selected = FastGettext.pluralisation_rule.call(count)
|
33
33
|
selected = (selected ? 1 : 0) unless selected.is_a? Numeric #convert booleans to numbers
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fast_gettext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.6.
|
9
|
+
- 4
|
10
|
+
version: 0.6.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|