O'Reilly logo

Game Programming using Qt 5 Beginner's Guide - Second Edition by Lorenz Haas, Witold Wysota, Pavel Strakhov

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Internationalization

Most real projects have a target audience in multiple countries. The most notable difference between them is the spoken language, but there are other aspects some developers may not think of. For example, dot "." and comma "," are both fairly common as the decimal separator throughout the world. Date formats are also very different and incompatible, and using a wrong format (for example, mm/dd/yyyy instead of dd/mm/yyyy) will result in a completely different date.

Qt provides the QLocale class for dealing with locale-dependent operations, including conversions between numbers in strings. In the following code, text and number may have different values, depending on the system locale:

QLocale locale = QLocale::system(); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required