Export (0) Print
Expand All

International Coding Checklist

Archived content. No warranty is made as to technical accuracy. Content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Abstract

This paper provides a checklist, guidelines, and suggestions for creating international software for the Windows and Windows NT operating systems.

Introduction

The process of creating software for global markets has two distinct phases: internationalization, which covers generic coding and design issues, and localization, which involves translating and customizing a product for a specific market. This paper provides a checklist of guidelines and suggestions for developers to use when internationalizing software for the Windows and Windows NT operating systems. The suggestions in this checklist will simplify localization of your program

This document is intended as a checklist only. For complete information on developing software for international markets, see Developing International Software for Windows 95 and Windows NT, Microsoft Press.

Coding Checklists

DBCS Enabling

To write double-byte character set (DBCS) enabled code

1

Avoid assuming:

 

 

a fixed character size

 

 

a fixed lead byte range

 

2

Use CharPrev and CharNext instead of p-- or p++

 

3

Treat lead bytes and trail bytes as one unit

 

4

Handle WM_IME_CHAR

 

5

Store code page information with data

 

6

Check your algorithms for:

 

 

caret positioning

 

 

pointer arithmetic

 

 

character code alignment

 

 

word wrapping

 

Unicode Enabling

To write Unicode-enabled software

1

Use:

 

 

generic data types TCHAR, LPTSTR for text

 

 

LPVOID for pointers of indeterminate type

 

 

explicit types LPBYTE for byte pointers

 

 

the TEXT macro

 

 

generic function prototypes

 

2

Avoid:

 

 

algorithms that assume small character sets

 

 

translation to and from code pages

 

 

assuming a character size

 

Font Technology

To select the appropriate font and output text in local script

1

Use:

 

 

EnumFontFamilies or ChooseFont to select fonts

 

 

GetTextCharSetInfo to generate the font signature

 

 

GetLocaleInfo to generate the locale signature

 

2

Record the charset in your document files

 

3

Avoid:

 

 

using OEM_CHARSET

 

 

using ANSI_CHARSET by default

 

 

assuming a given font facename exists

 

Bidirectionality

To support bidirectionality in your software

1

Use GetFontLanguageInfo and GetCharacterPlacement to
reorder text:

 

2

Use ExtTextOut

 

Vertical Writing

To implement vertical writing in your software

1

Use fonts with @ in front of facename

 

2

Set escapement and orientation to 270[degree]

 

3

Check your algorithms for:

 

 

coordinates calculation

 

 

caret positioning

 

 

caret orientation

 

 

virtual key handling

 

Changing Input Language

To handle changing the input language properly

1

Add code to manage WM_INPUTLANGCHANGEREQUEST and WM_INPUTLANGCHANGE

 

2

Use GetLocaleInfo and either TranslateCharsetInfo or
GetTextCharsetInfo to determine if language is supported by available fonts

 

3

Use ActivateKeyboardLayout to activate a specific layout

 

Locale Awareness

To make your software locale-aware

1

Use the National Language Support (NLS) API to:

 

 

formulate date and time

 

 

create calendars

 

 

format numbers and currency

 

 

compare strings

 

 

sort strings

 

 

validate code pages

 

 

generate locale font signatures

 

 

enumerate system code pages

 

Localizability

To make your software localizable

1

Isolate all UI elements

 

2

Be sure UI elements are not:

 

 

hidden

 

 

overlapping

 

 

part of sentences

 

3

Use dynamic buffers to allow maximum buffer size

 

4

Document string usage

 

5

Be sure strings are not:

 

 

built at run time

 

 

concatenated

 

 

built by stripping out characters

 

6

Do not use string substitution unless absolutely necessary

 

7

Use FormatMessage for strings that have several arguments

 

8

Do not build sentences at runtime

 

9

Avoid gender dependencies

 

10

Be sure icons or bitmaps do not contain text

 

 

Be sure Resource IDs are:

 

 

constant throughout all language editions

 

 

unique in a file

 

 

the same across platforms

 

11

Be sure resources are:

 

 

standard Windows resources

 

 

categorized

 

12

Allow for forty percent (40%) growth of resources

 

13

Be sure the .RC file does not contain items that cannot be
localized

 

Multilingual UI

To implement a multilingual interface, do one of the following

1

Have multiple language resources in one executable

 

 

Retrieve resources with FindResource or FindResourceEx

 

2

Separate language DLLs

 

 

Use naming conventions for DLL extensions

 

 

Construct DLL names at runtime

 

 

Retrieve DLLs using FindFirstFIle or FindNextFile

 

To enable dynamic switching between languages

1

Enumerate languages at runtime

 

2

Provide a UI for the user to select a language

 

For More Information

When developing software for an international audience, see Developing International Software for Windows 95 and Windows NT by Nadine Kano, Microsoft Press, 1995, or visit http://www.microsoft.com/globaldev.

For the latest information on Windows NT Server, check out our World Wide Web site at http://www.microsoft.com/backoffice or the Windows NT Server Forum on the Microsoft Network (GO WORD: MSNTS). To access information via the World Wide Web, go to http://www.microsoft.com and select Microsoft BackOffice.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft