2 Replies Latest reply on Sep 6, 2006 8:11 AM by Wensheng Li

    i18n problem

    Wensheng Li Newbie

      can anyone help me on setting chinese portlet title? I tried to modify portlet.xml with chinese title, but the server throws exceptions when starting.

        • 1. Re: i18n problem
          Antoine Herzog Master

          the default feature may have a bug or has no been tested yet with the use of chinese characters. but before : make sure of that : What is the exception ? what do it say ?

          may be, to work around, you can set the title in the portlet code, instead of using the default feature provide with jboss portal (that takes it from the descriptor and put it in the title).

          the code method is response.setTitle("my_title");
          (in the doView method)

          if you want to be able to change this title from the descriptor (and not modify the code each time you want to change it), then you can use in the portlet code a value that is taken from :
          - the resource bundle related to the portlet : you set the title in a property that you get when you do the setTitle method. (see the example in the user document. If I remember well, there is a resource bundle example with the title defined in this file.
          - an init-parameter of the portlet. The same way, you get it in the code and set the title with it.

          feel free to ask more details if this is not clear or not compliant with what you want to do.

          I am working on a i18n portal. Now it will be english and french, but I will have to make the chinese version... sooner or later.
          I build it from the begining to be able to be translated in chinese (and many languages).
          so any other problem you may encounter are welcome to know and see if I can help to solve it : I can see in advance what won't be easy when adding the chinese version.

          Talking in the forum is better for sharing the experience. if needed, you can also contact me : http://www.sysemo.com/Sysemo-consultant-Antoine-Herzog.php

          • 2. Re: i18n problem
            Wensheng Li Newbie

            Thank you for your helpful reply, Antoine. I solved the problem by modifying the first line of portlet.xml to <?xml version="1.0" encoding="gbk"?> and setting title element value to chinese. I found the encoding is the key, if it is set to utf-8, the server will throw sax related exception.