def parse_language_rules
      rulz = []
      return rulz unless params[:rules]
    
      Tr8n::Config.language_rule_classes.each do |cls|
        next unless params[:rules][cls.dependency]
        index = 0    
        while params[:rules][cls.dependency]["#{index}"]
          rule_params = params[:rules][cls.dependency]["#{index}"]
          rule_definition = params[:rules][cls.dependency]["#{index}"][:definition]
        
          if rule_params.delete(:reset_values) == "true"
            rule_definition = {}
          end
  
          rule_id = rule_params[:id]
          keyword = rule_params[:keyword]
        
          if rule_id.blank?
            rulz << cls.new(:keyword => keyword, :definition => rule_definition)
          else
            rule = cls.find_by_id(rule_id)
            rule = cls.new unless rule
            rule.keyword = keyword
            rule.definition = rule_definition
            rulz << rule
          end
          index += 1
        end
    
      end 
    
      rulz
    end
def parse_language_rules
      rulz = []
      return rulz unless params[:rules]
    
      Tr8n::Config.language_rule_classes.each do |cls|
        next unless params[:rules][cls.dependency]
        index = 0    
        while params[:rules][cls.dependency]["#{index}"]
          rule_params = params[:rules][cls.dependency]["#{index}"]
          rule_definition = params[:rules][cls.dependency]["#{index}"][:definition]
        
          if rule_params.delete(:reset_values) == "true"
            rule_definition = {}
          end
  
          rule_id = rule_params[:id]
          keyword = rule_params[:keyword]
        
          if rule_id.blank?
            rulz << cls.new(:keyword => keyword, :definition => rule_definition)
          else
            rule = cls.find_by_id(rule_id)
            rule = cls.new unless rule
            rule.keyword = keyword
            rule.definition = rule_definition
            rulz << rule
          end
          index += 1
        end
    
      end 
    
      rulz
    end
parse with safety - we don't want to disconnect existing translations from those rules