Hallo

now I begin to work in " il8n " with woody. The validition message can be
changed good in diffrent language, but not Label in a Form.
(Maybe I have not know well about woody)

So I have checked the method:

 public void generateLabel(ContentHandler contentHandler) throws
SAXException 

 in org.apache.cocoon.woody.formmodel.AbstractWidgetDefinition, and I added
some code
like this:

    public void generateLabel(ContentHandler contentHandler) throws
SAXException {
        if (label != null) {
                        contentHandler.startPrefixMapping("i18n",
I18nTransformer.I18N_NAMESPACE_URI);
                        AttributesImpl i18nAttrs = new AttributesImpl();
        
i18nAttrs.addCDATAAttribute(I18nTransformer.I18N_NAMESPACE_URI,
I18nTransformer.I18N_CATALOGUE_ATTRIBUTE,      
                           "i18n:" +
I18nTransformer.I18N_CATALOGUE_ATTRIBUTE, "woody");      
        
contentHandler.startElement(I18nTransformer.I18N_NAMESPACE_URI,
I18nTransformer.I18N_TEXT_ELEMENT, 
                           "i18n:" + I18nTransformer.I18N_TEXT_ELEMENT,
i18nAttrs);
                        XMLByteStreamInterpreter interpreter = new
XMLByteStreamInterpreter();
                        interpreter.setContentHandler(contentHandler);
                        interpreter.deserialize(label);
        
contentHandler.endElement(I18nTransformer.I18N_NAMESPACE_URI,
I18nTransformer.I18N_TEXT_ELEMENT, "i18n:"
                           + I18nTransformer.I18N_TEXT_ELEMENT);
                        contentHandler.endPrefixMapping("i18n");        

        }
    }

and then I have no problem about il8n of Label.

So I think maybe better to change the class like this, or then please help
me and tell me how to do with il8n of Label.

the attachment is the class which I have changed. 
<<AbstractWidgetDefinition.java>> 

Attachment: AbstractWidgetDefinition.java
Description: Binary data

Reply via email to