Index: xwiki-core/src/main/java/com/xpn/xwiki/web/SaveAction.java
===================================================================
--- xwiki-core/src/main/java/com/xpn/xwiki/web/SaveAction.java	(revision 9844)
+++ xwiki-core/src/main/java/com/xpn/xwiki/web/SaveAction.java	(working copy)
@@ -23,9 +23,11 @@
 import com.xpn.xwiki.XWiki;
 import com.xpn.xwiki.XWikiContext;
 import com.xpn.xwiki.XWikiException;
+import com.xpn.xwiki.api.Document;
 import com.xpn.xwiki.doc.XWikiDocument;
 import com.xpn.xwiki.doc.XWikiLock;
 import com.xpn.xwiki.plugin.captcha.CaptchaPluginApi;
+import org.apache.velocity.VelocityContext;
 
 public class SaveAction extends PreviewAction
 {
@@ -68,6 +70,9 @@
             sectionNumber = Integer.parseInt(request.getParameter("section"));
         }
         synchronized (doc) {
+            // we need to clone this document first
+            doc = (XWikiDocument) doc.clone();
+
             String language = ((EditForm) form).getLanguage();
             // FIXME Which one should be used: doc.getDefaultLanguage or
             // form.getDefaultLanguage()?
@@ -84,6 +89,8 @@
                     tdoc = new XWikiDocument(doc.getSpace(), doc.getName());
                     tdoc.setLanguage(language);
                     tdoc.setStore(doc.getStore());
+                } else if (tdoc != doc) {
+                    tdoc = (XWikiDocument) tdoc.clone();
                 }
                 tdoc.setTranslation(1);
             }
@@ -125,6 +132,28 @@
             // Make sure we have at least the meta data dirty status
             tdoc.setMetaDataDirty(true);
 
+            // let's validation the document if we have "xvalidate" = 1
+            if ("1".equals(request.getParameter("xvalidate"))) {
+                boolean validationResult = tdoc.validate(context);
+                // if the validation fails we should show the inline action
+                if (validationResult==false) {
+                    // Set display context to 'edit'
+                    context.put("display", "edit");
+                    // Set the action to inline
+                    context.setAction("inline");
+                    // Set the document in the context
+                    VelocityContext vcontext = (VelocityContext) context.get("vcontext");
+                    context.put("doc",  tdoc);
+                    context.put("cdoc", tdoc);
+                    context.put("tdoc", tdoc);
+                    Document vdoc = tdoc.newDocument(context);
+                    vcontext.put("doc", vdoc);
+                    vcontext.put("cdoc", vdoc);
+                    vcontext.put("tdoc", vdoc);
+                    return true;
+                }
+            }
+
             // We get the comment to be used from the document
             // It was read using readFromForm
             xwiki.saveDocument(tdoc, tdoc.getComment(), tdoc.isMinorEdit(), context);
@@ -153,9 +182,14 @@
         } else if (e != null) {
             return "exception";
         } else {
-            // If captcha is not correct it will require to confirm again
-            context.put("recheckcaptcha", new Boolean(true));
-            return super.render(context);
+            // if display mode is edit we failed because of validation
+            if ("edit".equals(context.get("display"))) {
+                return "inline";
+            } else {
+                // If captcha is not correct it will require to confirm again
+                context.put("recheckcaptcha", new Boolean(true));
+                return super.render(context);
+            }
         }
     }
 }
Index: xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java
===================================================================
--- xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java	(revision 9844)
+++ xwiki-core/src/main/java/com/xpn/xwiki/api/Document.java	(working copy)
@@ -1538,6 +1538,11 @@
         getDoc().setMinorEdit(isMinor);
     }
 
+    public void setValidationScript(String validationScript)
+    {
+        getDoc().setValidationScript(validationScript);
+    }
+
     public void save() throws XWikiException
     {
         save("", false);
Index: xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java
===================================================================
--- xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	(revision 9844)
+++ xwiki-core/src/main/java/com/xpn/xwiki/doc/XWikiDocument.java	(working copy)
@@ -1303,7 +1303,7 @@
 
     public String displayPrettyName(String fieldname, boolean showMandatory, XWikiContext context)
     {
-        return displayPrettyName(fieldname, false, true, context);
+        return displayPrettyName(fieldname, showMandatory, true, context);
     }
 
     public String displayPrettyName(String fieldname, boolean showMandatory, boolean before,
@@ -1337,14 +1337,13 @@
         try {
             PropertyClass pclass = (PropertyClass) obj.getxWikiClass(context).get(fieldname);
             String dprettyName = "";
-            if ((showMandatory) && (pclass.getValidationRegExp() != null)
-                && (!pclass.getValidationRegExp().equals(""))) {
+            if (showMandatory) {
                 dprettyName = context.getWiki().addMandatory(context);
             }
             if (before) {
-                return dprettyName + pclass.getPrettyName();
+                return dprettyName + pclass.getPrettyName(context);
             } else {
-                return pclass.getPrettyName() + dprettyName;
+                return pclass.getPrettyName(context) + dprettyName;
             }
         } catch (Exception e) {
             return "";
Index: xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java
===================================================================
--- xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	(revision 9844)
+++ xwiki-core/src/main/java/com/xpn/xwiki/objects/classes/PropertyClass.java	(working copy)
@@ -320,6 +320,16 @@
         return getStringValue("prettyName");
     }
 
+    public String getPrettyName(XWikiContext context) {
+
+        String fieldName = getFieldFullName();
+        String prettyName = context.getWiki().getMessage(fieldName, context);
+        if (prettyName.equals(fieldName)) {
+            return getPrettyName();
+        }
+        return prettyName;
+    }
+
     public void setPrettyName(String prettyName)
     {
         setStringValue("prettyName", prettyName);
