Forum Stats

  • 3,839,853 Users
  • 2,262,545 Discussions
  • 7,901,078 Comments

Discussions

OHW: localeSettings element & Asian languages


I'm using OHW for on-line help for our internationalized product, and have come across some interesting issues, especially when running under an Asian language such as Japanese or Chinese.

Using the recommended one servlet for each locale, I used the OHW example instructions and created a Japanese servlet, with the localesettings element set to...

<localeSettings>
<locale language="ja" country="JP" />
<controlFileEncoding encoding "Shift_JIS">
</localeSettings>

When I run this servlet on either my English or Japanese Win2K machine, the labels for the Index, Contents and Search tabs aren't localized (remain in English). The "Go" button, the "View Topic" tab and the "Printable Page" is garbled (boxes -- usually indicating problems with fonts.) What is also interesting on my Japanese Win2K machine, if I run the English servlet (the OHW example with no modifications to <localeSettings>, then these tabs have English labels until I switch to a different helpset. After that, the tab labels do indeed have Japanese text with no garbled characters. OHW does not have any trouble displaying the actual help content in Japanese. I also set up a Simplified Chinese servlet and it has similar problems displaying the tab labels. All of these tests were using IE properly configured for the locales; the Japanese Win2K machine uses JDK1.3.1_04 for JAVA_HOME, the English Win2K machine uses JDK1.4.0_02.

For further testing, I set up a German and French servlet, they had no garbled text, but also on occasion would not switch the tabs to German or French until I selected a different helpset.

Do you have a good example of ohwconfig.xml for running a Japanese servlet? (other Asian languages would be a plus...) From the OHW documentation, it appears that you should be able to run servlets in multiple locales on the same system, is this correct? As well, what is the relationship between the <localeSettings> element and the JVM's system default locale; which takes precendence? From my test with my Japanese Win2K machine, it appears that the system default locale wins out. Even though I set up an English servlet with the localSettings to "en" and "US", the tab labels and OHW user interface were displayed in Japanese.

thanks,

Elizabeth Dyer.

Comments

  • 307050
    307050 Member Posts: 163
    Elizabeth:

    The problems you describe sound like ones that existed in previous versions and have been resolved as of the most recent version of OHW, version 1.1.1. In previous versions, it was possible for different parts of the application to use different locale settings. In OHW 1.1.1, the localeSettings section of the ohwconfig.xml file drives all parts of the UI. (And BTW, your ohwconfig.xml snippet looks good.)

    So, can you try using OHW 1.1.1 if you're not already? It's available at: http://otn.oracle.com/software/tech/java/help/content.html

    If you are still having problems with OHW, please get back to us.

    Thanks,
    -brian
  • 328709
    328709 Member Posts: 48

    According to the release notes, it is the 1.1.1 limited production release, date July 31, 2002, and doing a tar tvf on ohw.jar, the files were jar-ed on July 31, 2002. I am using tomcat as the servlet engine rather than OC4J. Is there any other tests I could be running to verify whether these issues are a defect or not?

    thanks,

    Elizabeth.
  • 307050
    307050 Member Posts: 163
    Thanks for the info. I think I've got a better idea of what's going on here. So there are two different issues here (as I understand, please correct me if not!).

    1) Index, Contents and Search tabs are not localized.
    Each helpset file contains the list of navigators (views) to be displayed for that helpset. For each <view> that is specified, a <label> may also be optionally supplied. If such a <label> is supplied, this is the literal contents that will be displayed for that tab in the OHW user interface. If the <label> is not supplied, however, an appropriate default (Contents, Index or Search) will be displayed, properly translated. (OHW includes the translations of these strings.)

    So, my guess is that your helpsets that you see showing English tabs have English <label>s on the <view>s. Unless you have some specific text you'd rather use, I'd suggest leaving off the <label> in general.

    2) Go, View Topic, Printable Page, etc. are garbled.
    The problem you're seeing here is that these buttons are represented as images that are automatically generated by OHW behind the scenes. Since these images are generated on the server, the server must have access to an appropriate font for those characters. This can be done in one of two ways: installing an appropriate font with the operating system, or copying the .TTF file to the directory $JAVA_HOME/jre/lib/fonts.

    Then, once the font is available to the JVM, you need to make sure OHW knows about it. OHW by default expects to render CJK images using the Albany family of fonts. If you are using different fonts, you need to edit the file cabo/styles/blaf.xss inside your OHW installation directory to change the font that OHW will use to generate images on the server. The parameter you want to change is called DefaultServerFontFamily. You'll see that blaf.xss contains a number of references to that parameter. What you want to do is to find the <styleSheet> section for the locale you're trying to configure and change the font family parameter. For example, the default stylesheet info for ja on my install is:

    <!-- Style sheet just for Japanese-specific styles -->
    <styleSheet locales="ja">

    <style name="DefaultServerFontFamily">
    <property name="font-family">Albany WT J, Dialog</property>
    </style>

    <!-- other details omitted -->
    </styleSheet>

    You should replace the "Albany WT J" text with the name of the font you'd like to use.

    I hope this resolves your problems! Please follow up with your results.

    -brian
  • 328709
    328709 Member Posts: 48

    Brian,

    Thank you for the explanations and where to look. These changes did indeed fix the problem with the garbled characters and the English labels in the tabs. I used "MS UI Gothic" for my Japanese servlet, and "MS San Serif" for my Chinese servlet. Both now display Japanese & Chinese text for the tabs. An interesting note is that the "Go" and "Printable Page" buttons for the Chinese servlet does not have the yellow oval background; the text is displayed directly on the page, the links do work.

    I was using the Oracle Help Guide as one of my sample help volumes, and it had the <label> attributes for the <View>s. Once I removed those labels, then the tabs showed up with the localized text.

    thanks again for your help,

    Elizabeth.
  • 307050
    307050 Member Posts: 163
    Elizabeth:

    I'm glad you're having more success, but the problem you describe with the Chinese buttons not having the yellow oval background sounds weird. Can you e-mail a few screen captures showing this, along with the Chinese section of your blaf.xss file, to [email protected]? (Also, if you have a URL you can send us to look at this instance directly, that would be great as well.)

    Thanks,
    -brian
  • 307050
    307050 Member Posts: 163
    What's actually happening is that the Chinese font you specified ("MS San Serif") is not being found, so OHW is using text instead of images for the tabs and buttons. (The tabs are actually not working right either, but they look close enough to right that you probably didn't notice.) I suspect the problem here is that the font name is "MS Sans Serif".

    So, try changing the font name to MS Sans Serif and see if that resolves the problem. (I am presuming that your version of that font has Chinese glyphs? On my English Win2k machine, that is not the case.)

    You might also want to try some different Chinese fonts. I don't know much about fonts to use for Chinese and Japanese, but I'm going to ask our internationalization guru to post some recommendations for fonts to use.

    -brian
  • 328709
    328709 Member Posts: 48

    MS Sans Serif produced boxes, as well as "Microsoft Sans Serif". I'll also do some additional investigation to see what fonts contain the Simplified Chinese character set and whether our product will need to ship extra fonts for non-Chinese systems.

    Elizabeth.
  • 89524
    89524 Member Posts: 13
    Elizabeth,

    The MS Sans Serif font displays boxes as it does not contain any glyphs for Simplified Chinese. For Simplified Chinese on Windows 2000, try using 'SimSun'. For Japanese on Windows 2000, try 'MS Mincho' or 'MS Gothic'. There are other choices of Windows 2000 included fonts that do contain glyphs for CJK -- Chinese (both Simplified and Traditional), Japanese, and Korean. If you need a recommendation for Traditional Chinese or Korean, drop us a reply on this thread.

    Also, there are what are called Megafonts. Megafonts support a huge numbers of glyphs for a large number of different scripts (and are very large in size). Bitstream Cyberbit, Arial Unicode MS (included in latest versions of MS Office), and Code 2000 are a few examples. The single font is usually quite large, but with only the one font, you can cover many different languages. Just the same, while these font recommendations satisfy a many of our Oracle customers, other Oracle customers are quite particular about the look of the glyphs for their language. You might keep customer tastes and needs in mind as you make your own choices.

    To find fonts with glyphs for a particular character set you can also do some self-guided discovery with system tools such as the Windows Start|Programs|Accessories|System Tools|Character Map application. The Font2DTest demo in the Sun JDK is also very useful (be sure to use the JDK 1.3.X version of Font2DTest). Character Map works only for Microsoft Windows platforms and other platforms may have their own proprietary font and glyphs finding tools. Font2DTest has the advantage that it can be used to identify fonts and glyphs on any Java supported platform.

This discussion has been closed.