Permalink
Browse files

Merge pull request #148 from mwysocki/RELEASE-1.1

fixes for translations
  • Loading branch information...
zmalinowski committed May 9, 2012
2 parents 5d7e797 + da4c0d7 commit 87e2ff1d4ac112e6a3d2aafbc5f6e2e683a445e2
@@ -53,7 +53,7 @@ public AperteProcessClassInfo(Class<?> aperteClass, Set<Permission> defaultPermi
docName = aliasName;
}
if (StringUtils.isEmpty(docDescription)) {
- docDescription = aperteClass.getName();
+ docDescription = aperteClass.getSimpleName();
}
if (fields != null && !fields.isEmpty()) {
@@ -1,5 +1,6 @@
package pl.net.bluesoft.rnd.processtool.ui.basewidgets.editor;
+import pl.net.bluesoft.rnd.processtool.ui.basewidgets.xml.XmlConstants;
import pl.net.bluesoft.rnd.processtool.ui.basewidgets.xml.validation.XmlValidationError;
import pl.net.bluesoft.rnd.util.i18n.I18NSource;
@@ -63,10 +64,34 @@ public static Field findField(Object propertyId, Class classOfItem) {
public static String joinValidationErrors(List<XmlValidationError> xmlValidationErrors) {
String msg = "";
for (XmlValidationError err : xmlValidationErrors) {
- msg += getLocalizedMessage(err.getMessageKey()).replace("%s", getLocalizedMessage(err.getParent() + "." + err.getField())) + " \n";
+ msg += getLocalizedMessage(err.getMessageKey()).replace("%s", extractFieldNames(err)) + " \n";
}
return msg;
}
+
+ private static String extractFieldNames(XmlValidationError err) {
+ if(err.getField().startsWith("[") && err.getField().endsWith("]")){
+ String string = err.getField().substring(1, err.getField().length()-1);
+ String[] parts = string.split(" +");
+ StringBuilder sb = new StringBuilder();
+ for(String part : parts){
+ String key = "";
+ if("&".equals(part)){
+ key = XmlConstants.XML_FIELD_AND;
+ } else if("|".equals(part)){
+ key = XmlConstants.XML_FIELD_OR;
+ } else {
+ key = err.getParent() + "." + part;
+ }
+ sb.append(getLocalizedMessage(key));
+ sb.append(" ");
+ }
+
+ return sb.toString().trim();
+ } else {
+ return getLocalizedMessage(err.getParent() + "." + err.getField());
+ }
+ }
public static String getLocalizedMessage(String key) {
return I18NSource.ThreadUtil.getLocalizedMessage(
@@ -1,6 +1,8 @@
package pl.net.bluesoft.rnd.processtool.ui.basewidgets.xml;
public interface XmlConstants {
+ public static final String XML_FIELD_AND = "processdata.block.xml.validation.and";
+ public static final String XML_FIELD_OR = "processdata.block.xml.validation.or";
public static final String XML_TAG_EMPTY = "processdata.block.xml.validation.empty";
public static final String XML_TAG_INVALID = "processdata.block.xml.validation.invalid";
@@ -75,6 +75,8 @@ processdata.block.loading=Loading data. Please wait...
processdata.block.nothing.to.render=Nothing to render
processdata.block.xml.validation.empty=Field %s cannot be empty
processdata.block.xml.validation.invalid=Field %s has invalid value
+processdata.block.xml.validation.and=and
+processdata.block.xml.validation.or=or
processdata.block.error.title=Unexpected error
processdata.block.error.load.class=Loading class <b>%s</b> failed!
@@ -150,6 +152,12 @@ widget.process_data_block.editor.readonly=Is readonly
widget.process_data_block.editor.caption=Caption
widget.process_data_block.editor.style=Style name
widget.process_data_block.editor.attributeClass=Class of process attribute
+
+widget.process_data_block.editor.select.provider=Element provider
+widget.process_data_block.editor.select.dictionaryAttribute=Dictionary attribute
+widget.process_data_block.editor.select.dict=Dictionary name
+widget.process_data_block.editor.select.values=Children items
+
widget.process_data_block.editor.pos=Position alignment
widget.process_data_block.editor.pos.left-top=Left Top
@@ -193,6 +201,8 @@ widget.process_data_block.editor.mode.5=RAW
widget.process_data_block.editor.description.format={0}<br/><i>(attribute id: {1})</i>
widget.process_data_block.editor.description.short.format=<i>(attribute id: {0})</i>
+widget.process_data_block.editor.any.id=ID
+widget.process_data_block.editor.any.id.description=Element ID for use with scripts
widget.process_data_block.editor.any.width=Width
widget.process_data_block.editor.any.width.description=Width of the element e.g. 250px, 100%...
widget.process_data_block.editor.any.height=Height
@@ -202,11 +212,14 @@ widget.process_data_block.editor.any.fullSize.description=Should the element tak
widget.process_data_block.editor.any.undefinedSize=Is size undefined
widget.process_data_block.editor.any.undefinedSize.description=Should the element size itself to fit the container
widget.process_data_block.editor.any.bind=Bind
+widget.process_data_block.editor.upload.bind=Bind
widget.process_data_block.editor.any.bind.description=Bind to process attribute path
widget.process_data_block.editor.any.provider=Element provider
widget.process_data_block.editor.any.provider.description=Id of the provider that is going to supply values for the element
widget.process_data_block.editor.any.dict=Dictionary provider
widget.process_data_block.editor.any.dict.description=Id of the dictionary that is going to supply values for the element
+widget.process_data_block.editor.dictionaryAttribute=Dictionary attribute
+widget.process_data_block.editor.dictionaryAttribute.description=Attribute that is going to supply values for the element
widget.process_data_block.editor.any.readonly=Is read only
widget.process_data_block.editor.any.readonly.description=Should the use be prohibited from editing the element
widget.process_data_block.editor.any.caption=Caption
@@ -215,6 +228,7 @@ widget.process_data_block.editor.any.style=CSS styles
widget.process_data_block.editor.any.style.description=CSS styles as additional HTML classes for the element
widget.process_data_block.editor.any.attributeClass=Attribute class
widget.process_data_block.editor.any.attributeClass.description=Full name of implementation class that stores process attributes, default <u>pl.net.bluesoft.rnd.processtool.model.ProcessInstanceSimpleAttribute</u>
+widget.process_data_block.editor.any.required.humanName=Is required
widget.process_data_block.editor.any.required=Is required
widget.process_data_block.editor.any.required.description=Should the user be forced to provide value
widget.process_data_block.editor.any.maxLength=Max length

0 comments on commit 87e2ff1

Please sign in to comment.