ar_translate 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/ar_translate/translated_column.rb +8 -6
- data/lib/ar_translate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1c2a8cf26e19d7f89aab4eda2bcf34cccaece09
|
4
|
+
data.tar.gz: 38c0cf132c2abeaeff108ab6aceffad23a2ac5fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c139c869c0f693166ccc3edf1662fb791c8cb4ab099427f979589e8f4933cfc871b6409fdbe3051216522f12f0e934eaedd637c0ff94f7e777e6f35ed89c27d2
|
7
|
+
data.tar.gz: d01ac777a91e714584822773ea1ab9c81cabf22507b9626360e9def6e116d9a522c78b8562841507de90f49a321bc6f6df4c5c26e0366432d017567adf89d092
|
@@ -33,6 +33,14 @@ module ArTranslate
|
|
33
33
|
langs.map { |lang| :"#{prefix}_#{lang}" }
|
34
34
|
end
|
35
35
|
|
36
|
+
def langs
|
37
|
+
if !@langs.is_a?(Array) || @langs.empty?
|
38
|
+
fail Error, "No languages specified for column #{column}"
|
39
|
+
end
|
40
|
+
|
41
|
+
@langs.map { |lang| lang.to_s.downcase }.uniq
|
42
|
+
end
|
43
|
+
|
36
44
|
def check_plural_name!
|
37
45
|
return if column.pluralize == column
|
38
46
|
return if column.singularize != column
|
@@ -41,12 +49,6 @@ module ArTranslate
|
|
41
49
|
end
|
42
50
|
|
43
51
|
def check_languages!
|
44
|
-
if !langs.is_a?(Array) || langs.empty?
|
45
|
-
fail Error, "No languages specified for column #{column}"
|
46
|
-
end
|
47
|
-
|
48
|
-
langs.map! { |lang| lang.to_s.downcase }
|
49
|
-
|
50
52
|
langs.each do |lang|
|
51
53
|
next if lang =~ /^[a-z]+$/ && !KEYWORDS.include?(lang)
|
52
54
|
fail Error, "Invalid language '#{lang}' (should be letters only)"
|
data/lib/ar_translate/version.rb
CHANGED