has_many_translations 0.4.3 → 0.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/has_many_translations.gemspec +1 -1
- data/lib/has_many_translations/creation.rb +4 -3
- data/lib/has_many_translations.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.4
|
@@ -68,9 +68,9 @@ module HasManyTranslations
|
|
68
68
|
@translator.key = Settings.google_api_key
|
69
69
|
end
|
70
70
|
|
71
|
-
def force_on_update?
|
72
|
-
|
73
|
-
end
|
71
|
+
# def force_on_update?
|
72
|
+
# return false
|
73
|
+
# end
|
74
74
|
|
75
75
|
def allowed_locales
|
76
76
|
t = TranslationSpec.first(:conditions => {:translated_id => self.id, :translated_type => self.class.to_s})
|
@@ -172,6 +172,7 @@ module HasManyTranslations
|
|
172
172
|
@translator.key = HmtSettings.google_api_key
|
173
173
|
end
|
174
174
|
translation_val = @translator.translate(try(attrib), :from => origin_locale.to_s, :to => loc.to_s)
|
175
|
+
# TODO: Should this be "find_or_create"?
|
175
176
|
translations.create(:model_attribute => attrib, :locale_code => loc.to_s, :value => translation_val, :locale_name => Google::Language::Languages[loc.to_s], :machine_translation => true, :origin_locale_code => origin_locale ) unless translation_val.nil? || translation_val.match('Error: ')
|
176
177
|
end
|
177
178
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_many_translations
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 4
|
10
|
+
version: 0.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- OpenGotham
|