简体   繁体   中英

How to switch the language of the Struts2?

I use Struts2 and Struts2-Jquery, for example to preper my calendar I do this.

<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>

<sj:datepicker id="fecini" name="oferta.finiOferta"
                placeholder="dd/mm/aaaa" displayFormat="yy-mm-dd" minDate="0"
                data-mask="99/99/9999" />

But the calendar show me the names of months and days in English (by default), i need to show it in Spanish.

What can i do in this case?

The <sj:head> tag allows you to set locale. Use locale.language OGNL expression to get current language.

<sj:head locale="%{locale.language}" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM