Internationalization with Qt▲
The internationalization and localization of an application are the processes of adapting the application to different languages, regional differences and technical requirements of a target market. Internationalization means designing a software application so that it can be adapted to various languages and regions without engineering changes. Localization means adapting internationalized software for a specific region or language by adding locale-specific components (such as date, time, and number formats) and translating text.
Relevant Qt Classes and APIs▲
These classes support internationalizing of Qt applications.
-
QCollator: The QCollator class compares strings according to a localized collation algorithm.
-
QCollatorSortKey: The QCollatorSortKey class can be used to speed up string collation.
-
QLocale: The QLocale class converts between numbers and their string representations in various languages.
-
QStringConverter: The QStringConverter class provides a base class for encoding and decoding text.
-
QStringDecoder: The QStringDecoder class provides a state-based decoder for text.
-
QStringEncoder: The QStringEncoder class provides a state-based encoder for text.
-
QTextCodec: The QTextCodec class provides conversions between text encodings.
-
QTextDecoder: The QTextDecoder class provides a state-based decoder.
-
QTextEncoder: The QTextEncoder class provides a state-based encoder.
-
QTranslator: The QTranslator class provides internationalization support for text output.
Languages and Writing Systems▲
In some cases internationalization is simple, for example, making a US application accessible to Australian or British users may require little more than a few spelling corrections. But to make a US application usable by Japanese users, or a Korean application usable by German users, will require that the software operate not only in different languages, but use different input techniques, character encodings and presentation conventions.
Qt tries to make internationalization as painless as possible for developers. All input controls and text drawing methods in Qt offer built-in support for all supported languages. The built-in font engine is capable of correctly and attractively rendering text that contains characters from a variety of different writing systems at the same time.
Qt supports most languages in use today, in particular:
-
All East Asian languages (Chinese, Japanese and Korean)
-
All Western languages (using Latin script)
-
Arabic
-
Cyrillic languages (Russian, Ukrainian, etc.)
-
Greek
-
Hebrew
-
Thai and Lao
-
All scripts in Unicode 6.2 that do not require special processing
-
Bengali
-
Burmese (Myanmar)
-
Devanagari
-
Gujarati
-
Gurmukhi
-
Kannada
-
Khmer
-
Malayalam
-
Tamil
-
Telugu
-
Tibetan
The list above is supported and will work on all platforms as long as the system has fonts to render these writing systems installed.
On Windows, Linux and Unix with FontConfig (client side font support) the following languages are also supported:
-
Dhivehi (Thaana)
-
Syriac
-
N'Ko
On macOS, the following languages are also supported:
-
Oriya
-
Sinhala
Many of these writing systems exhibit special features:
-
Special line breaking behavior. Some of the Asian languages are written without spaces between words. Line breaking 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. The exact behavior is defined in the 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. In special contexts, 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.
Qt tries to take care of all the special features listed above. You usually don't have to worry about these features so long as you use Qt's input controls (e.g. QLineEdit, QTextEdit, and derived classes or the Quick TextInput item) and Qt's display controls (e.g. QLabel and Qt Quick's Text item).
S