Creating an HTML-based online help system using QTextBrowser or QDesk-topServices.openUrl() is straightforward, whereas creating a system that uses Qt Assistant is trickier to set up. But no matter which approach we take to providing access to online help, the real challenge is the design and content of the online help documentation itself.

Setting up an application for translation is quite straightforward. A .pro file is normally used to list the .ts file and the .ui, .py, and .pyw files that have user-visible strings in them, and we must use pylupdate4 and lrelease to keep the .ts file up-to-date and to produce the .qm file. We can avoid using a .pro file by generating the initial .ts file and then using either or Make PyQt.

In terms of coding we must make sure that every user-visible string uses or QApplication.translate(). Strings that have replaceable arguments should always use QString.arg() with its numbered %n arguments rather than the Python % operator.

For numbers we may need to use %Ln to get the correct thousands and decimal separators. One trick we can use for currency symbols is to do something like this:

currency = QApplication.translate("Currency", "$")

and translate "$" as "€", "£", "¥", or whatever else is appropriate. For dates we can use QDate.toString(Qt.SystemLocaleDate) or QDate.toString(Qt.ISODate). For units of measurement it is probably best either to provide a sensible default that the user can change through a configuration dialog, or have a "first run" dialog that asks the user to choose their units, default paper size, and so on.

Was this article helpful?

0 0
Tube Me Some Traffic

Tube Me Some Traffic

Video Marketing Will Never Be The Same Again. Here's How YOU - Or ANYONE - Can Leverage On The Internet's 4th MOST TRAFFICKED WEBSITE TO BOOST YOUR POPULARITY amp PUBLICITY FOR BUSINESS via Video Marketing! With The Emergence Of Web Video Popularity, You CANNOT Afford To Miss Out On This Exponentially Growing Trend - Because It Could Make Or Break Your Popularity amp Business Growth!

Get My Free Ebook

Post a comment