9 Replies Latest reply on Dec 22, 2009 9:00 AM by 727941

    How to localize operator labels on af:query

    611059
      Hi,

      I have localized af:query component by using skin resource bundle. I still need to change labels for operators. On af:query there are select one choice components that can be used for operator selection. Labels for operators are: "Not equal to","Starts with", "Ends with",... These can not be customised through skin boundle. I think that these labels are defined in class oracle.jbo.CSMessageBoundle.java and they are localized in more then twenty languages but not in the one I need. I tried to create custom MessageBundle for my model project with keys I found in CSMessageBundle. It did not work.
      Does anyone knows how to solve this.
      Thanks!!!

      Maxa
        • 1. Re: How to localize operator labels on af:query
          didier - oracle
          Hi Maxa,

          they are located in oracle/jbo/CSMessageBundle.java since JDev 11.1.1.1.0
          (fix for Bug 7532424 - "SEARCH AND SELECT" DIALOG ALWAYS INCLUDES SEARCH CRITERIA OPERATORS IN ENGLISH).

          Which language are you using ?

          Regards,

          Didier.
          • 2. Re: How to localize operator labels on af:query
            611059
            Thanks for reply!

            I use Serbian language.
            • 3. Re: How to localize operator labels on af:query
              725782
              Can you please try
              <f:view locale="sr">
              and check if it changes the query labels
              • 4. Re: How to localize operator labels on af:query
                611059
                Thanks Onur,

                it doesn't change them, they are still in English.
                • 5. Re: How to localize operator labels on af:query
                  729205
                  Hi Maxa, is this question resolved? If yes then please update the forum...!
                  Thanks, Kedar
                  • 6. Re: How to localize operator labels on af:query
                    611059
                    It is solved!!!

                    Like I said that operator labels are localized in java class oracle.jbo.CSMessageBoundle.java (adfm.jar). In my ViewController project I have created class oracle.jbo.CSMessageBoundle_sr.java. I have found needed bundle keys from CSMessageBoundle.java, and put them in CSMessageBoundle_sr.java with new localized values. I entered sr as supported locale and the problem is solved.
                    This is only temporary until Oracle creates sr localization.

                    Edited by: Maxa on Dec 14, 2009 12:25 PM
                    • 7. Re: How to localize operator labels on af:query
                      727941
                      Hi Maxo,

                      I feel stupid for writing in English here, but lets follow the procedure : ).
                      One short question for you: how did you manage to customize af:query? I need only to change Search and Reset buttons and Match radio button (to localize it to Serbian).

                      I have tried to create custom class that extends ListResourceBundle and so on... But it doesn't work : (

                      Thanks a lot,
                      Goran
                      • 8. Re: How to localize operator labels on af:query
                        611059
                        Hi Gorane,

                        you have to create and apply new custom skin for your application. Register new resource bundle for that new skin and in that resource bundle you redefine labels for ui components.
                        For creating custom skin look at: "Web User Interface Developer’s Guide for Oracle Application Development Framework" chapter: "20 Customizing the Appearance Using Styles and Skins".

                        To find out what keys you need to override check out these link:

                        Re: Keys in ResourceBundle


                        Here is my resource bundle class with keys for query:

                        package com.mycomp.myapp.resources;
                        
                        import java.util.ListResourceBundle;
                        
                        public class MyAppSkinBundle extends ListResourceBundle {
                            public MyAppSkinBundle() {
                                super();
                            }
                            
                            public Object[][] getContents()
                            {
                                return contents;        
                            }    
                            static final Object[][] contents = {
                                    {"af_dialog.OK","U redu"},//ok
                                    {"af_dialog.CANCEL","Odustani"},//ok
                                    {"af_dialog.LABEL_OK", "U redu"},
                                    {"af_dialog.LABEL_CANCEL", "Odustani"},
                                    {"af_dialog.LABEL_YES", "Da"},
                                    {"af_dialog.LABEL_NO", "Ne"},
                                    {"af_panelWindow.CLOSE", "Zatvori"},
                                    {"af_document.LABEL_SPLASH_SCREEN","U\u010Ditavanje"},            
                                    {"af_document.SPLASH_SCREEN_MESSAGE","Dobrodo\u0161li"},
                                    {"af_selectManyShuttle.MOVE", "Prebaci"},//ok
                                    {"af_selectManyShuttle.MOVE_ALL", "Prebaci sve"},//ok
                                    {"af_selectManyShuttle.REMOVE", "Vrati"},//ok
                                    {"af_selectManyShuttle.REMOVE_ALL", "Vrati sve"},//ok
                                    {"af_panelCollection.Detach", "Ra\u0161iri tabelu" },
                                    {"af_table.Detach", "Ra\u0161iri tabelu" },
                                    {"af_panelWindow.Detach", "Ra\u0161iri tabelu" },
                                    {"af_dialog.Detach","Uredu"},
                                    {"af_panelSplitter.COLLAPSE_PANE","Skupi prozor"},
                                    {"af_panelCollection.MENU_VIEW", "Prikaz"},
                                    {"af_panelCollection.MENUITEM_DETACH", "Ra\u0160iri"},
                                    {"af_panelCollection.MENUITEM_COLUMNS_SHOWALL", "Prika\u017Ei sve"},
                                    {"af_panelCollection.MENUITEM_COLUMNS_SHOWMORECOLUMNS", "Prika\u017Ei jo\u0161 kolona..."},
                                    {"af_panelCollection.MENUITEM_REORDER", "Preuredi kolone..." },
                                    {"af_panelCollection.MENU_COLUMNS", "Kolone"},
                                    {"af_panelCollection.SHOW_COLUMNS", "Prika\u017Ei kolone"},
                                    {"af_panelCollection.REORDER_COLUMNS", "Preuredi kolone"},
                                    {"af_panelCollection.HIDDEN_COLUMNS", "Skrivene kolone"},
                                    {"af_panelCollection.VISIBLE_COLUMNS", "Vidljive kolone"},
                                    {"af_panelCollection.DETACH_DIALOG_TITLE", "Ra\u0161irena tabela"},
                                    {"af_table.FETCHING", "Dobavljanje podataka..."},
                                    //Lokalizovanje labela na Search popupu
                                    {"af_query.LABEL_MODE_BASIC", "Osnovni"},
                                    {"af_query.LABEL_MODE_ADVANCED", "Napredni"},
                                    {"af_query.LABEL_HEADER_TEXT", "Pretraga"},
                                    {"af_query.LABEL_REQUIRED_INFO_TEXT", "Obavezno"},
                                    {"af_query.LABEL_INDEXED_INFO_TEXT", "Bar jedan je neophodan"},
                                    {"af_query.LABEL_FOOTER_ADD_FIELDS", "Dodaj polja"},
                                    {"af_query.LABEL_CONJUNCTION", "Poklapanje sa"},
                                    {"af_query.LABEL_CONJUNCTION_AND", "svim"},
                                    {"af_query.LABEL_CONJUNCTION_OR", "bilo kojim"},
                                    {"af_query.LABEL_MODE_BASIC", "Osnovna"},
                                    {"af_query.LABEL_MODE_ADVANCED", "Napredna"},
                                    {"af_query.LABEL_SCREEN_READER_MODE_BASIC", "Osnovna pretraga"},
                                    {"af_query.LABEL_SCREEN_READER_MODE_ADVANCED", "Napredna pretraga"},
                                    {"af_query.LABEL_SAVE", "Sa\u010Duvaj..."},
                                    {"af_query.LABEL_RESET", "Obri\u0161i"},
                                    {"af_query.LABEL_SEARCH", "Pretra\u017Ei"},
                                    {"af_query.LABEL_DELETE", "Obri\u0161i"},
                                    {"af_query.LABEL_DUPLICATE", "Dupliciraj"},
                                    {"af_query.LABEL_APPLY", "Primeni"},
                                    {"af_query.LABEL_DUPLICATE_NAME_PREFIX", "kopijaOd_"},
                                    {"af_query.LABEL_SAVED_SEARCH", "Sa\u010Duvana pretraga"},
                                    {"af_query.LABEL_SAVED_SEARCH_PERSONALIZE_ENTRY", "Prilagodi..."},
                                    {"af_query.LABEL_PERSONALIZE_SAVED_SEARCHES_DLG", "Prilagodi sa\u010Duvane pretrage"},
                                    {"af_query.LABEL_CREATE_SAVED_SEARCH_DLG", "Kreiraj sa\u010Duvanu pretragu"},
                                    {"af_query.LABEL_SAVED_SEARCH_NAME", "Naziv"},
                                    {"af_query.LABEL_UIHINT_SAVE_RESULTS_LAYOUT", "Sa\u010Duvaj izgled rezultata"},
                                    {"af_query.LABEL_UIHINT_AUTO_EXECUTE", "Pokreni automatski"},
                                    {"af_query.LABEL_UIHINT_SHOW_IN_LIST", "Prikaži u listi pretraga"},
                                    {"af_query.LABEL_UIHINT_DEFAULT", "Postavi za podrazumevano"},
                                    {"af_query.MSG_SAVED_SEARCH_NAME_UNIQUE_CONSTRAINT", "Pretraga sa ovim imenom ve\u0107 postoji."},
                                    {"af_query.MSG_SAVED_SEARCH_NAME_UNIQUE_CONSTRAINT_DETAIL", "Morate obezbediti jedinstveno ime."},
                                    {"af_query.MSG_SAVED_SEARCH_NAME_NOTNULL_CONSTRAINT", "Ime je potrebno"},
                                    {"af_query.MSG_SAVED_SEARCH_NAME_NOTNULL_CONSTRAINT_DETAIL", "Molimo Vas unesite validno ime za sa\u010Duvanu pretragu."},
                                    {"af_query.MSG_SAVED_SEARCH_DELDUP_CONSTRAINT", "Potrebno je odabrati sa\u010Duvanu pretragu"},
                                    {"af_query.MSG_SAVED_SEARCH_DELETE_CONSTRAINT_DETAIL", "Molimo Vas odaberite validnu sa\u010Duvanu pretragu za brisanje."},
                                    {"af_query.MSG_SAVED_SEARCH_DELETE_WARNING", "Obri\u0161i sa\u010Duvanu pretragu: {0}?"},
                                    {"af_query.MSG_SAVED_SEARCH_DUPLICATE_CONSTRAINT_DETAIL", "Molimo Vas odaberite validnu sa\u010Duvanu pretragu za dupliranje."},
                                    {"af_query.TIP_DELETE_SEARCH_FIELD", "Ukloni: {0}"},
                                    {"af_query.TIP_DELETE_WARNING", "Upozorenje"},
                                    {"af_query.TIP_OPERATOR", "Operatori za"},
                                    {"af_query.LABEL_VALUE_LOV_POPUP", "Pretra\u017Ei i odaberi:"},
                                    {"af_quickQuery.LABEL_DEFAULT", "Pretraga"},
                                    {"af_quickQuery.LABEL_VALUE_LOV_POPUP", "Pretra\u017Ei i odaberi:"}
                            };        
                        }
                        You can see that I had to use UTF codes for serbian letters.
                        //š \u0161
                        //Š \u0160
                        //č \u010D
                        //Č \u010C
                        //ć \u0107
                        //Ć \u0106
                        //ž \u017E
                        //Ž \u017D
                        //đ \u0111
                        //Đ \u0110


                        I will be glad to answer on any other question!!!

                        Maxa
                        • 9. Re: How to localize operator labels on af:query
                          727941
                          Thanks Maxo,

                          It's soved!

                          Problem was in my trinidad-skins.xml. I haven't wrote <style-sheet-name> tag cause I tought it was unnecesery. It turns out to be a big mistake.
                          For future references, here is how it supose to look like:

                          Java bundle:
                          import java.util.ListResourceBundle;
                          
                          public class SkinBundle extends ListResourceBundle{
                              public SkinBundle() {
                                  super();
                              }
                              
                          @Override
                              public Object[][] getContents() {
                                  return _CONTENTS;
                              }
                          
                              static private final Object[][] _CONTENTS = {
                                  {"af_query.LABEL_RESET", "Poništi"},
                                  {"af_query.LABEL_SEARCH", "Traži"},
                                  {"af_query.LABEL_CONJUNCTION", "Pretraži"},
                                  {"af_query.LABEL_CONJUNCTION_AND", "Sve"},
                                  {"af_query.LABEL_CONJUNCTION_OR", "Bilo koji"}
                              };
                          }
                          trinidad-skins.xml (if does not exist, it should be created)
                          <?xml version="1.0" encoding="ISO-8859-1"?>
                          <skins xmlns="http://myfaces.apache.org/trinidad/skin">
                            <skin>
                              <id>myfamily.desktop</id>
                              <family>myfamily</family>
                              <extends>fusion.desktop</extends>
                              <render-kit-id>org.apache.myfaces.trinidad.desktop</render-kit-id>
                              <style-sheet-name>Styles/styles.css</style-sheet-name>
                              <bundle-name>mypackage.SkinBundle</bundle-name>
                            </skin>
                          </skins>
                          Note: <style-sheet-name> tag and styles.css must exist, even empty!!

                          And finnaly, trinidad-config.xml
                          <?xml version="1.0" encoding="windows-1252"?>
                          <trinidad-config xmlns="http://myfaces.apache.org/trinidad/config">
                            <skin-family>myfamily</skin-family>
                          </trinidad-config>
                          Thanks for help Maxo!