wince国际化语言支持

在wince5下面pb自带了12种语言的res文件,这些文件就是相应语言的一些系统对话框,菜单之类的resource。这12种语言分别是:
0x0404 Chinese  Taiwan
0x0407 German   Germany
0x0409 English  US
0x040C Franch   France
0x0410 Italian  Italy
0x0411 Japanese Japan
0x0412 Korean   Korea
0x0413 Dutch    Newtherlands
0x0416 Portuguese Brail
0x041D Swedish  Sweden
0x0804 Chinese  PRC
0x0C0A Spanish  Span
也就是说在pb->setting->local中选择以上12种语言之一编译后,系统就是相应语言的系统,但是如果要想支持输入法和字库的话,还是要加相关的输入法和字库组件。
 
    但是象Arabic这样的PB就没有直接提供res文件。当然这些res文件可以自己做(无非就是建立对话框,添加按钮,编辑框之类的),不过前提是你要懂得相关的语言。如果你要是在pb->setting->local中选择arabic相关语言的话,在你编译后的nk运行后,一直都english的。因为,在makeimage的时候,如果没有找到相关语言的res文件的话,就用默认的0x0409来代替。
 
    另外wince还提供了以下几个locale-specific的支持,help中说locale-specific 包括fonts, keyboards and keyboard drivers, Input Method Editors (IMEs), and Input Methods (IMs).
Arabic 
Chinese (Simplified) 
Chinese (Traditional) 
English (U.S.) 
English (Worldwide) 
French 
German 
Hebrew 
Indic 
Japanese 
Korean 
Thai 
也就是说,以上语言的的输入法或者字库wince都是以组件的形式提供了的,在pb的catalog中可以找到。
 
以下部分是关于complex script 的(copy from pb help)
A complex script has at least one of the following attributes:
  • Allows bidirectional rendering
  • Has contextual shaping
  • Has combining characters
  • Has specialized word-breaking and justification rules
  • Filters out illegal character combinations
Bidirectional rendering refers to the script's ability to handle text that reads both left-to-right and right-to-left. For example, in the bidirectional rendering of Arabic, the default reading direction for text is right-to-left, but for some numbers, it is left-to-right. Processing a complex script must account for the difference between the logical (keystroke) order and the visual order of the glyphs.
In addition, processing must properly deal with caret movement and hit testing. The mapping between screen position and a character index for, say, text selection or caret display requires knowledge of the layout algorithms.
 
Contextual shaping occurs when a script's characters change shape depending on the characters that surround them. This occurs in English cursive writing when a lowercase "l" changes shape depending on the character that precedes it such as an "a" (connects low to the "l") or an "o" (connects high). Arabic is a script that exhibits contextual shaping.
 
Combining characters (ligatures) are characters that join into one character when placed together. One example is the "ae" combination in English; it is sometimes represented by a single character. Arabic is a script that has many combining characters.
 
Specialized word break and justification refers to scripts that have complex rules for dividing words between lines or justifying text on a line. Thai is such a script.
 
Filtering out invalid character combinations occurs when a language does not allow certain character combinations. Thai is such a script.
 
Windows CE provides the support for Complex Scripts and allows run-time images to be created for the following locales:
  • Arabic
  • Gujarati
  • Hebrew
  • Hindi
  • Kannada
  • Marathi
  • Punjabi
  • Tamil
  • Telugu
  • Thai
The Windows CE support for Complex Scripts includes:
  • Uniscribe scripting engine.
  • Mirroring.
  • Complex scripts in graphics device interface (GDI), Common Controls, and Graphics, Windowing, and Events Subsystem (GWES).
  • Complex scripts content rendering and intrinsic control support in Internet Explorer 6 for Windows CE.
    Note   Windows CE does not support Complex Script input through the command line (cmd.exe).
    Windows CE also does not support printing for Complex Scripts.

Applications that are not enabled for Complex Scripts

  • The following Windows CE applications are not enabled for Complex Scripts:
  • Microsoft® Pocket Internet Explorer
  • Instant Messenger
  • Word Pad
  • Inbox
  • File Viewers
When creating a Complex Scripts-enabled Run-time image, you need to complete a set of steps to make sure your run-time image includes all the required locale-specific support.
To create a Complex Scripts-enabled run-time image
  1. In Platform Builder, from the File menu, choose New Platform.
  2. Complete the New Platform Wizard to create a basic OS design using the appropriate design template, such as an Enterprise Web Pad.
  3. In the Catalog, expand the International node, locate the Unicode Processor for Complex Scripts Catalog item, and drag it to the Workspace window.
  4. From the Catalog, add the locale-specific support to your run-time image. For example, if you want to include support for Arabic in your run-time image, navigate to the Arabic folder underInternational\Locale Specific Support and select the appropriate font and keyboard Catalog items.
  5. From the Platform menu, choose Settings. The Platform Settings dialog appears.
  6. In the Platform Settings dialog box, on the Locales tab, select the appropriate locale for your run-time image. Selecting the target locale will include the required NLS data and the associated ANSI and default OEM code pages for that locale.
    Note   You can clear any of the locales that are selected by default.
  7. From the Default language drop-down list, select the default language for your run-time image.
  8. Clear Localize the build , and then choose OK.
  9. In Windows Explorer, navigate to the %_WINCEROOT%\PUBLIC\COMMON\OAK\FILES\INTLTRNS directory.
  10. Create a new folder and name it with the locale identifier (LCID) that will be the default LCID for your run-time image. For example, if you want to create a run-time image with an LCID that defaults to Arabic (Saudi Arabia), name the new folder "0401." For a list of locale identifiers, see Language Identifiers and Locales.
  11. In the %_WINCEROOT%\PUBLIC\COMMON\OAK\FILES\INTLTRNS directory, navigate to the 0409 folder, and copy the Common.str file.
  12. Open the folder for your default LCID that you created in Step 10, and paste Common.str into this folder.
  13. Open the Common.str file you just pasted and change the following values to the default LCID of your run-time image: 
    #define LOC_LCID    ~"<default LCID>"
    #define LOC_ACP    ~"<default code page>"
    #define LOC_HKL_DEFAULT    ~"<default HKL value>"
    Save Common.str.
    Note   The values for the LCID and default code page have to be hexadecimal.
    The following table lists the Handle to the Keyboard Layout (HKL) values for the Complex Scripts locales.

本文出自 “bluefish” 博客,请务必保留此出处http://bluefish.blog.51cto.com/214870/73451

posted on 2013-06-13 11:47  王亮1  阅读(149)  评论(0编辑  收藏  举报

导航