lib/translate.rb
# Check if the translation is valid, ie. options exists and an expression
# has been providen. Build an array of errors which will be printed to the 
# end user.
Check if the translation is valid, ie. options exists and an expression
has been providen. Build an array of errors which will be printed to the
end user.
Check if the translation is valid ie . options exists and an expression has been providen . Build an array of errors which will be printed to the end user .
def valid?
			@errors = []
			@errors << "Expression can't be blank." if expression.blank?
			@errors << "Translation from #{from} to #{to} is not available, use translate -l to show available languages." unless Translate::Language.available_translation?(from, to)
			@errors << "Width must be an integer >= #{MIN_WIDTH}." unless width.is_a?(Integer) and width >= MIN_WIDTH
			@errors.empty?
    end
def valid? @errors = [ ] @errors << "Expression can't be blank." if expression . blank? @errors << "Translation from #{from} to #{to} is not available, use translate -l to show available languages." unless Translate :: Language . available_translation? ( from , to ) @errors << "Width must be an integer >= #{MIN_WIDTH}." unless width . is_a? ( Integer ) and width >= MIN_WIDTH @errors . empty? end
Check if the translation is valid, ie.
Check if the translation is valid ie .