Menu

how to internationalize column names?

Help
Anonymous
2004-06-10
2012-10-08
  • Anonymous

    Anonymous - 2004-06-10

    hello,

    i just discovered 'displaytag' and am pretty excited... it provides lots of functionality for free that we previously had to code in eg. sorting, paging. however, since our application is multilingual (english and german), we need to be able to display column names in both languages. previously, we rendered the column names using JSTL tags:
    <fmt:message key="..." bundle="${lang}"/>.

    how can i do this with displaytag?

    thanks,
    sharath

     
    • Anonymous

      Anonymous - 2004-06-10

      Hi,

      if you're using Struts with Displaytag, you could make use of the  <bean:define> tag calling a <bean:message> from an ApplicationResources.properties file  :

      <bean:define id="filenameHeader"><bean:message key="label.filename"/></bean:define>
      <bean:define id="sizeHeader"><bean:message key="label.size"/></bean:define>

        <display:table name="requestScope.myList">
          <display:column property="filenamer" title="<%=filenameHeader%>" />
          <display:column property="size" title="<%=sizeHeader%>" />
          <display:column property="link" title="" />
        </display:table>

       
      • Richard Tuquet Laburre

        is there not an easier solution to use columns title defined as key in applicationResources.properties

        I saw that there is a titleKey attribute but i don't know how can i use it (or attribute title) with the key name defined in the file.properties

        Thanks for all

         
        • Matt Raible

          Matt Raible - 2004-11-27

          It's in the documentation for RC2.

          http://displaytag.sourceforge.net/i18n.html

           

Log in to post a comment.

MongoDB Logo MongoDB