mini_i18n 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mini_i18n/version.rb +1 -1
- data/lib/mini_i18n.rb +4 -4
- data/spec/mini_i18n_spec.rb +4 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32665206618cf4c4a45344aae4696c61f4a66b36
|
4
|
+
data.tar.gz: cf097c2379dcc4df553f3de6268484a02e9d76f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa093915daa4b2db6191e00e8e85c1a45842e3642df4299ea3509e27e758cc6d91c68664ddf2357197b10df82fd07efaa4e3467661d31169e4d7ba7b95e142a2
|
7
|
+
data.tar.gz: 920f5bff55a01206f365c5a1bc2286b0bc8c639b2d1500883ea95b2da6cad9308eadd847fdc231c26ed3146ec7c73d3f702fad51ec860a9785757b9471879d45
|
data/lib/mini_i18n/version.rb
CHANGED
data/lib/mini_i18n.rb
CHANGED
@@ -46,15 +46,15 @@ module MiniI18n
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def load_translations(path)
|
49
|
-
Dir[path].each do |file|
|
50
|
-
YAML.load_file(file).each do |locale,
|
49
|
+
Dir[path.to_s].each do |file|
|
50
|
+
YAML.load_file(file).each do |locale, new_translations|
|
51
51
|
locale = locale.to_s
|
52
52
|
@@available_locales << locale unless available_locale?(locale)
|
53
53
|
|
54
54
|
if translations[locale]
|
55
|
-
translations[locale] = Utils.deep_merge(translations[locale],
|
55
|
+
translations[locale] = Utils.deep_merge(translations[locale], new_translations)
|
56
56
|
else
|
57
|
-
translations[locale] =
|
57
|
+
translations[locale] = new_translations
|
58
58
|
end
|
59
59
|
end
|
60
60
|
end
|
data/spec/mini_i18n_spec.rb
CHANGED
@@ -15,6 +15,10 @@ RSpec.describe MiniI18n do
|
|
15
15
|
expect(MiniI18n.translations.size). to eq 3
|
16
16
|
expect(MiniI18n.translations["en"]).to include 'bye'
|
17
17
|
end
|
18
|
+
|
19
|
+
it "does not raise if path is nil" do
|
20
|
+
expect(MiniI18n.load_translations(nil)).to eq []
|
21
|
+
end
|
18
22
|
end
|
19
23
|
|
20
24
|
describe 'default_locale=' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mini_i18n
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- markets
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-07-
|
11
|
+
date: 2018-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|