5 Replies Latest reply on Mar 11, 2010 7:31 AM by massep

    Issue with rich:calendar and internationalization

      This is driving me crazy. I don't know why but I can't render the rich:calendar component in my app.

       

      I'm getting the following exception: java.util.MissingResourceException: Can't find bundle for base name labels, locale es

      (labels_es.properties is the file name)

       

      It's odd because all I have in my .xhtml file is this:

       

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
          xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
          xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j">


          <body>
              <rich:calendar/>
          </body>

       

      </html>

       

      In addition, internationalization works just fine in the same page if I remove the calendar component and add something like:

       

      <h:outputText value="#{labels.titulo}" />

       

      Of course I'm loading the bundle and it's defined in the faces-config.xml:

       

          <application>
              <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
              <locale-config>
                  <default-locale>es</default-locale>
              </locale-config>
              <message-bundle>labels</message-bundle>
          </application>

       

      I tried adding the calendar labels to the bundle but nothing changed

       

      RICH_CALENDAR_TODAY_LABEL=Hoy
      RICH_CALENDAR_CLEAN_LABEL=Limpiar
      RICH_CALENDAR_APPLY_LABEL=Aplicar
      RICH_CALENDAR_CLOSE_LABEL=Cerrar
      RICH_CALENDAR_OK_LABEL=Ok
      RICH_CALENDAR_CANCEL_LABEL=Cancelar

       

      I also changed the locale to "en" but got the same error.

       

      I've been trying to fix this issue for the last 4 hours and I really don't know what else to do... could anyone help me please?

       

      Thanks in advance!

      Mariano

        • 1. Re: Issue with rich:calendar and internationalization
          ebross
          Where is your "full.path.to.your.es.resources.bundles.file" in your faces-confg or page?

          In your faces-config, try:

          <application>
                  <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                  <locale-config>
                      <default-locale>es</default-locale>
                  </locale-config>

                  <resource-bundle>
                   <base-name>full.path.to.your.es.resources.bundles.file</base-name>
                   <var>labels</var>
                  </resource-bundle>


              </application>

          Better performance as the ResourcesBundles file is loaded at the application level.


          Alternatively -- but a bit an old fashion style --, you can do:

          <f:view ...>

          <f:loadBundle basename ="full.path.to.your.es.resources.bundles.file" var ="labels"/>

          </f:view>

          Poor performance as the ResourcesBundles file is loaded per each request.



          • 2. Re: Issue with rich:calendar and internationalization
            ilya_shaikovsky

            Cheked:

            created labels.properties and added

             

            RICH_CALENDAR_TODAY_LABEL=Hoy
            RICH_CALENDAR_CLEAN_LABEL=Limpiar
            RICH_CALENDAR_APPLY_LABEL=Aplicar
            RICH_CALENDAR_CLOSE_LABEL=Cerrar
            RICH_CALENDAR_OK_LABEL=Ok
            RICH_CALENDAR_CANCEL_LABEL=Cancelar

             

            there

             

            defined

             

            <message-bundle>labels</message-bundle>

             

            in faces-config

             

            calendar get labels from properties.

            • 3. Re: Issue with rich:calendar and internationalization
              massep

              Hi,

               

              Had to revive this post.

               

              I'm using 3.3.1 and I have an issue with the French version of months. I see that it's working fine on your demo site but,

              on my page, the french accent are displayed as unicode. For example, "é" is displayed as &#233;.

               

              The popup that appears when you click the calendar month, shows a list of month and year. On that popup, the abbreviated

              month name display fine, I see the "é".

               

              I tried upgrading to 3.3.2 but that didn't resolve the issue.

               

              I searched the web for a while but can't find a solution to this.

               

              Any idea what I could try next?

               

               

              Thanks

              • 4. Re: Issue with rich:calendar and internationalization
                nbelaevski

                Hi Pierre,

                 

                Are you using MyFaces?

                • 5. Re: Issue with rich:calendar and internationalization
                  massep
                  No. Using JSF 1.2.10.