diff --git a/app/models/locale.rb b/app/models/locale.rb index a17881b23..2c1c8f167 100644 --- a/app/models/locale.rb +++ b/app/models/locale.rb @@ -12,6 +12,9 @@ class Locale < ApplicationModel :json => true, } ) + + raise "Can't load locales from #{url}: #{result.error}" if !result.success? + result.data.each {|locale| puts locale.inspect exists = Locale.where(:locale => locale['locale']).first diff --git a/app/models/translation.rb b/app/models/translation.rb index b6e36d2a6..8a82a4cbd 100644 --- a/app/models/translation.rb +++ b/app/models/translation.rb @@ -15,7 +15,7 @@ load translations from online =end def self.load - url = 'http://localhost:3001/api/v1/translations' + url = 'https://i18n.zammad.com/api/v1/translations' if !UserInfo.current_user_id UserInfo.current_user_id = 1 end @@ -26,6 +26,7 @@ load translations from online :json => true, } ) + raise "Can't load translations from #{url}: #{result.error}" if !result.success? result.data.each {|translation| #puts translation.inspect @@ -84,7 +85,7 @@ push translations to online :json => true, } ) - raise result.error if !result.success? + raise "Can't push translations to #{url}: #{result.error}" if !result.success? true end