6 Replies Latest reply on Mar 2, 2009 7:01 AM by sebekk23

    localization/internationalization extendedDataTable

    devonbl


      I'm using richfaces 3.3.0 using extended data table. I need to localize the text for extended data table. I tried to pass in the "lang" attribute but that didn't seem to do it. Does anyone have any advice for how I can get translated text into this table?

      Thank you,
      devon.lindsey@garmin.com

        • 1. Re: localization/internationalization extendedDataTable
          nbelaevski

          Hello,

          It should be possible to localize it either using org.richfaces.component.messages or application-defined message bundle. Here is an example of this file:

          org.richfaces.component.UIExtendedDataTable.Menu.Columns=Columns
          org.richfaces.component.UIExtendedDataTable.Menu.SortAscending=Sort Ascending
          org.richfaces.component.UIExtendedDataTable.Menu.SortDescending=Sort Descending
          org.richfaces.component.UIExtendedDataTable.Menu.GroupByColumn=Group by this column
          org.richfaces.component.UIExtendedDataTable.Menu.DisableGrouping=Disable Grouping
          org.richfaces.component.UIExtendedDataTable.NoData=No data


          Try setting locale explicitly on f:view tag or selecting another locale in browser settings.

          • 2. Re: localization/internationalization extendedDataTable
            devonbl

            nbelaevski,
            Thanks so much for responding but I'm not sure exactly what your instructions are here. I'm essentially wondering where and how I can create the "application-defined message bundle." I have dynamic bundles and property files, but how do I get the extended data table to point to those translated values?
            Moreover, why doesn't this element work like the other richfaces elements, like the calendar, where it reads locale from the session?

            Any help is appreciated!
            Devon.lindsey@garmin.com

            • 3. Re: localization/internationalization extendedDataTable
              nbelaevski

              Application-defined message bundle is configured by adding something like this to faces-config.xml:

              <application>
               <locale-config>
               <default-locale>en</default-locale>
               <supported-locale>en</supported-locale>
               <supported-locale>en_US</supported-locale>
               <supported-locale>de</supported-locale>
               </locale-config>
               <message-bundle>
               de.laliluna.tutorial.messageresource.MessageResources
               </message-bundle>
              </application>
              and adding properties files in classpath. Another way to localize this is creating org.richfaces.component.messages message bundle in application classpath (this is predefined name, you don't have to configure this in faces-config.xml).

              Calendar takes date formatting symbols from JDK, another text elements (e.g. "Today") need localization through message bundles.

              • 4. Re: localization/internationalization extendedDataTable
                devonbl

                Thanks again for the reply nbelaevski.
                I'm wondering if you can point me to whereever the calendars message bundles are, and perhaps I can follow that model for extended data table? Because my biggest concern at this point is why I have to handle the behaviors of the objects differently.
                We have registered property files, i have all of our local's configured properly, our entire site is localized, I'm just trying to figure out how to make the extended data table read our property files.
                Thanks,
                Devon.lindsey@garmin.com

                • 5. Re: localization/internationalization extendedDataTable
                  nbelaevski

                  About calendar: there are not much examples. Here is the information - the following properties are used for localization:

                  RICH_CALENDAR_APPLY_LABEL
                  RICH_CALENDAR_TODAY_LABEL
                  RICH_CALENDAR_CLOSE_LABEL
                  RICH_CALENDAR_OK_LABEL
                  RICH_CALENDAR_CLEAN_LABEL
                  RICH_CALENDAR_CANCEL_LABEL

                  Either application message bundle (defined in faces-config.xml) or classpath org.richfaces.renderkit.calendar (e.g. org/richfaces/renderkit/calendar_de.properties file) can be used.

                  Back to extendedDataTable. richfaces-impl.jar already contains localization for several languages (org/richfaces/component/messages.properties). You can either create your own .jar containing localization files by this path and use this .jar file to localize several applications, or configure application message bundle and add org.richfaces.component.UIExtendedDataTable.* messages there.

                  • 6. Re: localization/internationalization rich:picklist
                    sebekk23

                    Is it right way to change inscription on picklist buttons ?

                    org.richfaces.component.UIPickList.RICH_PICK_LIST_COPY_ALL_LABEL=test
                    org.richfaces.component.UIPickList.RICH_PICK_LIST_COPY_LABEL=test
                    org.richfaces.component.UIPickList.RICH_PICK_LIST_REMOVE_ALL_LABEL=test
                    org.richfaces.component.UIPickList.RICH_PICK_LIST_REMOVE_LABEL=test