Hello Cyril, Cyril Vidal wrote:
No, it works a bt different with attributes. In i18n:attr="..." you specify the attributes, that shell be translated. You have "value" in your above example, but there is no attribute "value", only "TYPE" and "NAME". So change it to i18n:attr="NAME" to get the value of the attribute "NAME" translated or add an attribute "value", which is used for the text on the button AFAIK. Furthermore the value of the attribute to translate is the key (above example: NAME="submit" => key = "submit"). This key must be used in the dictionary (=> <message key="submit"/>).Hi,If some of you would have some tips for these two questions, I would be very grateful: 1°) Under Cocoon 2.0.4 and Windows 2000: I use a i18n Transformer (with french and english dictionnaries), and all's working fine with elements' translation. But not for attributes. I have basicaly a HTML form with a submit button. As described in the Cocoon's doc, I write the following in my stylesheet to be translated: <input TYPE="submit" NAME="submit" i18n:attr="value"/> and in my French dictionary: <message key="value">Soumettre la requête</message> in my English dictionary: <message key="value">Submit the request</message> WHen I call http://localhost:8080/cocoon/tutoriel?locale=fr, I can see the correct value of the button, ie: 'Soumettre la requête'. But when I call english translation with http://localhost:8080/cocoon/tutoriel?locale=en, I still obtain the same french message, although I've specified the english version for this button's value in the english dictionary. Could it have to handle with the xerces's bug described in the doc??
With the Xerces bug you won't get anything as output I think. At least you would have a stack trace in the log files.
2°) In my styleshhet, I've got a second hidden input area. For each one, I have to use i18n:attr="value" in the sitemap and <message key="value">Some text</message> in the dictionary, I want to internationalise both (That's I want to do precisely...). So, Is it possible to make a difference between them? <FORM METHOD="GET" ACTION=""> <b><i18n:text>choix</i18n:text></b> <a href="?locale=fr"><i18n:text>choix_langue_fr</i18n:text></a> | <a href="?locale=en"><i18n:text>choix_langue_en</i18n:text></a> <input type="hidden" name="locale" value="fr"/> //First attribute value to internationalise => fr in french and en in english
Knowing the above at 1° this is no longer a problem: <input type="hidden" name="locale" value="locale" i18n:attr="value"/> -----------this is the key----------------^^^^^^ dictionary: <message key="locale">en</message> (or fr in the french dictionary)
<fieldset class="etiquette" style="padding: 10px; font-weight:bold; font-family:'Comic Sans MS'; color: #1E94D3 ; border: outset 5px;"> <legend><i18n:text>trier</i18n:text></legend> <input TYPE="radio" NAME="tri" VALUE="nom"><i18n:text>boutonNom</i18n:text></input> <input TYPE="radio" NAME="tri" VALUE="prénom"><i18n:text>boutonPrenom</i18n:text></input> <input TYPE="radio" NAME="tri" VALUE="titre"><i18n:text>boutonTitre</i18n:text></input> <input TYPE="radio" NAME="tri" VALUE="organisme"><i18n:text>boutonOrganisme</i18n:text></input> </fieldset> <br/> <input TYPE="submit" NAME="submit" i18n:attr="value"/> //Second attribute ton internationalise: Soumettre la requête in French Submit the request in English
Same here: <input TYPE="submit" NAME="submit" value="submit" i18n:attr="value"/> dictionary: <message key="submit">Soumettre la requête</message>
</FORM> thanks in advance for your repsnses, Best, Cyril.
Regards Joerg --------------------------------------------------------------------- Please check that your question has not already been answered in the FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html> To unsubscribe, e-mail: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>