11 Replies Latest reply on Nov 24, 2009 7:35 AM by Ronan Silva

    change locale of

    gamba Newbie

      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
          Nick Belaevski Master

          Hi Gamba,

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

          • 2. Re: change locale of
            gamba Newbie

            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
              Nick Belaevski Master

              There's no german localization bundle.

              • 4. Re: change locale of
                gamba Newbie

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

                • 5. Re: change locale of
                  gamba Newbie

                  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 Master

                     

                    in my resource bundle


                    in application resource bundle?

                    • 7. Re: change locale of
                      gamba Newbie

                      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 Newbie

                        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
                          Ronan Silva Newbie

                          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
                            Flavio Henrique Newbie

                            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
                              Ronan Silva Newbie

                              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...