Author: mrisaliti
Date: Tue Feb 1 19:28:09 2011 New Revision: 1066159 URL: http://svn.apache.org/viewvc?rev=1066159&view=rev Log: Internationalization of return messages of java services of bi component (OFBIZ-4091) Modified: ofbiz/trunk/framework/bi/config/BiUiLabels.xml ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java Modified: ofbiz/trunk/framework/bi/config/BiUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/bi/config/BiUiLabels.xml?rev=1066159&r1=1066158&r2=1066159&view=diff ============================================================================== --- ofbiz/trunk/framework/bi/config/BiUiLabels.xml (original) +++ ofbiz/trunk/framework/bi/config/BiUiLabels.xml Tue Feb 1 19:28:09 2011 @@ -84,6 +84,10 @@ <value xml:lang="th">หà¸à¹à¸²à¸«à¸¥à¸±à¸</value> <value xml:lang="zh">é¦é¡µ</value> </property> + <property key="BusinessIntelligenceNaturalKeyWithourDimension"> + <value xml:lang="en">The natural key: ${naturalKeyFields} is empty in value: ${dimensionValue}</value> + <value xml:lang="it">La chiave naturale: ${naturalKeyFields} è vuota nel valore: ${dimensionValue}</value> + </property> <property key="BusinessIntelligenceNote10"> <value xml:lang="en">The best practices for datawarehouses are mainly taken from the great book "The Data Warehouse Toolkit - Second Edition" by Ralph Kimball.</value> <value xml:lang="fr">Les bonnes pratiques pour datawarehouses sont principalement tirées du fameux livre "The Data Warehouse Toolkit - Second Edition" by Ralph Kimball.</value> @@ -357,4 +361,8 @@ <value xml:lang="th">à¹à¸¥à¸·à¸à¸à¹à¸à¸à¸à¸±à¸ (รายà¸à¸²à¸)</value> <value xml:lang="zh">éæ©æå模å(æ¥å)</value> </property> + <property key="BusinessIntelligenceUpdateModeStillNotSupported"> + <value xml:lang="en">The update mode: ${updateMode} is still not supported.</value> + <value xml:lang="it">Il metodo di aggiornamento: ${updateMode} non è ancora supportato.</value> + </property> </resource> Modified: ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java?rev=1066159&r1=1066158&r2=1066159&view=diff ============================================================================== --- ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java (original) +++ ofbiz/trunk/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java Tue Feb 1 19:28:09 2011 @@ -19,12 +19,14 @@ under the License. package org.ofbiz.bi.util; import java.util.List; +import java.util.Locale; import java.util.Map; import javolution.util.FastMap; import org.ofbiz.base.util.UtilGenerics; import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.Delegator; import org.ofbiz.entity.GenericEntityException; @@ -36,6 +38,7 @@ import org.ofbiz.service.ServiceUtil; public class DimensionServices { public static final String module = DimensionServices.class.getName(); + public static final String resource = "BiUiLabels"; public static Map<String, Object> getDimensionIdFromNaturalKey(DispatchContext ctx, Map<String, ? extends Object> context) { Map<String, Object> resultMap = ServiceUtil.returnSuccess(); @@ -60,6 +63,7 @@ public class DimensionServices { GenericValue dimensionValue = (GenericValue) context.get("dimensionValue"); List<String> naturalKeyFields = UtilGenerics.checkList(context.get("naturalKeyFields"), String.class); String updateMode = (String) context.get("updateMode"); + Locale locale = (Locale) context.get("locale"); try { Map<String, Object> andCondition = FastMap.newInstance(); @@ -67,7 +71,7 @@ public class DimensionServices { andCondition.put(naturalKeyField, dimensionValue.get(naturalKeyField)); } if (andCondition.isEmpty()) { - return ServiceUtil.returnError("The natural key: " + naturalKeyFields + " is empty in value: " + dimensionValue); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BusinessIntelligenceNaturalKeyWithourDimension", UtilMisc.toMap("naturalKeyFields", naturalKeyFields, "dimensionValue", dimensionValue), locale)); } List<GenericValue> existingDimensionValues = null; try { @@ -91,7 +95,7 @@ public class DimensionServices { dimensionValue.set("dimensionId", delegator.getNextSeqId(dimensionValue.getEntityName())); dimensionValue.create(); } else { - return ServiceUtil.returnError("The update mode: " + updateMode + " is still not supported."); + return ServiceUtil.returnError(UtilProperties.getMessage(resource, "BusinessIntelligenceUpdateModeStillNotSupported", UtilMisc.toMap("updateMode", updateMode), locale)); } } } catch (GenericEntityException gee) { |
Free forum by Nabble | Edit this page |