Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    i18n for LoginDialog

    Hi, I am using standard (static string) GWT i18n for my SmartGWT app, and it works OK, all system messages are properly translated.

    However, when I show the login dialog (executing $wnd.isc.showLoginDialog() via JSNI), the I18N settings do not seem to take effect.

    I am sure that i18nutil.init() has run by then, and if I put up a dialog
    in the following/next like (like SC.ask("sure?", null) ), its i18n-d.

    What could be wrong?

    Thank you for your help!

    #2
    Which specific strings aren't i18n, for which language pack, and for what version of SGWT? Have you checked whether the strings are actually available on the language pack?

    Comment


      #3
      SmartGWT-EE Eval nightly build.

      I am sure the strings are actually available, because when showing various dialogs (like SC.ask()), and they work OK.

      In login dialog, none of the strings appear.
      (username, password, button title, window title, all in English.)

      Originally, I have encountered this problem in Hungarian, my native language, which I have just integrated into SGWT. (Translated the properties files myself, and placed it where it belongs.)

      But just to test, I have switched to German, and the situation is the same. (Generally, i18n works, except the login dialog, which seems to be immune to it.)

      * * *

      The only difference between the other dialogs (where I18N works) and this is that I use it via JSNI, since no java wrapper is available.

      Comment


        #4
        What are the actual Strings involved (in English) and what date is your nightly build from?

        It probably is the JSNI usage - as long as you are using JSNI you could use the i18n system to configure those strings directly.

        Comment


          #5
          Exact version: SC_SNAPSHOT-2010-02-09/EVAL Deployment

          English strings:

          "Log in"
          "Invalid username or password"
          "Please log in"
          "Password"
          "Username"

          * * *

          How do I configure them directly?
          I18nUtil already executes

          Code:
          $wnd.isc.Dialog.addClassProperties({LOGIN_TITLE: messages.@com.smartgwt.client.i18n.SmartGwtMessages::dialog_LoginTitle()()});
          , but this has no effect on the login dialog.

          Right now, I am passing a JS array of parameters to $wnd.isc.showLoginDialog as a second argument, and this works so some extend, but I still can not override "username" and "password"..

          Code:
          var props = {
          	title: "window title test",
          	USERNAME_TITLE: "username test",
          	passwordTitle: "password test",
          	loginButtonTitle: "login test",
          	errorMessage: "error test"
          };
          $wnd.isc.showLoginDialog(<callback function>, props);
          This way, everything is overridden, except "username" and "password".

          Comment


            #6
            The last two that you need are usernameItemTitle and passwordItemTitle - all are doc'd (for SmartClient).

            Comment


              #7
              Well, according to

              http://www.smartclient.com/docs/7.0r...%3Dlogindialog
              , the settings should be usernameTitle and passwordTitle.

              Where is usernameItemTitle and passwordItemTitle doc'd?

              Comment


                #8
                Those are different properties (notice the capitalization).

                They are doc'd in 8.0 nightlies of SC, which is what you need to refer to if you want to use JSNI within SGWT.

                Backing up a step, a login dialog is not that hard to write from scratch, you may not have chosen the easiest path here.

                Comment


                  #9
                  Originally posted by Isomorphic
                  Those are different properties (notice the capitalization).

                  They are doc'd in 8.0 nightlies of SC, which is what you need to refer to if you want to use JSNI within SGWT.
                  1. Are these docs available somewhere online, or should I download the SC nighly builds, and read the docs offline?

                  2. Until yesterday, I have been using SmartGWT 2.0 Pro, which is based on SC 7.0 RC2, so the 7.0 docs should be relevant to it, but I could not get the mentioned two field to work, whatever I did.

                  Comment


                    #10
                    1. You need to download the full nightly

                    2. SmartGWT Pro 2.0 is not based on 7.0RC2, but on an early build of SC 8.0.

                    Comment


                      #11
                      Originally posted by Isomorphic
                      SmartGWT Pro 2.0 is not based on 7.0RC2, but on an early build of SC 8.0.
                      Indeed. I remember that I have read somewhere that SmartGWT 2.0 is based on SmartClient 7.0, but unfortunately I can not recall where I saw this misinformation.

                      Thank you for clearing this up, anyway.

                      Comment


                        #12
                        Originally posted by Isomorphic
                        The last two that you need are usernameItemTitle and passwordItemTitle.
                        Anyway, that worked, thank you.

                        Comment

                        Working...
                        X