Index: AbstractFunction.java
===================================================================
--- AbstractFunction.java	(revision 44097)
+++ AbstractFunction.java	(revision 44098)
@@ -14,6 +14,7 @@
 import org.gvsig.expressionevaluator.Code;
 import org.gvsig.expressionevaluator.Code.Caller.Arguments;
 import org.gvsig.expressionevaluator.Function;
+import org.gvsig.expressionevaluator.I18N;
 import org.gvsig.expressionevaluator.Interpreter;
 import org.gvsig.fmap.geom.Geometry;
 import org.gvsig.fmap.geom.primitive.Point;
@@ -141,54 +142,75 @@
     
     protected int getInt(Object args[], int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
-        if( !(args[n] instanceof Number) ) {
-            String type = (args[n]==null)? "null" : args[n].getClass().getCanonicalName();
-            throw new IllegalArgumentException("Type not allowed for argument " + n + " in '" + name() + "' function, expected Number and got " + type + ".");
+        Object value = args[n];
+        if( value == null ) {
+            throw new IllegalArgumentException(I18N.Illegal_null_value_for_argument_XargnX_of_XIdentifierX_function(name(), n));
         }
-        return ((Number)args[n]).intValue();
+        if( !(value instanceof Number) ) {
+            String type = value.getClass().getCanonicalName();
+            throw new IllegalArgumentException(
+                    I18N.The_type_of_the_argument_XargnX_for_the_XIdentifierX_function_is_incorrect(name(), n) + " " +
+                    I18N.Expected_XexpectedX_and_found_XfoundX("Number",type)
+            );
+        }
+        return ((Number)value).intValue();
     }
 
     protected long getLong(Object args[], int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
-        if( !(args[n] instanceof Number) ) {
-            String type = (args[n]==null)? "null" : args[n].getClass().getCanonicalName();
-            throw new IllegalArgumentException("Type not allowed for argument " + n + " in '" + name() + "' function, expected Number and got " + type + ".");
+        Object value = args[n];
+        if( value == null ) {
+            throw new IllegalArgumentException(I18N.Illegal_null_value_for_argument_XargnX_of_XIdentifierX_function(name(), n));
         }
-        return ((Number)args[n]).longValue();
+        if( !(value instanceof Number) ) {
+            String type = value.getClass().getCanonicalName();
+            throw new IllegalArgumentException(
+                    I18N.The_type_of_the_argument_XargnX_for_the_XIdentifierX_function_is_incorrect(name(), n) + " " +
+                    I18N.Expected_XexpectedX_and_found_XfoundX("Number",type)
+            );
+        }
+        return ((Number)value).longValue();
     }
 
     protected double getDouble(Object args[], int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
-        if( !(args[n] instanceof Number) ) {
-            String type = (args[n]==null)? "null" : args[n].getClass().getCanonicalName();
-            throw new IllegalArgumentException("Type not allowed for argument " + n + " in '" + name() + "' function, expected Number and got " + type + ".");
+        Object value = args[n];
+        if( value == null ) {
+            throw new IllegalArgumentException(I18N.Illegal_null_value_for_argument_XargnX_of_XIdentifierX_function(name(), n));
         }
-        return ((Number)args[n]).doubleValue();
+        if( !(value instanceof Number) ) {
+            String type = value.getClass().getCanonicalName();
+            throw new IllegalArgumentException(
+                    I18N.The_type_of_the_argument_XargnX_for_the_XIdentifierX_function_is_incorrect(name(), n) + " " +
+                    I18N.Expected_XexpectedX_and_found_XfoundX("Number",type)
+            );
+        }
+        return ((Number)value).doubleValue();
     }
     
     protected String getStr(Object args[], int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
         return Objects.toString(args[n], "");
     }
     
     protected Object getObject(Object args[], int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
         return args[n];
     }
     
     protected Object getObject(Interpreter interpreter, Arguments args, int n) {
         if( args.count() < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.count() +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.count(), n));
         }
         Code arg = args.get(n);
         Object value = interpreter.run(arg);
@@ -196,30 +218,51 @@
     }
     
     protected Geometry getGeom(Object[] args, int n) {
+        return this.getGeom(args, n, false);
+    }
+    
+    protected Geometry getGeom(Object[] args, int n, boolean allowNull) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
-        if( !(args[n] instanceof Geometry) ) {
-            String type = (args[n]==null)? "null" : args[n].getClass().getCanonicalName();
-            throw new IllegalArgumentException("Type not allowed for argument " + n + " in '" + name() + "' function, expected Geometry and got " + type + ".");
+        Object value = args[n];
+        if( value == null ) {
+            if( allowNull ) {
+                return null;
+            }
+            throw new IllegalArgumentException(I18N.Illegal_null_value_for_argument_XargnX_of_XIdentifierX_function(name(), n));
         }
-        return (Geometry)args[n];
+        if( !(value instanceof Geometry) ) {
+            String type = value.getClass().getCanonicalName();
+            throw new IllegalArgumentException(
+                    I18N.The_type_of_the_argument_XargnX_for_the_XIdentifierX_function_is_incorrect(name(), n) + " " +
+                    I18N.Expected_XexpectedX_and_found_XfoundX("Geometry",type)
+            );
+        }
+        return (Geometry)value;
     }
 
     protected Point getPoint(Object[] args, int n) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
-        if( !(args[n] instanceof Point) ) {
-            String type = (args[n]==null)? "null" : args[n].getClass().getCanonicalName();
-            throw new IllegalArgumentException("Type not allowed for argument " + n + " in '" + name() + "' function, expected Point and got " + type + ".");
+        Object value = args[n];
+        if( value == null ) {
+            return null;
         }
-        return (Point)args[n];
+        if( !(value instanceof Point) ) {
+            String type = value.getClass().getCanonicalName();
+            throw new IllegalArgumentException(
+                    I18N.The_type_of_the_argument_XargnX_for_the_XIdentifierX_function_is_incorrect(name(), n) + " " +
+                    I18N.Expected_XexpectedX_and_found_XfoundX("Point",type)
+            );
+        }
+        return (Point)value;
     }
     
     protected boolean getBoolean(Object args[], int n, Double accuracy) {
         if( args.length < n  ) {
-            throw new IllegalArgumentException("Required argument "+n+" and only found " + args.length +" arguments in call to '"+name()+"'.");
+            throw new IllegalArgumentException(I18N.Required_argument_XargnX_and_only_found_XargcX_in_call_to_XIdentifierX(name(), args.length, n));
         }
         Object value = args[n];
         return toBoolean(value, accuracy);
