11 Replies Latest reply on Nov 24, 2009 7:35 AM by *ninho*

    change locale of

    gamba

      Hi,

      I'm using the rich:calendar component with a german Locale. Months and years are correct in german language but the {todayControl} always is "Today", also the "Clean" control in the footer.

      How can I change it to german locale, is it a bug?

      BTW: The code I'm using

      <rich:calendar value="#{props.attributeDateValue}" locale="Locale.DE"
       datePattern="dd.MM.yyyy"
       popup="true" showApplyButton="false"
       showWeekDaysBar="false" showWeeksBar="false"
       cellWidth="22px" cellHeight="20px"
       buttonIcon="#{msg.imageCalendar}">
      
       <f:facet name="footer">
       <h:outputText value="{todayControl}" />
       </f:facet>
      </rich:calendar>
      


      Thx
      Gamba


        • 1. Re: change locale of
          nbelaevski

          Hi Gamba,

          This can be localized using message bundles. Please take a look at users guide.

          • 2. Re: change locale of
            gamba

            Thank you for the answer,

            I know about message bundles. But I did not know that I have to change values for system bundles or framework bundles like richfaces.

            I thougt that changing the locale to german all bundle-values will appear in german. For the months it works, but not for the footer. So, this is an error in the german message bundle for richfaces?

            Thx
            Gamba

            • 3. Re: change locale of
              nbelaevski

              There's no german localization bundle.

              • 4. Re: change locale of
                gamba

                Ok, found it in the docs. I 've read an old documentation ... thx

                • 5. Re: change locale of
                  gamba

                  I added the following messages in my resource bundle, but nothing changed in my webapp. The code of the app is the one from above:

                  # RichFaces-Calnedar labels
                  RICH_CALENDAR_TODAY_LABEL = Heute
                  RICH_CALENDAR_CLEAN_LABEL = Leeren
                  RICH_CALENDAR_CANCEL_LABEL = Abbrechen

                  Any hints?

                  • 6. Re: change locale of
                    ilya_shaikovsky

                     

                    in my resource bundle


                    in application resource bundle?

                    • 7. Re: change locale of
                      gamba

                      I think so. I'm using this code in my faces-config.xml:

                      <application>
                       ...
                       <locale-config>
                       <default-locale>de</default-locale>
                       </locale-config>
                       <message-bundle>messages</message-bundle>
                       <resource-bundle>
                       <base-name>messages</base-name>
                       <var>msg</var>
                       </resource-bundle>
                      </application>
                      


                      All other keys - values inside my messages.properties are found. But the Richfaces keys are not found ...


                      • 8. Re: change locale of
                        gamba

                        Ok I got it ....

                        After adding the additional

                        <message-bundle>messages</message-bundle>

                        know all keys are found ... without the message-bundle-tag, which I placed there after my previous thread-entry the keys were not found ...

                        Thx

                        • 9. Re: change locale of

                          I'm having the same problem Gamba, you managed to solve this?

                          I put the name of my file calendar_pt_BR.properties package org.richfaces.renderkit.calendar and does not work.

                          Can anyone help?

                          Thanks

                          • 10. Re: change locale of
                            hwoarang

                            Hi Ninho!

                            - Create a file (e.g.) mensagens.properties and put it in any package of you project (like util).

                            - Add the following messages in your mensagens.properties:

                            # Labels para Richfaces Calendar
                            RICH_CALENDAR_TODAY_LABEL = Hoje
                            RICH_CALENDAR_CLEAN_LABEL = Limpar
                            RICH_CALENDAR_CANCEL_LABEL = Cancelar
                            


                            - Register your message file as resource bundle, in faces-config.xml:
                            <application>
                             <locale-config>
                             <supported-locale>pt_BR</supported-locale>
                             </locale-config>
                             <message-bundle>util.mensagens</message-bundle>
                             </application>
                            


                            Try it. Works for me.

                            • 11. Re: change locale of

                              Hi Hwoarang

                              That way I had managed to make work, but I wonder if you are using the package org.richfaces.renderkit.calendar, but for the organization.

                              Thanks for the help...