svn commit: r1056541 - in /ofbiz/trunk/applications/product/src/org/ofbiz/product: image/ScaleImage.java imagemanagement/FrameImage.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1056541 - in /ofbiz/trunk/applications/product/src/org/ofbiz/product: image/ScaleImage.java imagemanagement/FrameImage.java

mrisaliti
Author: mrisaliti
Date: Fri Jan  7 22:20:58 2011
New Revision: 1056541

URL: http://svn.apache.org/viewvc?rev=1056541&view=rev
Log:
Internationalization of ServiceUtil.returnSuccess, ServiceUtil.returnFailure, ServiceUtil.returnError (OFBIZ-4091)

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/product/image/ScaleImage.java
    ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/image/ScaleImage.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/image/ScaleImage.java?rev=1056541&r1=1056540&r2=1056541&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/image/ScaleImage.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/image/ScaleImage.java Fri Jan  7 22:20:58 2011
@@ -120,7 +120,8 @@ public class ScaleImage {
             type = "additional";
             id = imgName + "_View_" + viewNumber;
         } else {
-            return ServiceUtil.returnError("View Type : " + type + " is wrong");
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+                    "ProductImageViewType", UtilMisc.toMap("viewType", type), locale));
         }
         FlexibleStringExpander mainFilenameExpander = FlexibleStringExpander.getInstance(mainFilenameFormat);
         String fileLocation = mainFilenameExpander.expandString(UtilMisc.toMap("location", "products", "type", type, "id", filenameToUse));
@@ -276,7 +277,8 @@ public class ScaleImage {
             type = "additional";
             id = imgName + "_View_" + viewNumber;
         } else {
-            return ServiceUtil.returnError("View Type : " + type + " is wrong");
+            return ServiceUtil.returnError(UtilProperties.getMessage(resource,
+                    "ProductImageViewType", UtilMisc.toMap("viewType", type), locale));
         }
         FlexibleStringExpander mainFilenameExpander = FlexibleStringExpander.getInstance(mainFilenameFormat);
         String fileLocation = mainFilenameExpander.expandString(UtilMisc.toMap("location", "products", "type", type, "id", filenameToUse));

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java?rev=1056541&r1=1056540&r2=1056541&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/product/imagemanagement/FrameImage.java Fri Jan  7 22:20:58 2011
@@ -32,6 +32,7 @@ import java.io.IOException;
 import java.io.RandomAccessFile;
 import java.nio.ByteBuffer;
 import java.util.List;
+import java.util.Locale;
 import java.util.Map;
 
 import javax.imageio.ImageIO;
@@ -75,13 +76,16 @@ public class FrameImage {
         String imageName = (String) context.get("imageName");
         String imageWidth = (String) context.get("imageWidth");
         String imageHeight = (String) context.get("imageHeight");
-
+        Locale locale = (Locale) context.get("locale");
+        
         if (UtilValidate.isEmpty(context.get("frameContentId")) || UtilValidate.isEmpty(context.get("frameDataResourceId"))) {
-            result =  ServiceUtil.returnError("Required frame image content ID or dataResource ID parameters. Please upload new frame image or choose the exist frame.");
+            result =  ServiceUtil.returnError(UtilProperties.getMessage(resource,
+                    "ProductImageFrameContentIdRequired", locale));
             result.putAll(context);
         }
         if (UtilValidate.isEmpty(context.get("imageWidth")) || UtilValidate.isEmpty(context.get("imageHeight"))) {
-            result =  ServiceUtil.returnError("Image Width and Image Height are required to create the image. Please enter in Image Width and Image Height fields.");
+            result =  ServiceUtil.returnError(UtilProperties.getMessage(resource,
+                    "ProductImageWidthAndHeightRequired", locale));
             result.putAll(context);
         }