lost_in_translations 1.4.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32e8b3114257ea7a04833848621b662ac170db3e
|
4
|
+
data.tar.gz: 70d1fd6bb408f437056bfaaf90c05453e0b2bf78
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8cadaef4095afee2cafa73aebd6500b2d160e2dd318bea23c2025b60f0c396764b1b9026d826d4ca6fc2c202733acdd13019c1d08270b1f126bbeb06e5c36858
|
7
|
+
data.tar.gz: 2b252e278302c01e130e3eb753bdeb9bc3d836e7e396922d940640a073ab7c6b00b12a5cfa1e6f41bf3c0e85de2e64b3205b2acb94e6d5d14d9ae690a7bccce3
|
@@ -9,7 +9,7 @@ module LostInTranslations
|
|
9
9
|
def translate(field, locale = I18n.locale)
|
10
10
|
translation = LostInTranslations.translate(self, field, locale)
|
11
11
|
|
12
|
-
if translation.nil? && locale
|
12
|
+
if translation.nil? && fallback_to_default_locale(locale)
|
13
13
|
translation = call_original_field(self, field)
|
14
14
|
end
|
15
15
|
|
@@ -20,6 +20,11 @@ module LostInTranslations
|
|
20
20
|
LostInTranslations.assign_translation(self, field, value, locale)
|
21
21
|
end
|
22
22
|
|
23
|
+
def fallback_to_default_locale(locale)
|
24
|
+
LostInTranslations.config.fallback_to_default_locale ||
|
25
|
+
locale.to_sym == I18n.default_locale.to_sym
|
26
|
+
end
|
27
|
+
|
23
28
|
module ClassMethods
|
24
29
|
attr_writer :translation_data_field
|
25
30
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lost_in_translations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- StreetBees Dev Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: pry
|