CopperSpice API  1.8.1
Internationalization

Classes

class  QLocale
 Converts between numbers and their string representations in various languages More...
 
class  QTextCodec
 Conversions between text encodings and QString More...
 
class  QTextDecoder
 State-based decoder More...
 
class  QTextEncoder
 State-based encoder More...
 
class  QTranslator
 Internationalization support for text output More...
 

Detailed Description

The idea of internationalizing an application is the process of adapting the software to support different languages. Localization involves adapting internationalized software for a specific language.

Internationalization is accomplished in a CopperSpice program by marking various strings which can be translated to another language. The localization process is what provides the translations or adjustments to number and date formats.

Writing Systems

Providing the localization for some regions is pretty simple. A program written with English text can easily be adapted for countries like Canada, Australia, or England with relatively few changes. Providing the translations and other localization changes for regions like Japan, Korea, or Germany will require more substantial work.

Input widgets and text drawing methods offer built in support for rendering text which contains glyphs from a variety of different written languages.

Special line breaking behavior
Some of the Asian languages are written without spaces between words. Line breaks can occur either after every character (with exceptions) as in Chinese, Japanese and Korean, or after logical word boundaries as in Thai.
Bidirectional writing
Arabic and Hebrew are written from right to left, except for numbers and embedded English text which is written left to right.
For more information refer to Unicode Technical Annex #9.
Non-spacing or diacritical marks (accents or umlauts in European languages)
Some languages such as Vietnamese make extensive use of these marks and some characters can have more than one mark at the same time to clarify pronunciation.
Ligatures
Some pairs of characters get replaced by a combined glyph forming a ligature. Common examples are the fl and fi ligatures used in typesetting US and European books.

Special Cases

The following are special cases which may require some additional work.

QPainter::drawText(int x, int y, const QString8 &str)
Always draws the string with the left edge at the position specified with the x, y parameters. This will usually give you left aligned strings. Arabic and Hebrew application strings are usually right aligned so for these languages use the version of drawText() which takes a QRect. This will align in accordance with the language.
QTextLayout
In some languages such as Arabic or languages from India, the width and shape of a glyph changes depending on the surrounding characters, which QTextLayout takes into account. Writing custom input controls usually requires a certain knowledge of the scripts being utilized. Subclassing QLineEdit or QTextEdit is suggested for these situations.

Additional Documentation