i18n_screwdriver 7.0 → 7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n_screwdriver.rb +3 -6
- data/lib/i18n_screwdriver/version.rb +1 -1
- 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: 664dc4e3b6bb1c67258b51ec66547a7a8938a5f4
|
4
|
+
data.tar.gz: 3c41d11e3d34cac784fcd2bc2fec2f925a5ebf99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7008234c2336366b9043a8852794fbe7e27e043d492dd3a1666b485e7cf7319b069f25babf846c0467303e8ef8e4697154d8911c22241e6d40a413fff19c2fd5
|
7
|
+
data.tar.gz: 1669696619a0d364080dec760c4cf5fecc6689600da17dddcf2d1a4d29b0210715763b83c169e28c0c86c291c783c972a60d96eb8cac2d8d74d3b4cec2efe178
|
data/lib/i18n_screwdriver.rb
CHANGED
@@ -108,17 +108,13 @@ module I18nScrewdriver
|
|
108
108
|
end
|
109
109
|
end
|
110
110
|
|
111
|
-
def self.dummy_text
|
112
|
-
"TRANSLATION_MISSING"
|
113
|
-
end
|
114
|
-
|
115
111
|
def self.update_translations_file(locale, translations)
|
116
112
|
existing_translations = file_with_translations_exists?(locale) ? load_translations(locale) : {}
|
117
113
|
existing_translations.select!{ |k| translations.has_key?(k) }
|
118
114
|
|
119
115
|
translations.each do |k, v|
|
120
116
|
next if existing_translations[k]
|
121
|
-
existing_translations[k] = (default_locale == locale) ? v :
|
117
|
+
existing_translations[k] = (default_locale == locale) ? v : nil
|
122
118
|
end
|
123
119
|
|
124
120
|
write_translations(locale, existing_translations)
|
@@ -131,7 +127,8 @@ module I18nScrewdriver
|
|
131
127
|
end
|
132
128
|
|
133
129
|
def self.translate(string, options = {})
|
134
|
-
I18n.translate(generate_key(string), options)
|
130
|
+
translation = I18n.translate(generate_key(string), options)
|
131
|
+
translation.present? ? translation : "TRANSLATION_MISSING"
|
135
132
|
end
|
136
133
|
|
137
134
|
def self.extract_text(string)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_screwdriver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '7.
|
4
|
+
version: '7.1'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tobias Miesel
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-10-
|
12
|
+
date: 2014-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|