getMessage in Jelluy script

lomouhamadou
Kilo Guru

Hi all,

I have this jelly script in a UI page (HTML part)

<?xml version="1.0" encoding="utf-8" ?>

<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">

<button id="add_attachment" type="button" onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">Add Attachment</button>

</j:jelly>

The part in "RED" is not translated. The button is labelled "Add attachment in all language.

I want to get it translated and I have a message called add_attachment.

What is the syntax to use getMessage in this case to call my message which will set the value of the button?

Thanks in advance for your help.

Regs,

Lô Mouhamadou

1 ACCEPTED SOLUTION

Chuck Tomasi
Tera Patron

Here you go



<?xml version="1.0" encoding="utf-8" ?>



<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">



<button id="add_attachment" type="button" onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">${gs.getMessage(


'Add Attachment')}</button>



</j:jelly>



***Add the appropriate entries to System UI> Messages with the key "Add Attachment" (if they do not already exist.


View solution in original post

4 REPLIES 4

Deepa Srivastav
Kilo Sage

Check if below helps you:-



Sample code using getMessage:-



<j:if test="${jvar_oi_order_now_button_override == 'true'}">


                                      <g:evaluate jelly="true" expression="var sc_order_now_label=gs.getMessage(jelly.jvar_sc_order_now_label);" />


                                      <g:sc_button classes="request_catalog_button_with_icon" img="images/button_cursor.gifx" id="oi_order_now_button" onclick="if ($$('.order_buttons .disabled_order_button').length == 0) { orderItemWidget.orderNow(); } else { alert('${gs.getMessage('Please wait - price being updated')}'); }" label="${sc_order_now_label}" title="${sc_order_now_label}" isPrimary="true"/>                                        


                              </j:if>



Second Parameter of getMessage() on Client Side



Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.


Thanks,
Deepa


Chuck Tomasi
Tera Patron

Here you go



<?xml version="1.0" encoding="utf-8" ?>



<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">



<button id="add_attachment" type="button" onclick="saveCatAttachment(gel('sysparm_item_guid').value, 'sc_cart_item')">${gs.getMessage(


'Add Attachment')}</button>



</j:jelly>



***Add the appropriate entries to System UI> Messages with the key "Add Attachment" (if they do not already exist.


Hi Chuck,



Thanks. it works fine.



a small question still for more or less the same issue.


How does it work for this button, please?


Still In Jelly/html part



<input type='button' value='Download PDF' onClick='downloadPDF()'/>


this one works fine to. however pdf is generated but not attached in the Record producer then to the case